Overview
CoinJoin is a privacy technique first described by Bitcoin developer Gregory Maxwell in 2013. It works by combining multiple users' transactions into a single transaction with many inputs and many equal-valued outputs, breaking the link between sender and recipient. Unlike centralized mixing services, CoinJoin is trustless: participants never give up custody of their funds.
How CoinJoin Works
Without CoinJoin (links are obvious):
Alice: 0.5 BTC ──→ 0.5 BTC to Bob
With CoinJoin (links are ambiguous):
Inputs: Outputs:
├── Alice: 0.1 BTC ├── 0.1 BTC → ? (Alice, Bob, or Carol?)
├── Bob: 0.1 BTC ├── 0.1 BTC → ? (Alice, Bob, or Carol?)
└── Carol: 0.1 BTC └── 0.1 BTC → ? (Alice, Bob, or Carol?)
An observer sees 3 inputs and 3 equal outputs but cannot
determine which input funded which output.
Key Properties
- Trustless: No coordinator ever holds users' private keys or funds
- Equal denomination: Outputs are the same amount to maximize the anonymity set
- Collaborative: Multiple users must participate simultaneously
- On-chain: CoinJoin transactions are normal Bitcoin transactions that are indistinguishable from multi-party payments
Implementations
- Wasabi Wallet: Automated CoinJoin with a centralized coordinator (for coordination, not custody)
- JoinMarket: Decentralized marketplace where makers offer liquidity for CoinJoin and takers pay a small fee
- PayJoin/P2EP: A two-party CoinJoin that looks like a normal transaction, enhancing privacy without the distinct fingerprint of traditional CoinJoins
Limitations and Misconceptions
CoinJoin does not make transactions invisible on the blockchain. A sophisticated observer can still identify CoinJoin transactions by their characteristic pattern of equal-valued outputs. However, while they can identify that a CoinJoin occurred, they cannot determine the mapping between inputs and outputs. The privacy benefit comes from this ambiguity, which grows with the number of participants (the "anonymity set").
Post-mix behavior is also critical. If a user combines CoinJoined outputs with non-CoinJoined outputs in a subsequent transaction, they can undo some of the privacy gained.