I am developing a feature in my app for "manual coinjoins" which follows this as inspiration: https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#Manual_CoinJoin_Workflow

I am not an experienced coinjoin user and just want to make sure I am not missing something here.

The flow I am using is:

User A creates a PSBT with one utxo input of 0.1 btc and one output of 0.0995 btc sending the output to a new address of theirs. User A processes the PSBT to sign for the input.

User A passes the PSBT on to user B who creates another PSBT with identical input amount and identical output amount and processes the PSBT to sign the input.

User B can pass it on to others who repeat the process or finalize and broadcast.

Is this the proper way to do it? Does the order in which the users process the PSBT with their wallet matter?


No, that won't work. joinpsbts must be used before any signatures are created. Otherwise existing signatures will not be valid for the joined transaction. Rather, each person must create their own PSBT, send them to each other or to some coordinator where the PSBTs are then joined together with joinpsbts. Then the joined PSBT can be distributed back to everyone, who processes and signs it. Once signed, each person must, again, send the signed PSBT to everyone else or to the coordinator where all the PSBTs are combined with combinepsbt. Then the combined PSBT can be finalized and broadcast.

Note that currently joinpsbts has a major privacy leak as the inputs and outputs are added to the joined PSBT in the order that the transactions were specified. There is an open Pull Request that fixes this issue.

  • This is going to be an amazing feature, any ideas when that PR may get merged?
    – Fontaine
    Aug 2 '19 at 3:34

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.