<p><code>combinepsbt</code> takes multiple PSBTs that have different input data and merges them. The base transaction must be exactly the same, i.e. the same inputs are consumed and the same outputs are created. The information for each input is combined into the same input. Inputs and outputs cannot be added or removed. This allows for people to send the same PSBT to be signed by multiple different people and then merge the resulting the PSBTs back together.</p>

<p>For example, suppose you have a PSBT that consumes 2 inputs, with input 1 requiring person A to sign and input 2 requiring person B to sign. You give both person A and person B copies of that PSBT to sign. Person A returns you a PSBT which has input 1 signed (i.e. they fill in input information like UTXO, partial signatures, final scriptSig, etc.) but input 2 is not. Person B returns you a PSBT which does not have input 1 signed but input 2 is signed. <code>combinepsbt</code> allows you to merge the PSBTs from both person A and person B into a single one which has both inputs signed.</p>

<p><code>joinpsbts</code> is very different from this. <code>joinpsbts</code> joins multiple PSBTs that have different underlying transactions into one transaction. It requires that the inputs of those underlying transactions be different from each other. Furthermore, <code>joinpsbts</code> will discard any signatures and finalized input fields from the original PSBTs (meaning the resulting PSBT will contain no signatures) as those signatures will likely be invalidated when joining.</p>

<p><code>joinpsbts</code> lets you make transactions which has other people involved in them (such as CoinJoins) more easily. Each person can specify the inputs and outputs they want in a PSBT and then all of these PSBTs with different inputs and outputs are merged together using <code>joinpsbts</code>.</p>

CC BY-SA 4.0
2019-03-26T15:15:37.960Z
So A performs a walletcreatefundedpsbt.
B perform a walletcreatefundedpsbt as well.
B sends his transaction to A.
A perform a joinpsbts with the two transactions.
A perform walletprocesspsbt signing the unsigned transaction.
B perform walletprocesspsbt signing the unsigned transaction as well.
A or B perform a  combinepsbt of the two transactions, a finalizepsbt and broadcast?
Thank you for your huge work and for answering.
Gabriele Domenichini
CC BY-SA 4.0
2019-03-26T16:27:48.893Z
Yes, that is a possible workflow.
Ava Chow
CC BY-SA 4.0
2019-03-26T14:52:30.273Z
2019-03-26T14:52:30.273Z
Ava Chow
<p>They seem to do pretty much the same thing.
The only apparent difference being that combinepsbt seems more for updating the same psbt with imcremental signatures while joinpsbts seems more for joining <em>different</em> transactions but given in combinepsbt you can also add different inputs and outputs I don't see the difference.</p>

CC BY-SA 4.0
2019-03-26T14:54:32.267Z
What makes you think that `combinepsbt` can add inputs and outputs? It is not supposed to, and if it does, that is a bug and should be fixed.
Ava Chow
CC BY-SA 4.0
2019-03-28T14:50:48.093Z
I think I got confused between "input data" and transaction "inputs". Now I get that `combinepsbt` combines only transactions that have the same inputs and outputs but different "input data".
Gabriele Domenichini
<bitcoin-core><bip174-psbt>
What is the exact difference between combinepsbt and joinpsbts
Gabriele Domenichini
# What is the exact difference between combinepsbt and joinpsbts

(Asked by: username_0 on 2019-03-26)

They seem to do pretty much the same thing.
The only apparent difference being that combinepsbt seems more for updating the same psbt with imcremental signatures while joinpsbts seems more for joining *different* transactions but given in combinepsbt you can also add different inputs and outputs I don't see the difference.

**Tags:** bitcoin-core, bip174-psbt

> **Comments:**
> **username_1**: What makes you think that `combinepsbt` can add inputs and outputs? It is not supposed to, and if it does, that is a bug and should be fixed.  
> **username_0**: I think I got confused between "input data" and transaction "inputs". Now I get that `combinepsbt` combines only transactions that have the same inputs and outputs but different "input data".  

---

## 1 answers

### Answer by username_1 on 2019-03-26. Score: 4 | Accepted answer

`combinepsbt` takes multiple PSBTs that have different input data and merges them. The base transaction must be exactly the same, i.e. the same inputs are consumed and the same outputs are created. The information for each input is combined into the same input. Inputs and outputs cannot be added or removed. This allows for people to send the same PSBT to be signed by multiple different people and then merge the resulting the PSBTs back together.

For example, suppose you have a PSBT that consumes 2 inputs, with input 1 requiring person A to sign and input 2 requiring person B to sign. You give both person A and person B copies of that PSBT to sign. Person A returns you a PSBT which has input 1 signed (i.e. they fill in input information like UTXO, partial signatures, final scriptSig, etc.) but input 2 is not. Person B returns you a PSBT which does not have input 1 signed but input 2 is signed. `combinepsbt` allows you to merge the PSBTs from both person A and person B into a single one which has both inputs signed.

`joinpsbts` is very different from this. `joinpsbts` joins multiple PSBTs that have different underlying transactions into one transaction. It requires that the inputs of those underlying transactions be different from each other. Furthermore, `joinpsbts` will discard any signatures and finalized input fields from the original PSBTs (meaning the resulting PSBT will contain no signatures) as those signatures will likely be invalidated when joining.

`joinpsbts` lets you make transactions which has other people involved in them (such as CoinJoins) more easily. Each person can specify the inputs and outputs they want in a PSBT and then all of these PSBTs with different inputs and outputs are merged together using `joinpsbts`.

> **Comments:**
> **username_0**: So A performs a walletcreatefundedpsbt. B perform a walletcreatefundedpsbt as well. B sends his transaction to A. A perform a joinpsbts with the two transactions. A perform walletprocesspsbt signing the unsigned transaction. B perform walletprocesspsbt signing the unsigned transaction as well. A or B perform a  combinepsbt of the two transactions, a finalizepsbt and broadcast? Thank you for your huge work and for answering.  
> **username_1**: Yes, that is a possible workflow.  

---

