Decentralized ZK-SNARK Privacy Mixer — Anonymous transactions on Ethereum & L2 networks & Bitcoin
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)
# 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: anomic-cash/docs
- 💬 Discord Community CULT: Join
- 💬 Telegram Official DAO: Join
- 🐦 Twitter: @AnomicCash
Built with 🔒 and Zero-Knowledge Proofs