Should PSBT finalizers/extractors and deserialization functions enforce the rule that a taproot schnorr signature should only append a SIGHASH_* unless it is SIGHASH_DEFAULT (0), or is it left to the implementer's discretion?

Ref: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#cite_note-21

  • Are you asking whether the finalizer should append a sighash byte for SIGHASH_DEFAULT signatures? Well, no, since it would make it invalid? Nov 17 at 12:56
  • No, i am asking this - should a finalizer check the signature (PSBT_IN_TAP_KEY_SIG/PSBT_IN_TAP_SCRIPT_SIG) and remove SIGHASH_DEFAULT and if it exist and then use the 64 byte signature? Or throw error?
    – solar
    Nov 17 at 13:14
  • Currently, bitcoinjs-lib finalizer blindly adds the 65 byte signature to the witness even if the sighash is SIGHASH_DEFAULT.
    – solar
    Nov 17 at 13:27
  • I believe the extractor role should check the validity of the transaction it produces, therefore it should explicitly error. Let me post a proper answer. Nov 17 at 14:10

1 Answer 1


This boils down to how to treat invalid signatures provided in a PSBT. I believe there is some room for implementation-defined behaviour with regard to the finalizer role. For instance if it can get around the invalid signatures by satisfying another spending path.

However the specification for the extractor role is pretty clear:

The Extractor should produce a fully valid, network serialized transaction if all inputs are complete.

Since the input finalizer and transaction extractor roles are often combined, and since explicit is better than implicit, i believe it would make sense to explicitly raise an error on an invalid signature. But nothing prescribes it in the specification itself.

  • Spec is not clear. But the case you made makes sense. Thanks.
    – solar
    Nov 17 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.