Slide 5
Slide 5 text
Dive into Scroll ZkEVM 5
Lookup Table
Certain validation of the state machine is rather complex. For instance, verifying a signature requires ECDSA circuit constraints.
However, ECDSA involves hash functions dependent on bitwise operations, and integrating such hash functions directly into the
main circuit could result in an excessively large circuit size, thereby slowing down proof generation.
To address this issue, Lookup Tables are utilized. Sub-circuits are used to constrain the correctness of these tables, thus avoiding
the inclusion of non-ZK-friendly circuits, often referred to as "Overhead."
These sub-circuits also generate separate proofs. In the Aggregation Circuit, the correctness of all proofs are verified and a final
proof is generated, thereby reducing verification costs and proof size.
ZkEVM requires many Lookup Tables, including but not limited to the following:
Fixed tables: Used for constraining bitwise operations, range checks, etc.
0 Tag 1 2 3
FixedTableTag
Range16 0..16 0 0
Range32 0..32 0 0
Range64 0..64 0 0
Range256 0..256 0 0
Range512 0..512 0 0
Range1024 0..1024 0 0
SignByte value=0..256 if (value as i8 \< 0) 0xff else 0 0
BitwiseAnd lhs=0..256 rhs=0..256 $lhs AND $rhs
BitwiseOr lhs=0..256 rhs=0..256 $lhs OR $rhs
BitwiseXor lhs=0..256 rhs=0..256 $lhs XOR $rhs
ResponsibleOpcode $execution_state $responsible_opcode $auxiliary
Bytecode table: Dependent on keccak tables, these are used to verify that the executing opcode indeed belongs to a certain
segment of bytecode.
0,1 CodeHash{Lo,Hi} 2 Tag 3 Index 4 IsCode 5 Value
BytecodeFieldTag
$codeHash{Lo,Hi} Length 0 0 $value
$codeHash{Lo,Hi} Byte $index $isCode $value
... ... ... ... ...
$codeHash{Lo,Hi} Byte $index $isCode $value
MPT Table: Prove that reads/updates of account nonces, balances, or storage slots are correct.
Address MPTProofType Key{Lo,Hi} ValuePrev{Lo,Hi} Value{Lo,Hi} RootPrev{Lo,Hi} Root{Lo,H
$addr NonceMod 0,0 $noncePrev,0 $nonceCur,0 $rootPrev{Lo,Hi} $root{Lo,H
$addr BalanceMod 0,0 $balancePrev{Lo,Hi} $balanceCur{Lo,Hi} $rootPrev{Lo,Hi} $root{Lo,H
$addr CodeHashMod 0,0 $codeHashPrev{Lo,Hi} $codeHashCur{Lo,Hi} $rootPrev{Lo,Hi} $root{Lo,H
$addr NonExistingAccountProof 0,0 0,0 0,0 $rootPrev{Lo,Hi} $root{Lo,H
$addr AccountDeleteMod 0,0 0,0 0,0 $rootPrev{Lo,Hi} $root{Lo,H
$addr StorageMod $key{Lo,Hi} $valuePrev{Lo,Hi} $valueCur{Lo,Hi} $rootPrev{Lo,Hi} $root{Lo,H
$addr NonExistingStorageProof $key{Lo,Hi} 0,0 0,0 $rootPrev{Lo,Hi} $root{Lo,H
ECDSA signature table: Utilized to validate the correctness of transaction signatures.
Keccak table: Ensuring the correctness of hashes, such as codeHash, blockHash, txHash and MPT nodeHash.