rpc: Add validation for invalid taproot signatures in analyzepsbt #33360

pull jalateras wants to merge 1 commits into bitcoin:master from jalateras:fix-analyzepsbt-taproot-validation changing 2 files +43 −0
  1. jalateras commented at 0:55 am on September 11, 2025: none

    Summary

    This PR fixes issue #33320 by adding explicit validation for invalid taproot key path signatures in the analyzepsbt RPC command.

    Problem

    Currently, when a PSBT contains an invalid taproot_key_path_sig, analyzepsbt returns a confusing status of "next": "updater" instead of properly reporting the validation error. This can happen when external applications incorrectly construct PSBTs.

    Solution

    • Added validation in AnalyzePSBT to check for invalid taproot key path signatures
    • Check signature length (must be 64 or 65 bytes for valid Schnorr signatures)
    • Return clear error message when signature is invalid
    • Added test coverage in rpc_psbt.py

    Testing

    • Added functional test that verifies the error is properly reported for PSBTs with invalid taproot signatures
    • Existing tests continue to pass

    Fixes #33320

  2. rpc: Add validation for invalid taproot signatures in analyzepsbt
    Previously, analyzepsbt would return a confusing "next": "updater" status
    when a PSBT contained an invalid taproot key path signature, instead of
    properly reporting the validation error.
    
    This commit adds explicit validation for taproot key path signatures:
    - Check signature length (must be 64 or 65 bytes)
    - Provide clear error message when signature is invalid
    - Add test coverage for this edge case
    
    This helps external applications that may incorrectly construct PSBTs
    get better error feedback.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    e78d3573a0
  3. DrahtBot added the label RPC/REST/ZMQ on Sep 11, 2025
  4. DrahtBot commented at 0:55 am on September 11, 2025: contributor

    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/33360.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.


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: 2025-09-12 09:13 UTC

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