๐Ÿ” ZK Rollups: Prove Valid Before Accepting

Understand how zkSync and StarkNet use mathematical proofs

Compare the two dominant rollup approaches

๐Ÿ” ZK Rollups Deep Dive

Zero-Knowledge rollups take the opposite approach: prove every transaction is valid upfront using cryptographic proofs. No trust requiredโ€”just math.

โš™๏ธ How It Works

1

Batch Transactions

Sequencer collects thousands of L2 transactions into a single batch for efficient proving.

2

Generate Validity Proof

Prover runs ZK circuit to create cryptographic proof that all transactions are valid (computationally expensive).

3

Verify on L1

L1 smart contract verifies proof in milliseconds (very cheap, ~500K gas). Proof guarantees correctness.

4

Instant Finality

Once verified, state is immediately final. No challenge period. Withdrawals available instantly.

๐ŸŽฎ Interactive Validity Proof Simulator

Watch how ZK rollups use cryptographic proofs to guarantee transaction validity without re-executing.

๐Ÿ“

1. Collect Transactions

Sequencer batches thousands of L2 transactions

Batch #5678: 10,000 transactions collected. Old state root: 0xabc...def. Ready for proving.

๐Ÿ”ฌ Types of ZK Proofs

ZK-SNARKs

Succinct Non-Interactive Arguments of Knowledge

โœ“Tiny proofs (~200 bytes), cheap to verify
โœ“Fast verification (milliseconds)
โœ—Requires trusted setup ceremony
โœ—Vulnerable to quantum computers
Used by: zkSync Era, Scroll

ZK-STARKs

Scalable Transparent Arguments of Knowledge

โœ“No trusted setup needed (transparent)
โœ“Quantum-resistant cryptography
โœ—Larger proofs (~100KB), costlier to verify
โœ—Slower verification
Used by: StarkNet, Polygon Miden

๐Ÿ›ก๏ธ Security Model

โœ“ Advantages

  • โ€ขInstant finality: No 7-day wait, withdraw immediately
  • โ€ขStronger security: Math proves correctness, no trust needed
  • โ€ขPrivacy potential: Can hide transaction details in proof
  • โ€ขLower data costs: Only proof needed, not full tx data

โš ๏ธ Trade-offs

  • โ€ขExpensive proving: Costs $50-200+ per batch to generate proof
  • โ€ขSlower execution: Proof generation takes 5-30 minutes
  • โ€ขComplex cryptography: Harder to implement and audit
  • โ€ขEVM challenges: Full EVM equivalence is technically difficult

๐ŸŒ Real-World Implementations

zkSync Era

Matter Labs' ZK rollup ($500M+ TVL)

โ€ข ZK-SNARK proofs
โ€ข EVM compatible
โ€ข Native account abstraction

StarkNet

StarkWare's ZK rollup with Cairo VM

โ€ข ZK-STARK proofs
โ€ข Cairo language
โ€ข Quantum-resistant

Polygon zkEVM

True EVM equivalence with ZK

โ€ข ZK-SNARK proofs
โ€ข Full EVM bytecode support
โ€ข Easy migration