You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#31622: psbt: add non-default sighash types to PSBTs and unify sighash type match checking
ee045b6 rpc, psbt: Require sighashes match for descriptorprocesspsbt (Ava Chow)
2b7682c psbt: use sighash type field to determine whether to remove non-witness utxos (Ava Chow)
28781b5 psbt: Add sighash types to PSBT when not DEFAULT or ALL (Ava Chow)
15ce1bd psbt: Enforce sighash type of signatures matches psbt (Ava Chow)
1f71cd3 wallet: Remove sighash type enforcement from FillPSBT (Ava Chow)
4c7d767 psbt: Check sighash types in SignPSBTInput and take sighash as optional (Ava Chow)
a118256 script: Add IsPayToTaproot() (Ava Chow)
d6001dc wallet: change FillPSBT to take sighash as optional (Ava Chow)
e58b680 psbt: Return PSBTError from SignPSBTInput (Ava Chow)
2adfd81 tests: Test PSBT sighash type mismatch (Ava Chow)
5a5d26d psbt: Require ECDSA signatures to be validly encoded (Ava Chow)
Pull request description:
Currently, we do not add the sighash field to PSBTs at all, even when we have signed with a non-default sighash. This PR changes the behavior such that when we (attempt to) sign with a sighash other than DEFAULT or ALL, the sighash type field will be added to the PSBT to inform the later signers that a different sighash type was used by a signer. Notably, this is necessary for MuSig2 support as all signers must sign using the same sighash type, but the sighash is not provided in partial signatures.
Furthermore, because the sighash type can also be provided on the command line, we require that if both a command line sighash type and the sighash field is present, they must specify the same sighash type. However, this was being checked by the wallet, rather than the signing code, so the `descriptorprocesspsbt` RPC was not enforcing this restriction at all, and in fact ignored the sighash field entirely. This PR refactors the checking code so that the underlying PSBT signing function `SignPSBTInput` does the check.
ACKs for top commit:
theStack:
re-ACK ee045b6
rkrux:
re-ACK ee045b6
fjahr:
Code review ACK ee045b6
Tree-SHA512: 4ead5be1ef6756251b827f594beba868a145d75bf7f4ef6f15ad21f0ae4b8d71b38c83494e5a6b75f37fadd097178cddd93d614b962a2c72fc134f00ba2f74ae
/** Reduces the size of the PSBT by dropping unnecessary `non_witness_utxos` (i.e. complete previous transactions) from a psbt when all inputs are segwit v1. */
0 commit comments