当前位置:网站首页>appliedzkp zkevm(8)中的Plookup Table
appliedzkp zkevm(8)中的Plookup Table
2022-06-26 09:48:00 【mutourend】
1. 引言
appliedzkp zkevm采用 Halo2的lookup table 作为a primitive,来check table中的某一行确实是某些adviced values。
如,以下table的a、b、c列,其中a、b列为“0,1,2”的可能组合,c为对a、b列的逻辑AND运算:
| a | b | c |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 2 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| 1 | 2 | 0 |
| 2 | 0 | 0 |
| 2 | 1 | 0 |
| 2 | 2 | 2 |
可使用该table来检查circuit中的某些x、y变量的AND运算约束,以证明"x"、“y”、"x & y"为对应该table中的某一行。
zkevm中有2种类型的table:
- 1)Fixed Table
所谓Fixed Table,是指该fixed table中的行在proving time“之前”就已确定。
上面的AND运算table就是fixed table。 - 2)Variable Table(Dynamic Table)
所谓Variable Table,是指该variable table中的行在proving time "时"确定。
Variable Table使得Prover可创建自己的table,如Prover可witness a key-value mapping为a variable table。注意,此时需要做额外检查来确保mapping key的唯一性。
2. zkevm EVM circuit中的tables
zkevm的EVM circuit中使用了多种dynamic和fixed tables,其中dynamic table内容的有效性由其自身关联的circuit来证明。
zkevm中的dynamic tables有:
- 1)tx_table:由tx circuit证明。
- 2)rw_table:由state circuit证明。
- 3)bytecode_table:由bytecode circuit证明。
- 4)block_table:由block circuit证明。
- 5)mpt_table:由MPT(Merkle Particia Trie)circuit提供。
zkevm中的fixed tables有:
- 1)execution_state.responsible_opcode():将execution_state 映射(map)到 生成该execution state的opcode。所谓execution_state,是指当opcode运行成功的状态。这种映射可能会将多个相似的opcode合并到一个execution state,如LT/GT/EQ都对应CMP状态。
- 2)invalid_opcode():为invalid opcodes set。
- 3)state_write_opcode():为会write state的一组opcodes。
- 4)stack_underflow_pairs:在执行时会引起underflow的opcodes set和stack pointer value。
- 5)stack_overflow_pairs:在执行时会引起overflow的opcodes set和stack pointer value。
参考资料
边栏推荐
猜你喜欢

Basic MySQL

Detailed explanation of winsorflow quantum installation process

Allocation of heap memory when creating objects

【Leetcode】76. Minimum covering substring

Express (I) - easy to get started

AdaptiveAvgPool2D 不支持 onnx 导出,自定义一个类代替 AdaptiveAvgPool2D

How to start the learning journey of webrtc native cross platform development?

Jar version conflict resolution

JS reverse | four libraries and one platform response data encryption

904. 水果成篮
随机推荐
118. Yanghui triangle
Flutter and native communication (Part 1)
Oracle sqlplus 查询结果显示优化
方法区里面有什么——class文件、class文件常量池、运行时常量池
[depth first search] 312 Poke balloon
看我在Map<String, String>集合中,存入Integer类型数据
Basic string operations in C
904. 水果成篮
Reshape a two-dimensional array with 3 rows and 3 columns to find the sum of the diagonals
String constant pool, class constant pool, and runtime constant pool
Yarn package management tool
echo $?
8-图文打造LeeCode算法宝典-最小栈与LRU缓存机制算法题解
【Leetcode】76. Minimum covering substring
工程数学概率论统计简明教程第二版复习大纲
挖财商学院证券开户安全嘛?
用同花顺手机炒股是安全的吗?如何用同花顺炒股
What should the preview do?
【無標題】
基础-MySQL