descriptor: don’t underestimate the size of a Taproot spend (instead, overestimate it) #32964

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:r_26573 changing 3 files +32 −7
  1. w0xlt commented at 6:55 am on July 14, 2025: contributor
    This PR revives #26573 since it has some ACKs and is labeled “Up for grabs”. I just added a comment explaining the behavior change.
  2. descriptor: don't underestimate the size of a Taproot spend
    We were previously assuming the key path was always used for size
    estimation, which could lead to underestimate the fees if one of the
    script paths was used in the end.
    
    Instead, overestimate: use the most expensive between the key path and
    all existing script paths.
    
    The functional test changes were authored by Ava Chow for PR 23502.
    
    Co-Authored-by: Ava Chow <github@achow101.com>, Antoine Poinsot <darosior@protonmail.com>
    3e4a555c43
  3. DrahtBot added the label Descriptors on Jul 14, 2025
  4. DrahtBot commented at 6:55 am on July 14, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32964.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32857 (wallet: allow skipping script paths by Sjors)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  5. Sjors commented at 11:31 am on July 14, 2025: member

    I don’t think we should be overpaying by default, for two reasons:

    1. it’s expensive
    2. it reveals the presence of script paths

    An intermediate solution could be that we never sign script paths by default, i.e. make keypath_only the default after #32857. Only when the user opts in to script path spending do we apply this solution of using the worst case fee.

    That seems better than the current “solution” of manually picking a higher fee rate for script path spends, while not impacting the default case of a working key path. It would reveal the presence of potentially longer script paths though.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-07-25 12:23 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me