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. 定制类型

为线索定制了如下类型:

NameTypeDescription
GlobalCounterintOrder of random access to BusMapping, which should be in sequence
BusMappingList[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加载。

TargetIndexAccessible ByDescription
BlockenumReadBlock constant decided before executing the block
BlockHashindexReadPrevious 256 block hashes as a encoded word array
AccountNonceaddressRead, WriteAccount’s nonce
AccountBalanceaddressRead, WriteAccount’s balance
AccountCodeHashaddressRead, WriteAccount’s code hash
AccountStorageaddress.keyRead, WriteAccount’s storage as a key-value mapping
Codehash.indexReadExecuted code as a byte array
Callid.enumReadCall’s context decided by caller (includes EOA and internal calls)
CallCalldataid.indexReadCall’s calldata as a byte array (only for EOA calls)
CallSignatureid.indexReadCall’s signature as a byte array (only for EOA calls)
CallStateid.enumRead, WriteCall’s internal state
CallStateStackid.indexRead, WriteCall’s stack as a encoded word array
CallStateMemoryid.indexRead, WriteCall’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的zkevmWord Encoding

appliedzkp的zkevm定制化Proof System

appliedzkp的zkevm(12)State Proof

zkEVM:EVM兼容性 VS EVM等价性