Skip to content
@Anomic-Cash

Anomic Cash

Privacy-first ZK mixer for anonymous transactions across L1s, L2s, and Bitcoin. Supports ETH, ERC20 tokens, and shielded transfers.

Anomic Protocol 🛡️

Decentralized ZK-SNARK Privacy Mixer — Anonymous transactions on Ethereum & L2 networks & Bitcoin

License: MIT TypeScript Solidity Circom


About

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.

Key Features

  • 🔐 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

Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                              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       │ │
│  └────────────────────────────────────────────────────────────────────────┘ │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

ZK-SNARK Technology

How It Works

  1. Deposit: User generates secret + nullifier, computes commitment = Poseidon(nullifier, secret), sends ETH to mixer
  2. Merkle Tree: Commitment inserted into incremental Merkle tree (height=20)
  3. Withdraw: User creates ZK proof proving knowledge of secret/nullifier without revealing them
  4. Verification: On-chain Verifier checks proof, prevents double-spending via nullifier hash

Cryptographic Stack

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

Files

  • contracts/Verifier.sol — Groth16 verifier (auto-generated by snarkJS)
  • contracts/AnomicMixer.sol — Main mixer with Merkle tree
  • src/lib/zkProver.ts — Client-side proof generation
  • src/lib/zkCrypto.ts — Poseidon, Merkle tree, note generation
  • public/circuits/ — WASM, zkey, verification key

Deployed Contracts (V2)

Verifiers

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

Tech Stack

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

Quick Start

Prerequisites

  • Node.js ≥ 18 (recommended 20+)
  • npm ≥ 9
  • Circom 2.x (for ZK circuits)

Development Commands

# 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-alignment

Project Structure

anomic-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

Documentation

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

Security

  • ✅ 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

Fee Structure

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)

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/xxx)
  3. Commit your changes (git commit -m 'Add xxx')
  4. Push to the branch (git push origin feature/xxx)
  5. Open a Pull Request

License

MIT License — see LICENSE for details.


Links


Built with 🔒 and Zero-Knowledge Proofs

Pinned Loading

  1. anomic-relayer anomic-relayer Public

  2. anomic-governance anomic-governance Public

    Anomic Cash Governance

  3. anc-token anc-token Public

    Anomic Cash token (ANC)

    Solidity 1

  4. anomic-core anomic-core Public

    ZK tools for anonymous transactions across L1s, L2s, and Bitcoin. Supports ETH, ERC20 tokens, and shielded transfers.

  5. zk-architecture zk-architecture Public

    zk architecture anomic cash

    1

  6. contracts contracts Public

    Solidity 1

Repositories

Showing 9 of 9 repositories

Top languages

Loading…

Most used topics

Loading…