psbt: drop Taproot and MuSig2 signatures when adding an input #36567

pull Ravan002 wants to merge 1 commits into bitcoin:master from Ravan002:psbt-addinput-taproot-sigs changing 2 files +18 −0
  1. Ravan002 commented at 7:50 PM on October 18, 2026: none

    PartiallySignedTransaction::AddInput clears partial_sigs, final_script_sig and final_script_witness of the input it adds, because the transaction is about to change and those signatures would no longer be valid. The Taproot key and script signatures and the MuSig2 pubnonces and partial signatures were left in place, so joinpsbts handed back inputs carrying signatures for the old transaction.

    They are cleared in the same place now.

    The functional test joins two PSBTs with signed Taproot inputs: before the change the joined inputs still have taproot_key_path_sig, after it they don't, and the wallet can sign the joined PSBT. It fails on master at that assertion. rpc_psbt.py and the psbt unit tests pass.

  2. psbt: drop Taproot and MuSig2 signatures when adding an input
    PartiallySignedTransaction::AddInput clears partial_sigs, final_script_sig
    and final_script_witness because adding an input changes the transaction,
    but kept the Taproot key and script signatures and the MuSig2 nonces and
    partial signatures. joinpsbts therefore returned inputs that carried
    signatures for a different transaction.
    b40ac85ff5
  3. fametrano commented at 11:07 PM on October 18, 2026: contributor

    Concept ACK b40ac85. With this PR, the v0 branch of AddInput clears every field that PSBTInput::HasSignatures checks, plus the MuSig2 public nonces. btclib-wallet, which I maintain, clears the same seven fields when it joins v0 PSBTs. I ran this PR's test scenario through it: no joined input keeps a key-path signature, and the joined PSBT signs both inputs again.

  4. jpk68 commented at 11:55 PM on October 18, 2026: contributor

    ACK b40ac85ff5df1f3a32912a990bddfffed3a64cb7

  5. fanquake added the label PSBT on Oct 19, 2026
  6. maflcko removed the label PSBT on Oct 19, 2026
  7. DrahtBot added the label PSBT on Oct 19, 2026
  8. DrahtBot commented at 7:15 AM on October 19, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK jpk68, Yudis-bit
    Concept ACK fametrano

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36521 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36521.svg"></sub> (Keep witness stacks in serialized form in CScriptWitness by sipa)

    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.

  9. Yudis-bit commented at 10:44 AM on October 19, 2026: none

    Tested ACK b40ac85ff5 on Windows.


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: 2026-10-28 15:51 UTC

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