Author: alicexbt 2022-08-20 08:20:00
Published on: 2022-08-20T08:20:00+00:00
The author has developed a Python script that implements an experimental CoinJoin protocol called Joinstr. The script uses the nostr library to coordinate between peers and the Bitcoin Core wallet and RPCs. The python-nostr library is required for the decentralized network based on cryptographic keypairs. The implementation involves five peers who create, sign, and broadcast a coinjoin transaction.To use the script, clients need to run the `python coinjoin.py` command and enter a descriptor for one of the inputs. The script will then check inputs every 30 seconds and register a new address for output once five inputs are registered. Similar checks happen every 30 seconds for outputs.The last peer creates a partially signed bitcoin transaction (PSBT), which is printed as an unsigned PSBT and signed by the wallet using the `walletprocesspsbt` RPC. Once five signed PSBTs are received, the last peer finalizes the coinjoin transaction, which is then broadcasted and its txid printed.Clients can use multiple relays simultaneously to avoid trusting one relay. If a relay attempts to cheat, users will not sign the transaction and avoid using it in the future. The author plans to create an Android app for Joinstr in the upcoming week and has credited fiatjaf (Nostr), Andrew Chow (PSBT), Jeff Thibault (python-nostr), and existing coinjoin implementations for their contributions.The update includes four event IDs, one for registered output, one for unsigned PSBT, one for signed PSBT, and another for Coinjoin tx.
Updated on: 2023-05-22T21:02:46.648576+00:00