<p>I am very embarrassed, just circling back to share, the above workflow works perfectly. My problem was I had an incorrect vout value in one of my inputs. Basically I was trying to spend money I don't have (/facepalm). As soon as I corrected that, everything worked flawlessly.</p>

<p>Here's my multi-wallet.dat file Coinjoin :)
<a href="https://live.blockcypher.com/btc-testnet/tx/537d4f9c49e06916c8f74ad53e52c3389f1654f4dec1014e2335c7ad49e268ab/" rel="nofollow noreferrer">https://live.blockcypher.com/btc-testnet/tx/537d4f9c49e06916c8f74ad53e52c3389f1654f4dec1014e2335c7ad49e268ab/</a></p>

CC BY-SA 4.0
2020-02-06T00:38:18.777Z
2020-02-06T00:38:18.777Z
FractalEncrypt
<p>I am trying to learn the workflow for manual Coinjoins using PSBTs. I was following Andy Chow's suggestions in another thread <a href="https://bitcoin.stackexchange.com/questions/57253/how-do-i-spend-bitcoins-from-multiple-wallets-in-a-single-transaction/89169#89169">here</a> Where he suggests:</p>

<pre><code>1. Createpsbt (he suggests using walletcreatefundedpsbt)
2. Have individual users send their PSBTs to coordinator
3. Coordinator uses joinpsbts to join the separate PSBTs into one
4. Coordinator sends joined PSBT back to users to sign with walletprocesspsbt
5. Once all users have signed/processed the joined PSBT, coordinator uses combinepsbt.
6. Coordinator uses finalizepsbt and then transmits to the network using sendrawtransaction.
</code></pre>

<ul>
<li>I am on testnet using Bitcoin Core version v0.19.0.1 (64-bit) </li>
<li>I'm using the console in QT </li>
<li>I am using multiple wallet.dat files to simulate different CoinJoin participants.  </li>
<li>I've created 2 PSBTs from two separate wallet.dat files, and am able to join them together using joinpsbts</li>
</ul>

<p>Once I have my joined PSBTs, I was able to sign my PSBT in each wallet, and then combine them into one PSBT using combinepsbt. </p>

<p>When I try to finalizepsbt, I get a return of  "complete": false
I am able to decode the PSBT and view all the correct inputs/outputs, but I must be missing a step to finalize the transaction after combining.</p>

<p><strong>I believe I need to get finalizepsbt to return a value of true.</strong></p>

<p>As a sidenote, if I use a single wallet.dat file, I can create multiple PSBTs, join, process, finalize, and send exactly as Andy describes. However when I try to do this in a  more-real-world-situation than "just one user combining his own PSBTs" and then try to combine the PSBTs from different wallet.dat files, then I run into problems (to me, each wallet.dat file = one separate user/Coinjoin participant).</p>

<raw-transaction><bip174-psbt><coinjoin>
How to properly combine PSBTs for CoinJoin?
FractalEncrypt
# How to properly combine PSBTs for CoinJoin?

(Asked by: username_0 on 2020-02-05)

I am trying to learn the workflow for manual Coinjoins using PSBTs. I was following Andy Chow's suggestions in another thread [here](https://bitcoin.stackexchange.com/questions/57253/how-do-i-spend-bitcoins-from-multiple-wallets-in-a-single-transaction/89169#89169) Where he suggests:

```
1. Createpsbt (he suggests using walletcreatefundedpsbt)
2. Have individual users send their PSBTs to coordinator
3. Coordinator uses joinpsbts to join the separate PSBTs into one
4. Coordinator sends joined PSBT back to users to sign with walletprocesspsbt
5. Once all users have signed/processed the joined PSBT, coordinator uses combinepsbt.
6. Coordinator uses finalizepsbt and then transmits to the network using sendrawtransaction.

```

* I am on testnet using Bitcoin Core version v0.19.0.1 (64-bit)
* I'm using the console in QT
* I am using multiple wallet.dat files to simulate different CoinJoin participants.
* I've created 2 PSBTs from two separate wallet.dat files, and am able to join them together using joinpsbts

Once I have my joined PSBTs, I was able to sign my PSBT in each wallet, and then combine them into one PSBT using combinepsbt.

When I try to finalizepsbt, I get a return of "complete": false
I am able to decode the PSBT and view all the correct inputs/outputs, but I must be missing a step to finalize the transaction after combining.

**I believe I need to get finalizepsbt to return a value of true.**

As a sidenote, if I use a single wallet.dat file, I can create multiple PSBTs, join, process, finalize, and send exactly as Andy describes. However when I try to do this in a more-real-world-situation than "just one user combining his own PSBTs" and then try to combine the PSBTs from different wallet.dat files, then I run into problems (to me, each wallet.dat file = one separate user/Coinjoin participant).

**Tags:** raw-transaction, bip174-psbt, coinjoin


---

## 1 answers

### Answer by username_0 on 2020-02-06. Score: 1

I am very embarrassed, just circling back to share, the above workflow works perfectly. My problem was I had an incorrect vout value in one of my inputs. Basically I was trying to spend money I don't have (/facepalm). As soon as I corrected that, everything worked flawlessly.

Here's my multi-wallet.dat file Coinjoin :)
<https://live.blockcypher.com/btc-testnet/tx/537d4f9c49e06916c8f74ad53e52c3389f1654f4dec1014e2335c7ad49e268ab/>


---

