Skip to content

non-standard ECDSA sighash types are not preserved, but allowed in PSBT #777

@apoelstra

Description

@apoelstra

In #669 (comment) we decided to allow non-standard sighash types in PSBT partial signatures, on the grounds that the PSBT spec doesn't forbid them and they're allowed by consensus.

However, as Sanket reminds me at rust-bitcoin/rust-miniscript#290 (comment), our EcdsaSighHashType does not actually distinguish between different nonstandard sighash types, and effectively silently converts them all to 1. This will cause bugs in PSBT if somebody actually tries to use the sighash type.

Solutions are:

  • Petition the Bitcoin BIPs repo to restrict PSBT to disallow nonstandard sighash types
  • Restrict sighash types in our code, regardless of what the BIP says
  • Fix the EcdsaSigHashType to keep track of which nonstandard type it uses (and then do the right thing during sighash computations, serialization, etc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0Issues and PRs required or helping to stabilize the APIbrainstorm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions