Bitcoin

Transactions – Is it possible to combine two PSBTs while maintaining the existing signature?

If you have 2 PSBTs of the same transaction, their signatures can be combined to complete the transaction. But I think you’re talking about two PSBTs. different work.

Typically, a signature commits the entire transaction using: SIGHASH_ALL sigh flag. In this case, signatures cannot be transferred from one transaction to another. Because the new transaction has different inputs or outputs, the original transaction’s signature is no longer committed to the new transaction’s set of inputs and outputs and is not valid in the context of the new transaction.

The exception is when you have a signature that applies only to one output and not to other inputs (SIGHASH_SINGLE|SIGHASH_ANYONECANPAY) or no output (SIGHASH_NONE|SIGHASH_ANYONECANPAY). In the first case, you can move one specific input and output pair to a new transaction, and in the second case, you can also use the input in any transaction you want. These signature hash types are not used very often, as the former has very limited applications and the latter is a way to sign money to whoever you want.

Therefore, you should not expect that it will be possible to combine two separate PSBTs without redoing all the signatures. This is because all input is almost exclusively signed. SIGHASH_ALL.

You can learn more about Bitcoin’s signature hash types in Raghav Sood’s excellent blog post on the topic, or in the Signatures chapter of Mastering Bitcoin 3rd Edition.

Related Articles

Back to top button