当前位置:网站首页>Bytecode proof in appliedzkp zkevm (9)
Bytecode proof in appliedzkp zkevm (9)
2022-06-28 10:21:00 【mutourend】
1. introduction
bytecode proof Can help EVM proof, bring bytecode Easier to access (bytecode With its code hash To mark ).bytecode Each of the byte It can be used in the bytecode To access . At the same time, a flag To mark the byte It's a opcode still To the previous PUSH The directive 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 be used for find how many bytes an opcode pushes, Used to detect which byte yes code, Which one? byte No code.
Because it will be for each byte Conduct lookup, The table It can also be used indirectly for 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
The circuit By setting tag = Length add to bytecode length The line of Start , Then from position 0 Start , Traversing this bytecode All of the bytes.
Reference material
边栏推荐
- Huawei OSPF single region
- [happy Lantern Festival] guessing lantern riddles eating lantern festival full of vitality ~ (with lantern riddle guessing games)
- 六月集训(第28天) —— 动态规划
- 如何使用 DataAnt 监控 Apache APISIX
- linux中源码安装mysql数据库(centos)
- Solve the problem that the value of the action attribute of the form is null when transferring parameters
- 丢弃 Tkinter!简单配置快速生成超酷炫 GUI!
- Installing redis under Linux and windows (ultra detailed graphic tutorial)
- 物联网无线通信应用中6种融合定位技术
- Numpy array: join, flatten, and add dimensions
猜你喜欢

Application of X6 in data stack index management

As shown in the figure, the SQL row is used to convert the original table of Figure 1. Figure 2 wants to convert it

通过PyTorch构建的LeNet-5网络对手写数字进行训练和识别

为什么 Istio 要使用 SPIRE 做身份认证?
![[200 opencv routines] 213 Draw circle](/img/8d/a771ea7008f84ae3a3cf41507448ec.png)
[200 opencv routines] 213 Draw circle

What is the best way to learn machine learning

Looking at jBPM from jbm3 to jbm5 and activiti

增强 Jupyter Notebook 的功能,这里有四个妙招

解析:去中心化托管解决方案概述

Why does istio use spirit for identity authentication?
随机推荐
[Unity]内置渲染管线转URP
Idea failed to connect to SQL Sever
idea连接sql sever失败
用 Compose 实现个空调,为你的夏日带去清凉
Fastposter v2.8.4 release e-commerce poster generator
Discard Tkinter! Simple configuration to quickly generate cool GUI!
Correct conversion between JSON data and list collection
缓存之王Caffeine Cache,性能比Guava更强
老板叫我写个APP自动化--Yaml文件读取--内附整个框架源码
How to use dataant to monitor Apache apisex
一文读懂 12种卷积方法(含1x1卷积、转置卷积和深度可分离卷积等)
Instant messaging and BS architecture simulation of TCP practical cases
Unity loads AssetBundle resources from the server and writes them to local memory, and loads the downloaded and saved AB resources from local memory to the scene
Numpy array: join, flatten, and add dimensions
物联网5种无线传输协议特点大汇总
Starting from full power to accelerate brand renewal, Chang'an electric and electrification products sound the "assembly number"
[Unity]EBUSY: resource busy or locked
第三章 栈和队列
June training (day 28) - Dynamic Planning
etf持仓如何影响现货金价?