2

I am trying to learn the workflow for manual Coinjoins using PSBTs. I was following Andy Chow's suggestions in another thread here 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).

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/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.