I am trying to learn the workflow for manual Coinjoins using PSBTs. I was following Andrew Chow's suggestions in a thread on Bitcoin Stack Exchnage here
https://bitcoin.stackexchange.com/questions/57253/how-do-i-spend-bitcoins-from-multiple-wallets-in-a-single-transaction/89169#89169 Where he outlines this flow;
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 having an issue between Numbers 5 and 6 above. I can combine the signed PSBTs, but cannot get them to finalize.
- 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]:
https://bitcoin.stackexchange.com/questions/57253/how-do-i-spend-bitcoins-from-multiple-wallets-in-a-single-transaction/89169#89169