Learn How Privacy Swaps Work
An educational demonstration of Railgun-inspired privacy pool concepts. See how commitments, nullifiers, and shielded transactions provide privacy for DEX swaps.
Private Swap
This demo shows how privacy pools work. When you swap, tokens go through these steps:
Generate Commitment
Create a cryptographic commitment hiding your deposit details
commitment = hash(secret, nullifier, amount, token)Shield Tokens
Deposit tokens into the privacy pool with your commitment
privacyPool.shield(token, amount, commitment)Execute Private Swap
Swap is executed from the privacy pool - breaking the link
coordinator.executePrivateSwap(...)Unshield to Wallet
Withdraw swapped tokens using your secret
privacyPool.unshield(token, amount, nullifier, secret, recipient)How It Works
Generate Secrets
Create a random secret and nullifier. These cryptographic values are known only to you.
Shield Tokens
Deposit tokens into the privacy pool with a commitment hash. The deposit joins an anonymity set.
Private Swap
The swap executes from the privacy pool through Uniswap. The link between your deposit and the swap is broken.
Unshield
Withdraw your swapped tokens using your secret. The nullifier prevents double-spending.
Educational Demo - Not Production Ready
This is a simplified educational demonstration of privacy pool concepts. It does NOT use real zero-knowledge proofs and provides NO actual privacy. Real privacy systems like Railgun use sophisticated ZK-SNARKs to cryptographically hide transaction details. This demo uses mock tokens on Sepolia testnet for learning purposes only.