A full-stack, bi-directional Zero-Knowledge Rollup deployed on the Ethereum Sepolia Testnet. This protocol scales Ethereum by batching off-chain transactions, generating a Plonk ZK-SNARK proof, and verifying the state transition on-chain.
It features a complete CI/CD pipeline, Kubernetes (AKS) deployment, and a Deterministic Build System for cryptographic artifacts.
- ⚡ Instant L2 Transfers: Process transactions off-chain with immediate confirmation.
- 🌉 Bi-Directional Bridge:
- Inbound: Detects
Depositevents on L1 and auto-credits L2 accounts. - Outbound: Securely processes withdrawals back to Ethereum.
- Inbound: Detects
- 🛡️ Censorship Resistance: Implements "Forced Withdrawals" at the smart contract level, ensuring users can exit even if the Sequencer goes offline.
- 🔍 Live Block Explorer: Real-time visibility into L2 blocks, transaction status, and ZK verification.
- 🔐 ZK-SNARKs (PLONK): Uses
circomandsnarkjswith a universal trusted setup (Hermez Powers of Tau).
The system consists of four primary components:
- The Circuits (The Core):
- Written in
Circom. - Proves inclusion of a transaction sender in the Merkle Tree.
- Verifies State Root transitions.
- Written in
- The L2 Node (The Brain):
- API: Node.js/Express server handling client requests.
- State Manager: Manages a Sparse Merkle Tree (SMT) backed by PostgreSQL.
- Sequencer: Batches transactions and submits proofs to Sepolia.
- The Prover (The Muscle):
- Generates cryptographic proofs (PLONK) using
snarkjs. - Runs inside a deterministic Docker container.
- Generates cryptographic proofs (PLONK) using
- The Infrastructure (The Cloud):
- Deployed on Azure Kubernetes Service (AKS) via Terraform.
- Automated CI/CD via GitHub Actions.
| Category | Technology | Usage |
|---|---|---|
| Blockchain | Solidity, Hardhat, Ethers.js | L1 Smart Contracts & Integration |
| Cryptography | Circom, SnarkJS | ZK Circuits & Proof Generation |
| Backend | Node.js, Express | API & Sequencer Logic |
| Database | PostgreSQL | Off-chain State & Mempool |
| Frontend | Next.js, TailwindCSS | User Dashboard & Explorer |
| DevOps | Docker, Kubernetes (AKS) | Containerization & Orchestration |
| IaC | Terraform | Infrastructure Provisioning |
- Node.js v18+
- Docker & Docker Compose
- A Sepolia Wallet Private Key & RPC URL
git clone https://github.com/yourusername/zk-rollup.git
cd zk-rollup
npm install
cd frontend && npm installTest the Merkle Tree and Circuit logic without touching the blockchain.
node test/local-simulation.jsSpin up the Database, Backend, and Frontend.
Note: Create a .env file in root with SEPOLIA_RPC_URL and PRIVATE_KEY first.
# 1. Start Postgres
docker-compose up -d postgres
# 2. Start Backend
node src/api.js
# 3. Start Frontend (in new terminal)
cd frontend && npm run devVisit http://localhost:3000 to interact with the Rollup.
This project uses a "GitOps" approach. Pushing to main triggers the pipeline.
Provision the Azure AKS cluster.
cd terraform
terraform init
terraform applyThe .github/workflows/deploy.yml pipeline handles:
- Multi-Stage Docker Build:
- Downloads official Powers of Tau (PTAU 14).
- Compiles Circuits (
.r1cs,.wasm). - Generates ZKeys deterministically.
- Compiles Solidity Contracts using the generated Verifier.
- Push: Pushes optimized images to Docker Hub.
- Deploy: Updates Kubernetes manifests and restarts pods.
If you need to deploy the contracts manually via Kubernetes Job:
kubectl apply -f k8s-scripts/job-deploy.yamlA major challenge in ZK development is ensuring the Prover (Off-chain) and Verifier (On-chain) use the exact same cryptographic parameters.
- I solved this by compiling circuits inside the Docker build process.
- I use the Polygon Hermez Powers of Tau (Size 14) to ensure a standardized, secure trusted setup base.
- Tree Depth: 4 (Optimized for demo speed, supports 16 accounts).
- Hashing: Poseidon Hash (ZK-friendly).
- Proof System: PLONK (Allows Universal Setup, faster verification).
This project is licensed under the MIT License - see the LICENSE file for details.