Bitcoin Forum
May 03, 2024, 09:13:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Proper workflow to CoinJoin combined PSBTs?  (Read 97 times)
FractalEncrypt (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 11


View Profile
February 05, 2020, 06:14:20 PM
 #1

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
1714770787
Hero Member
*
Offline Offline

Posts: 1714770787

View Profile Personal Message (Offline)

Ignore
1714770787
Reply with quote  #2

1714770787
Report to moderator
1714770787
Hero Member
*
Offline Offline

Posts: 1714770787

View Profile Personal Message (Offline)

Ignore
1714770787
Reply with quote  #2

1714770787
Report to moderator
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
FractalEncrypt (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 11


View Profile
February 06, 2020, 12:41:15 AM
 #2

I am very embarrassed, just circling back to share the solution for the community (I'm an idiot).

The above workflow works perfectly. My problem was that 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 Smiley https://live.blockcypher.com/btc-testnet/tx/537d4f9c49e06916c8f74ad53e52c3389f1654f4dec1014e2335c7ad49e268ab/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!