NOTE: correction on the above
Joinstr operates by creating a post-mix transaction with an event ID. Here's a simplified overview of how it works:
  • Calculate the postmix_val using the formula: (input_sum - fee) / 5.
  • Generate an event ID for the CoinJoin round.
  • Participants provide their UTXOs as inputs, specifying the amount and type.
  • The CoinJoin transaction is created using these inputs and the event ID.
  • The resulting transaction is broadcast to the blockchain.
This looks incorrect, and can be replaced with:
JoinStr operates by creating a CoinJoin transaction with the coordination of the Nostr protocol, following these steps:
  • Register Output: Participants register their desired output using the Nostr protocol.
  • Create PSBT with User's Input: JoinStr collects all registered outputs and creates a Partially Signed Bitcoin Transaction (PSBT) with the user's input. This PSBT is signed with the Sighash All | AnyoneCanPay flag.
  • Combine PSBTs: JoinStr combines the signed PSBTs from all participants in the CoinJoin round.
  • Broadcast CoinJoin Transaction: Once a sufficient number of signed PSBTs are received (typically from five participants), JoinStr finalizes the CoinJoin transaction by combining the PSBTs. This combined transaction is then broadcast to the Bitcoin blockchain.