<p>If you have two PSBTs <em>of the same transaction</em>, you can combine signatures from them to complete a transaction. However, it seems to me that you are talking about two PSBTs of <em>different</em> transactions.</p>
<p>Generally signatures commit to the entire transaction using the <code>SIGHASH_ALL</code> sighash flag. In that case, you cannot transfer a signature from one transaction to a different one. As the new transaction has different inputs or outputs, the signature from the original transaction would no longer commit to the new transaction’s set of inputs and outputs and would be invalid in the context of the new transaction.</p>
<p>The exception is when you have a signature that does not commit to other inputs and just to one output (<code>SIGHASH_SINGLE</code>|<code>SIGHASH_ANYONECANPAY</code>) or no output (<code>SIGHASH_NONE</code>|<code>SIGHASH_ANYONECANPAY</code>). In the first case, you can move one specific input and output pair to a new transaction, or in the second case even use the input on any transaction you like. Given that the former has very limited applications and the latter is outright signing your money away to anyone that wants it, these signature hash types get used infrequently.</p>
<p>Therefore, you should not expect that combining two separate PSBTs to be possible without redoing all signatures, as all inputs will be signed almost exclusively with <code>SIGHASH_ALL</code>.</p>
<p>You can read more about Bitcoin’s signature hash types in Raghav Sood’s excellent <a href="https://raghavsood.com/blog/2018/06/10/bitcoin-signature-types-sighash/" rel="nofollow noreferrer">blog post</a> on that topic, or in the <a href="https://github.com/bitcoinbook/bitcoinbook/blob/6d1c26e1640ae32b28389d5ae4caf1214c2be7db/ch08_signatures.adoc#L213" rel="nofollow noreferrer">Signatures chapter</a> of Mastering Bitcoin 3rd Edition.</p>

CC BY-SA 4.0
2024-06-01T11:59:30.383Z
2024-06-05T14:53:11.880Z
2024-06-05T14:53:11.880Z
Murch
<p>What if I want to combine two PSBTs: one is signed by Alice’s private key, another one is unsigned. I want to take the input and output from the signed one, and combine them with the unsigned PSBT, then build a new unsigned PSBT, sign it with two different private keys, and finally broadcast it to Bitcoin network.</p>
<p>Is it possible to combine two PSBTs where one is signed, the other is unsigned?
Can you please post the related example or code here?</p>

<transactions><signature><bip174-psbt>
Is it possible to combine two PSBTs while retaining the existing signatures?
Jack Tsia
# Is it possible to combine two PSBTs while retaining the existing signatures?

(Asked by: username_0 on 2024-06-01)

What if I want to combine two PSBTs: one is signed by Alice’s private key, another one is unsigned. I want to take the input and output from the signed one, and combine them with the unsigned PSBT, then build a new unsigned PSBT, sign it with two different private keys, and finally broadcast it to Bitcoin network.

Is it possible to combine two PSBTs where one is signed, the other is unsigned?
Can you please post the related example or code here?

**Tags:** transactions, signature, bip174-psbt


---

## 1 answers

### Answer by username_1 on 2024-06-01. Score: 1 | Accepted answer

If you have two PSBTs *of the same transaction*, you can combine signatures from them to complete a transaction. However, it seems to me that you are talking about two PSBTs of *different* transactions.

Generally signatures commit to the entire transaction using the `SIGHASH_ALL` sighash flag. In that case, you cannot transfer a signature from one transaction to a different one. As the new transaction has different inputs or outputs, the signature from the original transaction would no longer commit to the new transaction’s set of inputs and outputs and would be invalid in the context of the new transaction.

The exception is when you have a signature that does not commit to other inputs and just to one output (`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, or in the second case even use the input on any transaction you like. Given that the former has very limited applications and the latter is outright signing your money away to anyone that wants it, these signature hash types get used infrequently.

Therefore, you should not expect that combining two separate PSBTs to be possible without redoing all signatures, as all inputs will be signed almost exclusively with `SIGHASH_ALL`.

You can read more about Bitcoin’s signature hash types in Raghav Sood’s excellent [blog post](https://raghavsood.com/blog/2018/06/10/bitcoin-signature-types-sighash/) on that topic, or in the [Signatures chapter](https://github.com/bitcoinbook/bitcoinbook/blob/6d1c26e1640ae32b28389d5ae4caf1214c2be7db/ch08_signatures.adoc#L213) of Mastering Bitcoin 3rd Edition.


---

