Skip to content

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 <github@achow101.com>, Antoine Poinsot <darosior@protonmail.com>
@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

No conflicts as of last run.

@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.

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