Slide 1

Slide 1 text

Unofficial Scroll ZK EVM Code Review https://linktr.ee/alexcj96

Slide 2

Slide 2 text

Summary - Why ZK EVM works? - Architecture - Tech stack comparaison - Arithmetization - Trace generation - Gate configuration - Circuit tools - Some opcode gadgets - Public input circuit - Synthesize - Combining with halo2 - Observation

Slide 3

Slide 3 text

Why ZK EVM works? ❖ EVM is a State Machine ❖ Public-key cryptography ➢ Verify txs all represent users' intention ❖ Blockchain consensus ➢ Verifier ➢ Previous state root ❖ MPT ➢ Verify initial state ➢ Verify new root ❖ ZK ➢ Succinctness ➢ Lookup Arguments ❖ Ethereum as a DA Layer

Slide 4

Slide 4 text

Architecture

Slide 5

Slide 5 text

Tech stack comparaison

Slide 6

Slide 6 text

Arithmetization

Slide 7

Slide 7 text

Trace generation - flow (scroll has simplified this)

Slide 8

Slide 8 text

Trace generation - types (simplified)

Slide 9

Slide 9 text

Gate configuration - flow

Slide 10

Slide 10 text

Gate configuration - gadgets Add cb constraints etc

Slide 11

Slide 11 text

Gate configuration - lookup

Slide 12

Slide 12 text

Circuit tools - cell manager

Slide 13

Slide 13 text

Circuit tools - constraint builder

Slide 14

Slide 14 text

Circuit tools - constraint builder

Slide 15

Slide 15 text

Circuit tools - utils

Slide 16

Slide 16 text

Some opcode gadgets - AddSub

Slide 17

Slide 17 text

Some opcode gadgets - ReturnRevert (simplified)

Slide 18

Slide 18 text

Public input circuit

Slide 19

Slide 19 text

Public input circuit

Slide 20

Slide 20 text

Synthesize

Slide 21

Slide 21 text

Combining with halo2

Slide 22

Slide 22 text

Combining with halo2

Slide 23

Slide 23 text

Observation - Scroll doesn’t support self destruct EVM opcode - Scroll’s MPT tree uses poseidon circuit - Scroll uses chain_id and block_number to calculate block_hash!!! - Scroll still uses SuperCircuit which is very zk-unfriendly - Don’t read PSE’s code, it’s not production ready!!! - …

Slide 24

Slide 24 text

Thanks!