A Cryptographer’s Deep Dive into Stellar’s Privacy Pools
As someone who spent four years at Zcash Foundation and StarkWare before pivoting to ZK infrastructure research, I have to say: what Stellar just shipped with their open-source private payments prototype is one of the most thoughtfully designed privacy architectures I have seen in production-grade blockchain. Let me break down exactly why this matters, what is happening under the hood, and where the hard questions remain.
The Core Architecture: Groth16 on BN254 via Soroban
Stellar’s Protocol 25 (“X-Ray”) upgrade introduced BN254 elliptic curve host functions directly into Soroban smart contracts. This is the foundational primitive that makes everything else possible. The private payments implementation uses Groth16 zk-SNARKs built with Circom circuits, which is a well-understood and battle-tested proving system.
The architecture follows a commitment-based UTXO model:
- Deposit: A user generates a secret
sand nullifiern, computes a commitmentc = H(H(s,n), label)using Poseidon hashing, and deposits tokens into the pool contract. The commitment becomes a leaf in a Merkle tree. - Transfer: The user spends existing commitments (inputs) and creates new ones (outputs) under different ownership keys, all while proving in zero knowledge that balance conservation holds: inputs = outputs + public_amount.
- Withdrawal: The user proves knowledge of
(s, n)without revealing them, produces a nullifier hashH(n)to prevent double-spending, and withdraws tokens.
The current proof-of-concept uses a single circuit with 2 inputs and 2 outputs. Proof generation happens entirely client-side via WebAssembly, meaning users generate their Groth16 proofs locally in a browser. No trusted server ever sees your secrets. This is a significant design choice – it shifts the trust boundary entirely to the user’s device.
What Makes This Different From Tornado Cash
Here is where it gets interesting, and where Stellar’s approach diverges from the Tornado Cash model that regulators sanctioned in 2022.
Tornado Cash was a pure mixer: deposit ETH, wait, withdraw from a different address. There was no mechanism for selective disclosure, no compliance hooks, no way to prove you were not receiving funds from a sanctioned entity. That architectural choice is what made it a regulatory target.
Stellar’s implementation introduces Association Set Providers (ASPs) – a compliance layer that operates within the zero-knowledge framework itself. Here is how it works:
- ASPs maintain two Merkle trees: a membership tree of approved public keys, and a sparse Merkle tree for exclusion proofs (non-membership).
- When withdrawing, a user must prove in zero knowledge that their deposit either belongs to an approved set or does not belong to a blocked set, depending on the ASP’s compliance standard.
- The
updateAssociationcommand manages these participant lists, building the Merkle structures that the ZK circuits can reference during proof generation.
Think of ASPs as compliance gatekeepers that operate cryptographically rather than through centralized database lookups. They can enforce KYC requirements, sanctions screening, or jurisdiction-specific rules without ever seeing the actual transaction amounts or counterparty addresses.
View Keys: Selective Disclosure Done Right
The system also implements view keys – a mechanism borrowed conceptually from Zcash’s viewing key model but adapted for Stellar’s compliance context.
A view key allows a user to selectively reveal transaction details to a specific auditor, regulator, or counterparty. The key insight is that this disclosure is:
- Granular: You can reveal specific transactions, not your entire history.
- Targeted: Only the holder of the view key can see the details.
- Voluntary but enforceable: Compliance frameworks can require view key disclosure as a condition for pool participation.
This is the compliance hook that separates Stellar’s approach from pure anonymity protocols. A regulated financial institution could use this system for confidential payroll, private remittances, or institutional transfers while maintaining the ability to satisfy audit requirements.
The Hard Technical Questions
Let me put on my skeptic hat for a moment, because no privacy system is without trade-offs:
1. Trusted Setup: Groth16 requires a Common Reference String (CRS) generated through a trusted setup ceremony. The current implementation does not yet have a decentralized ceremony. This is a known limitation – if the setup is compromised, proofs can be forged. The Zcash Powers of Tau ceremony showed how to do this properly, but it is non-trivial.
2. Anonymity Set Size: Your privacy is only as strong as the number of deposits in the pool before your withdrawal. Early-stage adoption means small anonymity sets, which means weaker privacy guarantees. This is a bootstrapping problem that every mixer faces.
3. Resource Constraints: On-chain Groth16 verification on Soroban consumes approximately 40 million instructions – about 40% of the testnet maximum budget. This leaves limited headroom for complex transactions or composability with other contracts.
4. Frontrunning Vulnerability: The current circuit does not include recipient addresses in the ZK proof, which means a relay party could theoretically redirect withdrawals. This is acknowledged as future work, but it is a real attack vector.
5. Event Retention: Stellar has a 7-day event retention window, which means a dedicated indexer is needed for the pool to function over longer periods. This introduces infrastructure dependencies.
The Bigger Question
What I find genuinely compelling about this design is that it attempts to resolve the fundamental tension in blockchain privacy: how do you hide transaction details from the public while maintaining the ability to prove compliance to authorized parties?
The ASP + view key model is not perfect – it assumes that compliance frameworks can be encoded as set membership proofs, which works for sanctions lists and KYC checks but may not capture more nuanced regulatory requirements. And there is always the question of who controls the ASPs and how they are governed.
But as a cryptographic architecture, this is the most credible attempt I have seen at “privacy with a compliance escape hatch” on a major L1. The fact that it is fully open-source (circuits, contracts, frontend) means the community can audit, fork, and improve it.
What are your thoughts? Is the ASP model sufficient for real-world regulatory compliance? Can Groth16 scale to meaningful anonymity sets on Soroban? And does client-side WASM proving introduce UX barriers that will limit adoption?
Curious to hear perspectives from the legal, security, and DeFi sides of this community.