#36039 psbt: classify missing Taproot script-path signatures as signer

ReviewabilityReviewsAgreementSize
#36039 btcpavao psbt: classify missing Taproot script-path signatures as signerWaiting on author0Strong12 + 11 tests
  • Classify missing Taproot script-path signatures properly during PSBT analysis
  • Prevent misleading wallet warnings that inputs are missing information when ready to sign
  • Ready for review
  • No review verdicts recorded
  • Verified by testing that unsigned script-path PSBT inputs correctly transition to signer (fametrano)
  • Suggestion to avoid an output parameter by updating signature data directly (achow101)
  • Suggestion to cover key-path changes with tests if adopting the suggested restructure (fametrano)
  • 12 lines added or modified outside tests
  • 11 lines added or modified in tests
  • 3 lines removed in total
  • 3 files, 1 commits
Wallet#44 of 92
P3 · bug fix
  • P3 because it fixes a false warning in the GUI when signing Taproot script-path spends
  • Prevents PSBT analysis from misclassifying inputs as needing an updater instead of a signer
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

This PR updates `CreateTaprootScriptSig()` in `src/script/sign.cpp` to record missing signatures in `sigdata.missing_sigs` when a Taproot script-path Schnorr signature is absent and not part of a MuSig2 aggregate. It also adds regression tests in `test/functional/rpc_psbt.py` and `test/functional/wallet_musig.py`.

Problem: When inspecting a PSBT spending via a Taproot script path (such as a 2-of-3 Taproot multisig), `AnalyzePSBT()` failed to detect missing signatures and classified the input's next role as `updater` instead of `signer`. In the wallet GUI, this surfaced as an inaccurate warning that the transaction was 'missing some information about inputs' even though the PSBT was complete and ready to sign.

Reviewability

Paused · Waiting on author

Open objections from achow101, fametrano with no author reply for 29 days; review would repeat what has been asked.

Waiting on (from the thread read):

  • author: address achow101's restructure suggestion and fametrano's observations on key-path implications 2026-10-02

Agreement

Strong

substantive support, no open objection (fametrano)

Thread notes: fametrano tested the script-path fix, confirming it fixes the issue, and noted the side-effects on key-path signing and testing if achow101's restructure suggestion is implemented.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
achow101 (member)objection, correctnessPSBT analysis is incorrect for transactions involving a musigfixed · fix pushed · author updated the patch to distinguish MuSig aggregate matches and added a regression checkchangedyes2026-08-20: 'This results in the analysis still being incorrect for transactions involving a musig.'
Status from: 2026-08-20: btcpavao: 'I updated the patch to distinguish when `SignMuSig2()` actually matched a MuSig2 aggregate, and only add `missing_sigs` '
achow101 (member)suggestion, approachAvoid adding an output parameter by having SignMuSig2 update sigdata directlyopenansweredno2026-10-02: 'Adding an output parameter here is entirely unnecessary. `SignMuSig2` has access to `sigdata`, it can update the fields itself if no signature was made.'
fametrano (contributor)suggestion, scopeIf adopting achow101's restructure, consider key deduplication in make_keypath_sig and add a key-path test case to rpc_psbt.pyopenansweredno2026-10-03: 'And a key-path case in `rpc_psbt.py` would then belong in this PR, since its behaviour changes.'

Support:

  • fametrano (contributor) (2026-10-03) [both: analyzepsbt, SignMuSig2, make_keypath_sig, rpc_psbt.py]: confirmed that an unsigned script-path PSBT input moves from updater to signer with missing.signatures naming K and that a wallet holding only K successfully signs and finalizes it

Participants:

  • achow101 (member, objection, 2 statements 2026-08-20 to 2026-10-02): objected to incorrect PSBT analysis for MuSig transactions; suggested updating sigdata directly inside SignMuSig2
  • fametrano (contributor, support, 1 statements 2026-10-03 to 2026-10-03): tested script-path classification fix and noted key-path implications if SignMuSig2 is restructured

Files

11 lines under test/bench/ci.

  • src/script/sign.cpp +12/-3
  • test/functional/rpc_psbt.py +6/-0
  • test/functional/wallet_musig.py +5/-0

Card

The short text the ranking pass compares across PRs.

This PR fixes a bug in Taproot script-path PSBT analysis where inputs missing Schnorr signatures were classified as needing an updater instead of a signer. This addresses issue #36035, where the wallet GUI reported that a Taproot multisig PSBT was missing information about inputs despite being ready to sign. The patch updates CreateTaprootScriptSig in src/script/sign.cpp to track missing signatures and adds regression coverage. achow101 caught a bug in the initial MuSig2 handling, which the author resolved in the current push; it now awaits review.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-04T01:17, confidence high, input hash 6f1a8751d803fdb2
thread read through 2026-10-03 (4 statements), head 641b52828a
labels: PSBT

Categories

Wallet

P3 · bug fix

Fixes incorrect role classification and misleading input-information warnings during PSBT analysis. `AnalyzePSBT()` failed to detect missing Taproot script-path signatures, classifying the next role as `updater` instead of `signer` and causing the wallet GUI to display an inaccurate warning that the transaction was 'missing some information about inputs'.

Membership: Labeled PSBT, modifies PSBT signing logic in `src/script/sign.cpp`, and directly affects wallet GUI role analysis and `wallet_musig` tests.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 0