psbt: accept taproot ALL sigs with sighash unset #36577

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:psbt-taproot-sighash-absent changing 2 files +87 −2
  1. fametrano commented at 8:49 PM on October 19, 2026: none

    SignPSBTInput() assumes SIGHASH_DEFAULT for a taproot input when neither PSBT_IN_SIGHASH_TYPE nor the caller's sighash_type is set. Its check of existing signatures then rejected every 65-byte taproot signature, so a PSBT holding a valid SIGHASH_ALL signature could be neither finalized nor signed further.

    When neither the field nor the parameter is set, the default is only assumed, so also accept a 65-byte signature ending in SIGHASH_ALL. NONE, SINGLE and ANYONECANPAY variants are still rejected, as are all mismatches when the field or the parameter is set.

    Fixes #36507.

    🤖 Generated with Claude Code

  2. psbt: accept taproot ALL sigs with sighash unset
    SignPSBTInput() assumes SIGHASH_DEFAULT for a taproot input when
    neither PSBT_IN_SIGHASH_TYPE nor the caller's sighash_type is set.
    Its check of existing signatures then rejected every 65-byte
    taproot signature, so a PSBT holding a valid SIGHASH_ALL signature
    could be neither finalized nor signed further.
    
    When neither the field nor the parameter is set, the default is only
    assumed, so also accept a 65-byte signature ending in SIGHASH_ALL.
    NONE, SINGLE and ANYONECANPAY variants are still rejected, as are
    all mismatches when the field or the parameter is set.
    
    Fixes #36507.
    1291d0e389
  3. DrahtBot added the label PSBT on Oct 19, 2026
  4. DrahtBot commented at 8:49 PM 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 Yudis-bit
    Approach ACK Husteem

    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:

    • #36382 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36382.svg"></sub> (rpc: flag invalid taproot leaf control blocks in decodepsbt by fametrano)
    • #36224 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36224.svg"></sub> (test: Add test coverage for PartiallySignedTransaction::Merge() by nebula-21)
    • #35747 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35747.svg"></sub> (wallet: Fix FillPSBT failing to sign owned inputs when UTXOs disagree by nervana21)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • src/test/psbt_tests.cpp: SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbt, 0, &txdata, {.finalize = true})

    <sup>2026-10-19 20:49:23</sup>

  5. Yudis-bit commented at 8:38 AM on October 20, 2026: none

    Tested ACK 1291d0e389 on Windows.

  6. Husteem commented at 4:57 PM on October 22, 2026: none

    Approach ACK / tACK 1291d0e

    Good fix for the referenced issue. When sighash_type is unset, accepting 65-byte Taproot signatures ending in SIGHASH_ALL is safe because it commits to the identical BIP-341 digest as SIGHASH_DEFAULT. Preserving rejection for other variants keeps Core's safety checks intact.

    Tested on Ubuntu 24.04:

    • psbt_tests passed (including both new absent-field tests).
    • rpc_psbt.py passed cleanly too.

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-31 11:51 UTC

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