PrivateSwap

Educational Demo

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.

Sepolia TestnetEducational Demo

Private Swap

Privacy Enabled
You payBalance: 0 WETH
You receiveBalance: 0 USDC
USDC

This demo shows how privacy pools work. When you swap, tokens go through these steps:

1

Generate Commitment

Create a cryptographic commitment hiding your deposit details

commitment = hash(secret, nullifier, amount, token)
2

Shield Tokens

Deposit tokens into the privacy pool with your commitment

privacyPool.shield(token, amount, commitment)
3

Execute Private Swap

Swap is executed from the privacy pool - breaking the link

coordinator.executePrivateSwap(...)
4

Unshield to Wallet

Withdraw swapped tokens using your secret

privacyPool.unshield(token, amount, nullifier, secret, recipient)

How It Works

Step 1

Generate Secrets

Create a random secret and nullifier. These cryptographic values are known only to you.

Step 2

Shield Tokens

Deposit tokens into the privacy pool with a commitment hash. The deposit joins an anonymity set.

Step 3

Private Swap

The swap executes from the privacy pool through Uniswap. The link between your deposit and the swap is broken.

Step 4

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.