Skip to content

release/3.x: sign mixed taproot and non-taproot inputs (backport #641) - #643

Merged
noahjoeris merged 4 commits into
bitcoindevkit:release/3.xfrom
noahjoeris:backport3.x/mixed-taproot-signing
Nov 17, 2026
Merged

noahjoeris merged 4 commits into
bitcoindevkit:release/3.xfrom
noahjoeris:backport3.x/mixed-taproot-signing

Conversation

@noahjoeris

Copy link
Copy Markdown
Contributor

Description

Backport of #641 to release/3.x.

Cherry-picked from #641: d01c07d, 32dd8d8.

Depends on #636.

Changelog notice

Fixed signing of mixed taproot/non-taproot inputs.

Before submitting

Since 3.2.0, the wallet refused to sign these because taproot inputs
never get `non_witness_utxo`. Verify taproot amounts against the
parent tx stored in the wallet instead. Also verify amounts when
ANYONECANPAY is used.

(cherry picked from commit d01c07d)
@noahjoeris
noahjoeris requested a review from a team as a code owner November 9, 2026 12:51
@github-project-automation github-project-automation Bot moved this to Triage in BDK Wallet Nov 9, 2026
@noahjoeris noahjoeris self-assigned this Nov 9, 2026
@noahjoeris noahjoeris moved this from Triage to Needs Review in BDK Wallet Nov 9, 2026
@noahjoeris noahjoeris added this to the Wallet 3.3.0 milestone Nov 9, 2026
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.77465% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.95%. Comparing base (fe8de33) to head (cb20372).
⚠️ Report is 3 commits behind head on release/3.x.

Files with missing lines Patch % Lines
src/wallet/signer.rs 70.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/3.x     #643      +/-   ##
===============================================
+ Coverage        81.62%   81.95%   +0.33%     
===============================================
  Files               25       25              
  Lines             6339     6380      +41     
  Branches           302      311       +9     
===============================================
+ Hits              5174     5229      +55     
+ Misses            1056     1045      -11     
+ Partials           109      106       -3     
Flag Coverage Δ
rust 81.95% <95.77%> (+0.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Musab1258

Copy link
Copy Markdown
Contributor

tACK cb20372

I merged the PR head on top of release/3.x (ce256cc) locally (it was a clean merge) and I ran just pre-push (nightly fmt, check, clippy -D warnings, stable and unstable test suites, doc build): all pass.

I also ran git range-diff 91d3f8e..32dd8d8b pr-643~2..pr-643 and it shows only the cherry-picked from trailers differ, so the patches match #641 exactly.

When I reverted only the signer.rs changes, test_psbt_sign_mixed_taproot_and_segwit_v0 fail (MissingNonWitnessUtxo); But when I reverted only the mod.rs changes, both new tests fail (understated amounts no longer rejected with InvalidNonWitnessUtxo). Which is the same behavior as on #641.

The newer base commits (wildcard path validation in the xpriv signer, plus #636’s merge) don’t conflict, and the tests pass on the merged tree.

@reez reez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cb20372

I see notmandatory left a comment on #641 that's unresolved (and I couldn’t find a follow up for it yet), but seemed non blocking since he ACKd, treating same here

@notmandatory notmandatory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cb20372

Confirmed this change is the same as #641 and tests pass. I agree with @reez I'd like to know if the issue I brought up in 641 needs to be fixed, but it's not a show stopper.

@noahjoeris

Copy link
Copy Markdown
Contributor Author

Thanks guys. I'm looking into it

@noahjoeris
noahjoeris merged commit f34624e into bitcoindevkit:release/3.x Nov 17, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in BDK Wallet Nov 17, 2026
This was referenced Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants