Scaling Ethereum through ZK-Rollups and zkEVMs
Péter Garamvölgyi
📓 save the slides!
https://bit.ly/scroll-eth-hungary
@thegaram33
A bit about zero-knowledge proofs (ZKPs)
@thegaram33
Outline
@thegaram33
About me
Doing web3 dev and research since 2017
Infrastructure Engineer @ Scroll
Previously: Core Team @ Conflux
Twitter @thegaram33
Email peter@scroll.io
@thegaram33
Zero-knowledge proofs
@thegaram33
Non-mathematical view of ZKPs - Errol Drummond
video: https://www.youtube.com/watch?v=I-hRWMwUlag�slides: https://bit.ly/pse-zkp-intro
Proofs, Arguments, and Zero-Knowledge (Justin Thaler)
https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.pdf
Getting started with ZKPs
@thegaram33
ZKPs prove�circuit satisfiability
@thegaram33
Computational circuits�logic gates�operating on bits
Zero-knowledge circuits�arithmetic gates�operating on integers of a finite field
Translating computation into circuits
+
a
b
c
✕
a
b
c
NAND
a
b
c
AND
a
b
c
d = NAND(NAND(a, b), c)
e = (a + b) ✕ d
Computational circuits
Zero-knowledge circuits
Translating computation into circuits
+
a
b
c
✕
c
d
e
NAND
a
b
NAND
c
d
e = (a + b) ✕ d
Producing a proof for a zk-circuit
+
a = 2
b = 3
c = 5
✕
c = 5
d = 2
e = 10
π
+
a
b
c
✕
c
d
e
Verifying a zk-proof π
π
a = 2, b = 3, d = 2 → e = 10
V(π, a, b, d, e) = true or false
+
a
b
c
✕
c
d
e
Verifying a zk-proof π
π
a = 2, b = 3, d = 2 → e = 10
V(π, a, b, d, e) = true or false
1. completeness: if the values are correct,�I can produce π such that V(π) = true
if e = (a + b) ✕ d , then V(π, a, b, d, e) = true
+
a
b
c
✕
c
d
e
Verifying a zk-proof π
π
a = 2, b = 3, d = 2 → e = 10
V(π, a, b, d, e) = true or false
2. soundness: if the values are incorrect,�I cannot produce π such that V(π) = true
if e ≠ (a + b) ✕ d , then V(π, a, b, d, e) = false
3. zero-knowledge: I can choose which inputs and outputs to reveal or hide��→ privacy
+
a
b
c
✕
c
d
e
Verifying a zk-proof π
π
a = 2, b = 3, d = 2 → e = 10
V(π, a, b, c, e) = true or false
4. succinctness: V has a bounded cost, often much cheaper than actually executing the computation��→ scalability
+
a
b
c
✕
c
d
e
Verifying a zk-proof π
π
a = 2, b = 3, d = 2 → e = 10
V(π, a, b, d, e) = true or false
Examples
@thegaram33
Example circuit 1: Hash preimage
+
a
b
c
✕
c
d
e
input (private): X
output (public): Y = Hash(X)
circuit C
@thegaram33
Example circuit 1: Hash preimage
+
a
b
c
✕
c
d
e
input (private): X
output (public): Y = Hash(X)
circuit C
π
@thegaram33
Example circuit 1: Hash preimage
+
a
b
c
✕
c
d
e
input (private): X
output (public): Y = Hash(X)
circuit C
→ If true, the verifier is convinced that the prover knows X
→ The verifier does not learn X → privacy
π
@thegaram33
Example circuit 2: Expensive computation
Expensive function F(x) = H(H(H(...(x))))
@thegaram33
Example circuit 2: Expensive computation
+
a
b
c
✕
c
d
e
input (public): X
output (public): Y = F(X)
→ If true, the verifier is convinced that Y == F(X)
→ V is much cheaper than F. No need to recompute F. → scalability
Expensive function F(x) = H(H(H(...(x))))
@thegaram33
Scaling Ethereum
@thegaram33
Scaling Ethereum
@thegaram33
Scaling (ethereum.org)�https://ethereum.org/en/developers/docs/scaling
An Incomplete Guide to Rollups (Vitalik Buterin)�https://vitalik.ca/general/2021/01/05/rollup.html
A rollup-centric Ethereum roadmap�https://ethereum-magicians.org/t/a-rollup-centric-ethereum-roadmap
Scaling Ethereum
@thegaram33
@thegaram33
So how do rollups work?
@thegaram33
Executing a block
tx0�tx1�tx2�…
RootN-1
RootN
BlockN
Connecting L1 and L2
Rollup Contract
tx0�tx1�tx2�…
BlockN (txs)�RootN
tx5�tx6�…
BlockN+1 (txs)�RootN+1
block data
state root
Connecting L1 and L2
How can L1 verify�the state root?
@thegaram33
Optimistic rollups
RootN-1
RootN-1
RootN
…
block data
state root
Optimistic rollups
RootN-1
RootN-1
RootN
RootN
RootN
RootN-1
…
block data
state root
RootN
RootN is incorrect! Here is the proof: P
ZK rollups
RootN-1
RootN-1
RootN
…
block data
state root
ZKP
verification passed�update accepted
ZK rollups
RootN-1
RootN-1
RootN
RootN
RootN
…
block data
state root
ZKP
RootN
RootN
block data
incorrect root
ZKP
verification passed�update accepted
verification failed�update rejected
Example circuit 3: L2 state transition
+
a
b
c
✕
c
d
e
input (public): RootN-1, tx1, …, txk
output (public): RootN
circuit C
@thegaram33
Example circuit 3: L2 state transition
+
a
b
c
✕
c
d
e
input (public): RootN-1, tx1, …, txk
output (public): RootN
circuit C
@thegaram33
Example circuit 3: L2 state transition
+
a
b
c
✕
c
d
e
input (public): RootN-1, tx1, …, txk
output (public): RootN
circuit C
→ If true, the verifier is convinced that the state root was updated correctly
→ V is much cheaper than re-executing the block → scalability
@thegaram33
Components of a zk-rollup
@thegaram33
Components of a zk-rollup
Smart Contract
……
Layer 2 node
data
proof
Components of a zk-rollup
……
Sequencer
prover
Relayer
Bridge Contract
Rollup Contract
data
proof
Liveness & censorship-resistance
The sequencer cannot cheat (cannot forge a ZKP) but it can withhold data or ignore transactions.
@thegaram33
An EVM-equivalent zk-Rollup (a zkEVM)
What is Scroll?
@thegaram33
From zk-rollups to zkEVMs
+
a
b
c
✕
c
d
e
input (public): RootN-1, tx1, …, txk, …
output (public): RootN
circuit C
@thegaram33
From zk-rollups to zkEVMs
Why? You can take your code (Solidity or even EVM bytecode), redeploy on Scroll, and it works the same way as on Ethereum
increased Ethereum�compatibility
increased prover�performance
Type 1
Type 4
Type 2.5
Type 2
Type 3
📓 save the slides!
https://bit.ly/scroll-eth-hungary
@thegaram33
Validating Bridges as a Scaling Solution for Cryptocurrency w/ Patrick McCorry
https://www.youtube.com/watch?v=oE4dI6p6ri4
Scroll Pre-Alpha Testnet Upgrade by Ye Zhang | Devcon Bogotá https://www.youtube.com/watch?v=a6kOGas--dE
The different types of ZK-EVMs (Vitalik Buterin)
Further resources
@thegaram33
join an open, innovative community that is building the future of Ethereum scaling and zk technology
@thegaram33
The workflow of Scroll
@thegaram33
The workflow of Scroll’s zk-Rollup
block data
validity proof
L2 Block status
Rollup Contract
Sequencer
Coordinator
Roller 1
1
Roller 2
Roller 3
Roller 4
Time
1
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
1
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
1
1
1
D1
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
D2
T2
Proof generation
2
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
D2
T2
Proof generation
2
4
D3
D4
T3
Proof generation
3
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
D2
T2
Proof generation
2
4
D3
D4
P1
P2
P3
T3
Proof generation
3
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
D2
T2
Proof generation
2
4
D3
D4
P1
P2
P3
T3
Proof generation
3
Aggregate proof generation
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
D2
T2
Proof generation
2
4
D3
D4
P1
P2
P3
T3
Proof generation
3
Aggregate proof generation
A
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
1
T1
Proof generation
D2
T2
Proof generation
2
4
D3
D4
P1
P2
P3
T3
Proof generation
3
Aggregate proof generation
A
Verify
Rollup Contract
Sequencer
Coordinator
Roller 1
Roller 2
Roller 3
Roller 4
Time
Proof
Data
Trace
Pre-committed Block
Committed Block
Finalized Block
The workflow of Scroll’s zk-Rollup
D1
T1
Proof generation
D2
T2
Proof generation
4
D3
D4
P1
P2
P3
T3
Proof generation
Aggregate proof generation
A
Verify
1
2
3
Rollup explorer shows the block status
Rollup explorer shows the block status
Scroll Pre-Alpha Testnet
@thegaram33
Three months ago, we have released our testnet
A summary for users and developers
Prover setup
Scroll Architecture
Sequencer
Coordinator
Relayer
Roller
zkEVM
Roller
zkEVM
Roller
zkEVM
Decentralized Prover Network
Bridge Contract
Rollup Contract
data
proof
……
Readable Cairo
Cairo assembly
zkVM
Zinc
IR
LLVM
zkVM
Better compatibility
Solidity
IR
Bytecode
EVM
Solidity
IR
Bytecode
zkEVM
Solidity
IR
Bytecode
zkASM
zkExecutor
Language
Bytecode
Runtime
Solidity
Solidity
Zinc instruction
How do we compare to other solutions?
PHASE1
Pre-Alpha testnet
PHASE3
Layer-2 proof outsourcing
PHASE2
Alpha testnet
PHASE4
zkEVM mainnet
PHASE5
Decentralized sequencer �more efficient zkVM
Roadmap
@thegaram33