当前位置:网站首页>appliedzkp zkevm(9)中的Bytecode Proof
appliedzkp zkevm(9)中的Bytecode Proof
2022-06-28 10:00:00 【mutourend】
1. 引言
bytecode proof可帮助EVM proof,使得bytecode更易于访问(bytecode以其code hash来标识)。bytecode中的每个byte可通过其在该bytecode中的位置来访问。同时标注了一个flag来标识该byte 是一个opcode 还是 给前一PUSH指令的data。
2. Bytecode Circuit Layout
| Column | Description |
|---|---|
q_first | 1 on the first row, else 0 |
q_last | 1 on the last row, else 0 |
hash | The keccak hash of the bytecode |
tag | Tag indicates whether value is a byte or length of the bytecode |
index | The position of the byte in the bytecode |
value | The byte data for the current position, or length of the bytecode |
is_code | 1 if the byte is code, 0 if the byte is PUSH data |
push_data_left | The number of PUSH data bytes that still follow the current row |
hash_rlc | The accumulator containing the current and previous bytes |
hash_length | The bytecode length |
byte_push_size | The number of bytes pushed for the current byte |
is_final | 1 if the current byte is the last byte of the bytecode, else 0 |
padding | 1 if the current row is padding, else 0 |
push_data_left_inv | The inverse of push_data_left (IsZeroChip helper) |
push_table.byte | Push Table: A byte value |
push_table.push_size | Push Table: The number of bytes pushed for this byte as opcode |
3. Push lookup table
push lookup table用于find how many bytes an opcode pushes,用于探测哪个byte是code,哪个byte不是code。
由于会对每个byte进行lookup,该table也可间接用于range check the byte inputs。
| Byte | Num bytes pushed |
|---|---|
| [0, OpcodeId::PUSH1] | 0 |
| [OpcodeId::PUSH1, OpcodeId::PUSH32] | [1..32] |
| [OpcodeId::PUSH32, 256] | 0 |
3.1 Circuit behavior
该circuit 以通过设置tag = Length添加bytecode length的行 开始,然后自位置0开始,遍历该bytecode的所有bytes。
参考资料
边栏推荐
- 纵观jBPM从jBPM3到jBPM5以及Activiti
- idea连接sql sever失败
- 如图 用sql行转列 图一原表,图二希望转换后
- 【云驻共创】DWS告警服务DMS详细介绍和集群连接方式简介
- Numpy array: join, flatten, and add dimensions
- 【OpenCV 例程200篇】213. 绘制圆形
- Dear leaders, ask me if MySQL does not support early_ Offset mode? Unsupported star
- MySQL的开发环境和测试环境有什么区别??
- Ribbon core source code analysis
- Generate token
猜你喜欢

Redis sentinel cluster main database failure data recovery ideas # yyds dry goods inventory #

Starting from full power to accelerate brand renewal, Chang'an electric and electrification products sound the "assembly number"

PMP examination key summary VIII - monitoring process group (2)

MySQL cannot be opened. Flash back

I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!

装饰模式(Decorator)
![[NLP] this year's college entrance examination English AI score is 134. The research of Fudan Wuda alumni is interesting](/img/a8/51b95432a9c8f25d8440cfd80926ce.png)
[NLP] this year's college entrance examination English AI score is 134. The research of Fudan Wuda alumni is interesting
![[200 opencv routines] 213 Draw circle](/img/8d/a771ea7008f84ae3a3cf41507448ec.png)
[200 opencv routines] 213 Draw circle

缓存之王Caffeine Cache,性能比Guava更强
![[unity][ecs] learning notes (II)](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[unity][ecs] learning notes (II)
随机推荐
Sword finger offer | Fibonacci sequence
第六天 脚本与动画系统
How to distinguish and define DQL, DML, DDL and DCL in SQL
手把手教你处理 JS 逆向之 SVG 映射
QT signal and slot communication mechanism (when multiple windows communicate back and forth [parent and child windows])
Global exception handlers and unified return results
股票开户用中金证券经理发的开户二维码安全吗?知道的给说一下吧
Unity 从服务器加载AssetBundle资源写入本地内存,并将下载保存的AB资源从本地内存加载至场景
【云驻共创】DWS告警服务DMS详细介绍和集群连接方式简介
为什么 Istio 要使用 SPIRE 做身份认证?
Resolution: overview of decentralized hosting solution
Looking at jBPM from jbm3 to jbm5 and activiti
Caffeine cache, the king of cache, has stronger performance than guava
The R language uses the avplots function in the car package to create added variable plots. In image interaction, manually identify (add) strong influence points that have a great impact on each predi
Crawler small operation
物联网5种无线传输协议特点大汇总
Teach you how to handle the reverse SVG mapping of JS
读取pdf文字和excel写入操作
Comprehensive evaluation of outline note taking software workflow: advantages, disadvantages and evaluation
解决表单action属性传参时值为null的问题