Skip to content

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

Closed
w0xlt wants to merge 1 commit intobitcoin:masterfrom
w0xlt:r_26573
Closed

descriptor: don't underestimate the size of a Taproot spend (instead, overestimate it)#32964
w0xlt wants to merge 1 commit intobitcoin:masterfrom
w0xlt:r_26573

Conversation

@w0xlt
Copy link
Contributor

@w0xlt w0xlt commented Jul 14, 2025

This PR revives #26573 since it has some ACKs and is labeled "Up for grabs".
I just added a comment explaining the behavior change.

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 <[email protected]>, Antoine Poinsot <[email protected]>
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 14, 2025

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.

@Sjors
Copy link
Member

Sjors commented Jul 14, 2025

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.

@w0xlt
Copy link
Contributor Author

w0xlt commented Oct 21, 2025

Closing in favor of #32857.

@w0xlt w0xlt closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants