topic 02 · the BCH implementation · survey + our research
CashFusion
CoinJoin on Bitcoin Cash — a measured adoption history, and our coordinator-free variant.
CashFusion is Bitcoin Cash's CoinJoin-style mixing tool. Its distinguishing fact is measured adoption: a widely-cited 2022 forum analysis reports that 94% of all BCH transacted since July 2020 descends from a CashFusion transaction. This page covers the classic protocol and the coordinator-free variant we built and measured over Nostr.
on this page
Eleven sections, one record.
01 · the protocol
What CashFusion is
CashFusion is Bitcoin Cash's CoinJoin-style mixing tool. A round takes inputs from multiple participants and returns outputs to the same participants, breaking the direct input→output link that chain analysis relies on. The classic implementation uses an external coordinator server and Tor covert channels; the coordinator is blinded to the input→output mapping but sees the round [cited · P2P-FUSION-DESIGN.md §1].
It is not a shielded pool. Amounts and the transaction graph remain public; what changes is the link between your inputs and your outputs. Amount privacy is the shielded pool's job — see /research/shielded-pool[cited · P2P-FUSION-DESIGN.md §1 non-goals].
The implementation is live on BCH, with a measured adoption history and an active red-team discussion. The next section covers that record.
02 · the record
The adoption record
The 94% figure is the reason this protocol matters: a larger set is what makes a mix meaningful. We cite the analysis; we do not own it.
[cited · third-party analysis] — the 94% adoption figure comes from a 2022 Bitcoin Cash Research analysis, linked below. The work is also under active scrutiny: a standing red-team discussion on the research forum, ongoing UX/tech improvement threads, and a public fusion-statistics dashboard.
We survey and link this work — it belongs to its authors. Our contribution is the coordinator-free fusion research on this page, and the shielded-pool layer above it.
the 94% analysis
"94 percent of all BCH transacted since July 2020 is now a descendant of a CashFusion transaction" — the adoption record, third-party.
red-team discussion
"Is there interest in a Red Team analysis of CashFusion?" — the thread where the scheme gets attacked instead of praised.
fusion statistics
Live fusion-statistics dashboard (fusionstats.redteam.cash) and its open-source app (Rucknium/CashFusionStats on GitHub).
UX / tech improvement thread
"Ways to improve UX / tech of CashFusion" — the standing community thread on where the implementation should go next.
P2P fusion over Nostr
Serverless CoinJoin coordinated over Nostr with onion-wrapped outputs (the 00-Protocol experiment, announced in topic 1773) — a different coordination model, cited for completeness. [third-party · pre-mainnet · no LICENSE file]
the gate evidence
G1 through G4, with chain links and dry-run labels — jump straight to the measured record on this page.
jump to the gates →03 · the premise
Remove the coordinator
A classic CashFusion client already ships with the project, but it depends on an external coordinator server. This research removes the server: peers self-elect a coordinator per round, and every message is end-to-end gift-wrapped before it reaches a relay.
| dimension | classic CashFusion (in app) | P2P over Nostr (this research) |
|---|---|---|
| coordinator | external server, trusted for round integrity | none — peers self-elect per round |
| transport | Tor covert channels to the server | Nostr relays, end-to-end gift-wrapped messages |
| output blinding | server-side blindness | onion mix-net through all peers |
| backend | none | none — matches the app's no-backend identity |
[measured · P2P-FUSION-DESIGN.md §1, file inspected 2026-11-20]
The design is a clean-room specification informed by the public 00-Protocol description. Both upstream repositories have no LICENSE file (all rights reserved), so we read and cite them — we do not copy code.
Non-goals v1: replacing the existing CashFusion client; hiding amounts (that is the shielded pool's job); stealth outputs (upstream disabled theirs — if (false && keys.stealthSpendPub)[cited · P2P-FUSION-DESIGN.md §1]).
04 · the shape
Everything is peer-side
The browser runs the round. Relays carry ciphertext and timing metadata; chain access reuses the existing Electrum proxy. No new server code.
┌─────────────────────────── browser ─────────────────────────────────────┐
│ │
│ fusion UI (not built) │
│ │ │
│ ▼ │
│ stores/p2pfusion/round.ts ── six-phase state machine │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ relay.ts txbuild.ts giftwrap.ts │
│ Nostr WS BCH tx + NIP-59 seal/rumor │
│ pool BCH Schnorr + NIP-44 layer crypto │
│ │ │ │
│ ▼ ▼ │
│ Nostr relays (untrusted) web/server/api/electrum.post.ts │
│ ciphertext + timing (existing JSON-RPC proxy) │
└────────┼──────────────────────────────────┼─────────────────────────────┘
▼ ▼
public relays Electrum / Fulcrum
(chain data + broadcast)round.ts
Six-phase state machine, election, blame/timeout, onion collection and signature assembly. 522 lines.
relay.ts
Nostr WebSocket pool: connect, rotate, dedupe, resubscribe, per-connection outbox, 80 ms publish pacing. 200 lines.
giftwrap.ts + nip44.ts
NIP-59 seal (kind 13) inside a kind-1059 gift wrap, with NIP-44 v2 layer encryption and ephemeral identities. 119 + 136 lines.
txbuild.ts
Transaction serialization, BIP143 sighash, P2PKH signing and BCH Schnorr sign/verify. 246 lines.
onion.ts
Layered output wrapping and peeling for the mix-net, with order rejection at the receiver. 72 lines.
cashaddr.ts + identity.ts
Token-aware CashAddr decoding and per-round ephemeral secp256k1 identities. 102 + 86 lines.
[measured · wc -l web/stores/p2pfusion/*.ts, 2026-11-20]
05 · the protocol
Six phases, one round
The design follows the upstream six-phase structure. The harness maps it to the wire as inputs → onion → outputs → tx → sign → broadcast.
Announce
A peer publishes an ephemeral pubkey to a pool event (kind 22230 in the design). The harness currently starts from an explicit peer list — live pool discovery is not built yet.
Election
Peers sort ephemeral pubkeys; the lowest becomes the round coordinator. There is no server — the coordinator is just the first peer in a deterministic order.
Registration
Each peer sends its inputs {txid, vout, value} and output count as a NIP-59 gift wrap. The coordinator collects them for the round.
Mixnet
Each peer onion-wraps its outputs through every peer in sorted order. Each hop peels one layer and shuffles; the last peer publishes the plaintext output set.
Assembly + verify
The coordinator orders inputs and outputs. Every peer checks its outputs are present, no inflation (sumOut ≤ sumIn), and fee ≤ estBytes × 5 sat/B before signing only its own inputs.
Broadcast
The coordinator assembles the fully signed transaction and broadcasts it. Any peer may also broadcast as a redundant relay — a proposed delta over the upstream design.
[measured · P2P-FUSION-DESIGN.md §4 + web/stores/p2pfusion/round.ts]
| constant | value | rationale |
|---|---|---|
| MIN_PARTICIPANTS | 5 | a 2-party round has near-zero mapping entropy; 5 is our floor |
| inputs per peer | 1–5, ≥546 sats, random | parity with upstream |
| outputs per peer | 2–4, random split, no change output | no-change kills the biggest re-link |
| fee model | per-peer nIn·148 + nOut·34 + ceil(10/peers) | parity with upstream |
| phase timeout | 60 s + blame | parity with upstream |
| token UTXOs | excluded from inputs v1 | plain P2PKH only in v1 |
| broadcast path | /api/electrum proxy + psf broadcast fallback | both paths already exist and are verified |
[proposed · P2P-FUSION-DESIGN.md §4 constants; upstream parity marked in the design doc]
P1 P2 P3(coordinator) relays/chain
│ announce │ │ │
│─────────┼───────────────►│ │ kind 22230
│ │ announce │ │
│ │───────────────►│ │
│ [lowest ephemeral pub = coordinator] │
│◄────────┼────────────────┤ round_start │ gift-wrap
│ inputs │ inputs │ │
│─────────┼───────────────►│ │ gift-wrap
│ onion(myOut) ── peel ── peel ── publish │ onion net
│◄────────┼─────── outputs set ───────────│
│ verify+sign own inputs │
│─────────┼───── signatures ──────────────│
│ broadcast assembled tx ─────────►│ chain[design · P2P-FUSION-DESIGN.md §4 sequence diagram]
06 · the evidence
Measured gate by gate
Every number below comes from a reproducible harness in web/tests/. Only G2b touched the chain; the other gate transactions are dry-runs and are labelled as such.
Relay + crypto roundtrip
- 4/4 checks: NIP-44 v2 roundtrip + tamper reject; NIP-59 wrap/unwrap + outsider reject; 3-hop onion wrap/peel + order reject; live relay gift-wrap roundtrip.
- Live relays: wss://relay.damus.io and wss://nos.lol (1/2 connected); delivery confirmed. The subscription window must cover NIP-59's 2-day created_at backdating.
Two-party round, dry-run
- 3/3 deterministic runs; 4 inputs / 4 outputs; 4/4 BIP143 + BCH-Schnorr signatures independently verified; fee 3,000 sats; estimated size 738 B.
- Transport: in-process NIP-01 relay fixture — deterministic by design. Live relays are covered by G1 and G3L.
Real chipnet broadcast
- Funding tx 253 B accepted; round tx 2 inputs / 4 outputs, 428 B, fee 2,000 sats ≈ 4.7 sat/B — accepted by the network and visible via Electrum.
- This is the only gate in the set with real chain transactions; G3 and G3L are dry-runs with fixture UTXOs.
N-party round (5 default, 7 tested)
- 5-party: 10 inputs / 10 outputs, 1,760 B, fee 5,000 sats, 10/10 signatures independently verified.
- 7-party: 14/14 signatures verified; the 2-party regression re-passed. Transport: local relay fixture.
harness txid · dry-run (not broadcast)
c23b441c65f0ff8e15198891944454284d63fd1e339a30326d30390012a0d19f
a91b695a…edd81 (7-party, truncated in the design record)
Same round over live public relays
- 5-party full round over wss://relay.primal.net, wss://nostr.mom and wss://offchain.pub: 10/10 signatures verified.
- A repeat run also passed. The round is still a dry-run — live relays, fixture UTXOs, no broadcast.
harness txid · dry-run (not broadcast)
13bc75cecaf0c6f845f8a6e6074c8b6f43909670c85f304b9f413d5989f70f0d
20d0c9b90571dd2ae11cd3a8d4de3219d02398c18aa42cc8a61f6bd52d8b9b6d
Mainnet opt-in beta
- Criterion: mainnet opt-in beta behind a settings flag.
- Not built: no production fusion UI exists. The protocol modules and gate harnesses are in-repo; the production UI is the remaining step.
[measured · P2P-FUSION-DESIGN.md §5, runs 2026-11-20; chain links → Selene, network=chipnet]
07 · the lessons
What the gates taught us
The expensive findings are the point of publishing the research. These are the defects the harness found — and the fixes that made the round pass.
BCH Schnorr is not final BIP-340
The first real broadcast was rejected with NULLFAIL. The sighash and serializer matched libauth byte-for-byte; the signature was the problem. BCH's 2019 Schnorr is the BIP-340 draft, not the final BIP-340:
e = SHA256(r ‖ compressed_pubkey33 ‖ m) // no BIP-0340 tag prefixes
R must be normalized to the QR Y root // Jacobi symbol 1, not even-YNoble's schnorr produces final BIP-340 signatures, which the BCH VM rejects. txbuild.ts now implements bchSchnorrSign / bchSchnorrVerify per the 2019 spec; the signed tx passes libauth's BCH VM (error: none, stack: ['01']) and the network accepts it.
[measured · P2P-FUSION-DESIGN.md §5c; spec: bitcoincashorg/bitcoincash.org/2019-05-15-schnorr.md]
BCH Schnorr is not final BIP-340
BCH's 2019 Schnorr is the BIP-340 draft: the challenge is e = SHA256(r ‖ compressed_pubkey33 ‖ m) with no BIP-0340 tag prefixes, and R must be normalized to the quadratic-residue Y root (Jacobi symbol 1), not the even-Y root. Noble's schnorr produces final BIP-340 signatures — the BCH VM rejected them with NULLFAIL.
y-parity is per input
The P2PKH scriptCode must be derived from each input's own private key. Forcing an 02 prefix onto an x-only pubkey produced a second rejection — OP_EQUALVERIFY. The fix is per-input key material, not a shared x-only key.
Public relays do not echo
A relay does not send an event back to the connection that published it. With one shared socket for all peers, peers never receive each other's messages on real relays. The fix is one connection per peer — also the honest wallet model.
Free relays throttle bursts
Observed verbatim: damus “banned: too many rate-limit violations, try again later”; nos.lol “rate-limited: slow down matey”. A 5-party round emits ~100+ gift wraps, so publishing is paced at one event per 80 ms per connection.
Origin retries + dedupe
Only forwarded onion layers were re-sent at first, so a dropped first hop stalled the round. All outbound layers are now re-sent while the onion phase is active, with hash-based dedupe at the receiver.
NIP-42 AUTH is not implemented
damus now advertises NIP-42 AUTH. The NIP-59 spec recommends supporting it; the current relay pool does not authenticate. This is tracked as an open item, not a solved one.
[measured · P2P-FUSION-DESIGN.md §5b–§5e, defect logs from the 2026-11-20 runs]
defect log · what broke before it passed
G2a — the dry-run
- The first peeler never peeled its own onions; a unified processOnionLayer() fixed it.
- The coordinator dropped outputs while still in the onion phase; it now accepts the set from the last peeler.
- A participant dropped tx in the outputs phase; the phase gate now allows it.
- Self was counted twice in expectedOnions; the round waited forever for onions that do not exist.
- publish() silently dropped events before the socket opened; a per-relay outbox flushes on connect.
- Messages arriving before their phase were lost; a per-phase pending queue flushes on phase entry.
- The relay fixture overwrote subscriptions per connection; NIP-01 semantics now allow many subs keyed by subId.
- Schnorr self-verify passed a 33-byte key; BIP-340 wants x-only (32).
- NIP-44 padding must allocate prefix + calc_padded_len(L) bytes; powers-of-two plaintexts overflowed by the 2-byte prefix.
G2b / G3 / G3L — the chain and the relays
- G2b: BCH Schnorr ≠ final BIP-340 — NULLFAIL on the first broadcast.
- G2b: P2PKH scriptCode must use each input's own private key — a forced 02 prefix produced OP_EQUALVERIFY.
- G3: intermediate peelers never left the onion phase; the outputs message now advances every peer.
- G3L: relays do not echo to the publishing connection; one connection per peer is the fix.
- G3L: free relays rate-limit bursts; publishing is paced at one event per 80 ms per connection.
- G3L: relay selection matters — primal, nostr.mom and offchain.pub delivered; nostr.band and nostr.bg did not connect.
- G3L: origin-side onion retries were missing; all outbound layers are re-sent while the onion phase is active, with hash dedupe at the receiver.
[measured · P2P-FUSION-DESIGN.md §5b–§5e]
08 · the boundary
What holds, what does not
What holds
- A malicious coordinator cannot steal: it never holds signatures for inputs it does not own, and every peer verifies its outputs and the fee before signing.
- A malicious last peeler learns the plaintext output set — which is public in the transaction anyway; it cannot map outputs to owners.
- The round is peer-side: no new server code, and relays see NIP-59 gift wraps rather than plaintext round messages.
- Chain access reuses the existing Electrum proxy cluster; the wallet keeps its own keys.
- Relay rotation and multiple simultaneous rounds are the design response to relay-level DoS and eclipse attempts.
What does not (yet)
- The 5-participant floor is a design constant, not enforced in round.ts; the harness tested 5 and 7.
- Token UTXOs are excluded in v1 — plain P2PKH only.
- Amounts remain public on chain. Amount privacy is the shielded pool's job, not this layer's.
- Stealth outputs are disabled upstream (if (false && keys.stealthSpendPub)) — not part of this round.
- NIP-42 AUTH is not implemented; damus advertises it. Live pool discovery (kind 22230) is design-only.
[measured · P2P-FUSION-DESIGN.md §1, §4 security analysis, §6; round.ts inspected 2026-11-20]
09 · what is next
Open questions
[open · P2P-FUSION-DESIGN.md §6 + the G4 gap recorded in §5]
10 · questions
Research FAQ
Short answers to the questions this research raises most often. Every answer is grounded in the sections above.
Is CashFusion the same as CoinJoin?
CashFusion is a CoinJoin-style protocol built for Bitcoin Cash. Participants contribute inputs and receive outputs, which breaks the direct input→output link. The classic implementation uses an external coordinator server and Tor covert channels; it is not a shielded pool.
Does the P2P round over Nostr hide amounts?
No. Amounts and the transaction graph remain public on chain. The round hides the mapping between inputs and outputs; amount privacy is the shielded pool's job, not this layer's.
Is the Nostr round live on mainnet?
No. G2b is a real round on chipnet (funding tx and round tx are linked above). G3 and G3L are dry-runs with fixture UTXOs. G4 — a mainnet opt-in beta behind a settings flag — is pending, and no production fusion UI exists yet.
What is the difference between classic CashFusion and P2P over Nostr?
Classic CashFusion trusts an external coordinator for round integrity and uses Tor covert channels. The P2P design removes the server: peers self-elect a coordinator per round, messages are NIP-59 gift-wrapped over Nostr relays, and outputs travel through an onion mix-net. Both have no backend in the app.
Why five participants?
Five is our design floor. A two-party round has near-zero mapping entropy; five gives a larger per-round anonymity set. The constant is proposed in P2P-FUSION-DESIGN.md §4 and is not enforced in round.ts — the harness tested 5 and 7.
Why did the first real broadcast fail?
BCH's 2019 Schnorr is the BIP-340 draft, not final BIP-340. The challenge uses a compressed 33-byte pubkey and no BIP-0340 tag prefixes, and R must be normalized to the quadratic-residue Y root. Noble's schnorr produces final BIP-340 signatures, which the BCH VM rejected with NULLFAIL. txbuild.ts now implements the 2019 variant.
Is the code open source?
The Hush Your Money repository is public. The 00-Protocol upstream repositories we studied have no LICENSE file — legally all rights reserved — so this design is a clean-room specification: we read and cite them, we do not copy code.
[answers · grounded in P2P-FUSION-DESIGN.md §1–§6 and the 2026-11-20 gate record]
11 · sources
Read the record
P2P-FUSION-DESIGN.md
The architecture draft, protocol, constants, gate record and defect logs — the canonical source for every number on this page.
web/tests/
The G1, G2a, G2b and G3 harnesses, plus the NIP-01 relay fixture and the chipnet Electrum client.
BCH Schnorr spec (2019)
The draft-BIP-340 variant BCH actually enforces: compressed-pubkey challenge, QR-normalized R, no tag prefixes.
NIP-59 + NIP-44
Gift wrap (kind 1059) and versioned encrypted payloads — the transport this round is built on.
00-Protocol/00-Wallet
Upstream studied read-only for protocol parity. No LICENSE file — all rights reserved; cited, not copied.
research forum · topic 1773
The announcement and review thread where the 00-Protocol work was presented — the third-party context for this research.