Decentralized ZK-SNARK Privacy Mixer β Anonymous transactions on Ethereum & L2 networks
Anomic Protocol is a Tornado Cash-inspired decentralized privacy mixer using ZK-SNARK (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) to enable anonymous ETH, ERC20, and native token transactions across Ethereum and Layer 2 networks.
- π Zero-Knowledge Proofs β Groth16 + BN128 curve
- π Multi-chain β Ethereum, Linea, Base, Arbitrum, Optimism, Polygon, BSC
- β‘ Client-side Proving β ZK proofs generated in browser via snarkjs
- π Mathematical Privacy β No link between deposit & withdrawal addresses
- ποΈ DAO Governance β ANC token with voting, staking, and anonymity mining
- π Relayer Support β Privacy-preserving withdrawals without connecting wallet
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ANOMIC PROTOCOL β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β User β β Frontend β β Relayer β β Blockchain β β
β β (Wallet) βββββΊβ (React) βββββΊβ (Edge Func) βββββΊβ (EVM L2s) β β
β βββββββββββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ β
β β β β β
β βΌ β βΌ β
β βββββββββββββββ β βββββββββββββββ β
β β ZK Prover β β β Verifier β β
β β (snarkjs) β β β (Groth16) β β
β βββββββββββββββ β ββββββββ¬βββββββ β
β β β β
β β ββββββββΌβββββββ β
β β β AnomicMixer β β
β β β (MerkleTree)β β
β β βββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ β
β β Backend (Supabase) β β
β β Edge Functions: deposit, withdraw, relayer, shielded-transfer β β
β β Database: pools, deposits, nullifiers, merkle_tree, governance β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Deposit: User generates
secret+nullifier, computescommitment = Poseidon(nullifier, secret), sends ETH to mixer - Merkle Tree: Commitment inserted into incremental Merkle tree (height=20)
- Withdraw: User creates ZK proof proving knowledge of
secret/nullifierwithout revealing them - Verification: On-chain Verifier checks proof, prevents double-spending via nullifier hash
| Component | Implementation |
|---|---|
| ZK Protocol | Groth16 |
| Curve | BN128 |
| Hash Function | Poseidon (zk-friendly) |
| Merkle Tree | Incremental, height=20 |
| Public Inputs | 6 (root, nullifierHash, recipient, relayer, fee, refund) |
| Proof Size | 256 bytes |
contracts/Verifier.solβ Groth16 verifier (auto-generated by snarkJS)contracts/AnomicMixer.solβ Main mixer with Merkle treesrc/lib/zkProver.tsβ Client-side proof generationsrc/lib/zkCrypto.tsβ Poseidon, Merkle tree, note generationpublic/circuits/β WASM, zkey, verification key
| Network | ChainId | Verifier Address |
|---|---|---|
| Ethereum | 1 | 0x9a5537156388306dbc66EB3357317c86802BE6b7 |
| Linea | 59144 | 0x2218163979Fb6FDC209781e1355EbB61675841A7 |
| Base | 8453 | 0x2218163979Fb6FDC209781e1355EbB61675841A7 |
| Arbitrum | 42161 | 0xc877340291Df1a2ef545C8B6508B851457C4D428 |
| Optimism | 10 | 0x69C7CB6b0cAE5ACF725aFDf5CB274106082EF6b4 |
| Polygon | 137 | 0xDEaD89EfAF73663a7F0398e0DfB3289EA6C5E9DD |
| BSC | 56 | 0x798C4B97Ac52118eBa5A106c21637EbAa3a335c8 |
| Sepolia | 11155111 | 0x9CeF18fFC3f8B7415bb06c3403893E856C1E8f91 |
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, TypeScript, Tailwind CSS, shadcn/ui |
| Web3 | ethers.js v6, WalletConnect v2, snarkjs, circomlibjs |
| Backend | Supabase (Edge Functions, PostgreSQL, Realtime) |
| Smart Contracts | Solidity 0.8.x, Hardhat, OpenZeppelin |
| ZK Circuits | Circom 2.x, Groth16 (BN128) |
| BTC Support | bitcoinjs-lib, CoinJoin protocol |
- Node.js β₯ 18 (recommended 20+)
- npm β₯ 9
- Circom 2.x (for ZK circuits)
# Clone repository
git clone https://github.com/anomic-protocol/anomic-protocol.git
cd anomic-protocol
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Start development server
npm run devnpm run build
npm run preview# Run tests
npm test
# Compile contracts
npx hardhat compile
# Deploy to testnet
npx hardhat run scripts/deployL2Pools.js --network sepolia
# Deploy to mainnet
npx hardhat run scripts/deployL2Pools.js --network linea
npx hardhat run scripts/deployL2Pools.js --network ethereum
# Sync contracts to frontend
npm run sync:zkprover
# Verify ZK alignment
npm run verify:zk-alignmentanomic-protocol/
βββ contracts/ # Solidity smart contracts
β βββ AnomicMixer.sol # Main mixer with Merkle tree
β βββ Verifier.sol # Groth16 verifier
β βββ AnomicCash.sol # ANC token (ERC20)
β βββ AnomicGovernance.sol
β βββ ...
βββ src/ # Frontend (React + TypeScript)
β βββ lib/
β β βββ zkProver.ts # ZK proof generation
β β βββ zkCrypto.ts # Poseidon, Merkle tree
β βββ components/
β βββ pages/
βββ public/
β βββ circuits/ # ZK circuit artifacts
β βββ withdraw.zkey
β βββ withdraw.wasm
β βββ verification_key.json
βββ scripts/ # Deployment scripts
βββ supabase/ # Edge functions & database
βββ docs/ # Documentation
βββ circuits/ # Circom ZK circuits
| Document | Description |
|---|---|
| ZK Architecture | Complete ZK-SNARK technical docs |
| Deployment Guide | L2 networks deployment |
| Trusted Setup | MPC ceremony guide |
| Security Checklist | Production security |
| Comparison vs Tornado Cash | Feature comparison |
- β ReentrancyGuard on all critical functions
- β Pausable by governance in emergencies
- β Merkle root history (30 roots circular buffer)
- β Nullifier double-spend protection
- β Fee caps and validation
- β OpenZeppelin contracts
- β Slither static analysis
β οΈ Audits: Always audit before production use
Withdrawals support dynamic fees based on delay (better privacy = lower fee):
| Delay | Fee |
|---|---|
| β€ 1 hour | 3.0% |
| β€ 12 hours | 2.5% |
| β€ 24 hours | 2.0% |
| β€ 48 hours | 1.75% |
| > 48 hours | 1.5% |
Fee distribution:
- 50% β ANC Pool (buyback/treasury)
- 25% β Relayer (if used)
- 20% β Stakers (via StakingRewards)
- 5% β DAO (governance)
- Fork the repository
- Create a feature branch (
git checkout -b feature/xxx) - Commit your changes (
git commit -m 'Add xxx') - Push to the branch (
git push origin feature/xxx) - Open a Pull Request
MIT License β see LICENSE for details.
- π Website: anomic.cash
- π Docs: docs.anomic.cash
- π¬ Discord Community CULT: Join
- π¬ Telegram Official DAO: Join
- π¦ Twitter: @AnomicProtocol
Built with π and Zero-Knowledge Proofs