appliedzkp zkevm(11)中的EVM Proof
Posted mutourend
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了appliedzkp zkevm(11)中的EVM Proof相关的知识,希望对你有一定的参考价值。
1. 引言
EVM Proof用于证明:
- state trie root的变化是正确的,通过验证一个区块内所包含的交易都具有正确的执行结果。
EVM circuit会重新实现EVM,但是是以验证的角度来验证,即意味着,Prover可帮助提供线索,只要这些线索不会与结果相矛盾。如,Prover可提供关于某call是否将revert的线索,或者某opcode是否将遇到错误的线索,然后该EVM circuit可验证执行结果是正确的。
在区块内包含的交易可以是简单的ether transfers、contraction creation或 contract interactions,因为每笔交易具有可变的execution trace,无法使用固定的circuit layout来验证特定region的特定logic,为此,我们需要a chip来验证所有可能的logics,该chip将自身重复来实现整个circuit。
2. 定制类型
为线索定制了如下类型:
Name | Type | Description |
---|---|---|
GlobalCounter | int | Order of random access to BusMapping , which should be in sequence |
BusMapping | List[Tuple[int, ...]] | List of random read-write access data in sequence with GlobalCounter as index |
3. Random Accessible Data
EVM解析器可做any random access to data类似如account balance、account storage、stack in current scope、memeory in current scope,但是对于EVM circuit来说,其很难跟踪这些数据来保证这些数据的实时一致性。
因此,EVM proof具有State proof来提供a valid list of random read-write access records indexed by the GlobalCounter
as a lookup table to do random access at any moment。
将random read-write access records list称为BusMapping
,因为其作用类似于电脑中的bus,用于在不同部件之间传输数据。类似的,read-only数据以random access方式从lookup table加载。
Target | Index | Accessible By | Description |
---|---|---|---|
Block | enum | Read | Block constant decided before executing the block |
BlockHash | index | Read | Previous 256 block hashes as a encoded word array |
AccountNonce | address | Read , Write | Account’s nonce |
AccountBalance | address | Read , Write | Account’s balance |
AccountCodeHash | address | Read , Write | Account’s code hash |
AccountStorage | address.key | Read , Write | Account’s storage as a key-value mapping |
Code | hash.index | Read | Executed code as a byte array |
Call | id.enum | Read | Call’s context decided by caller (includes EOA and internal calls) |
CallCalldata | id.index | Read | Call’s calldata as a byte array (only for EOA calls) |
CallSignature | id.index | Read | Call’s signature as a byte array (only for EOA calls) |
CallState | id.enum | Read , Write | Call’s internal state |
CallStateStack | id.index | Read , Write | Call’s stack as a encoded word array |
CallStateMemory | id.index | Read , Write | Call’s memory as a byte array |
3. Circuit Constraints
该重复chip具有2个main states,一个调用初始化,另一个用于bytecode execution。
参考资料
[1] EVM Proof
以上是关于appliedzkp zkevm(11)中的EVM Proof的主要内容,如果未能解决你的问题,请参考以下文章
appliedzkp zkevm中的Bytecode Proof
appliedzkp zkevm(10)中的Transactions Proof
appliedzkp的zkevm定制化Proof System