深入了解Polygon zkEVM:整体架构与交易执行流程,polymaker

2023-04-08 11:59:07 views

In-depth understanding of the overall architecture and transaction execution process The first article in the digital currency series of articles on the virtual currency exchange platform briefly expounds the overall architecture and transaction execution process of the, and analyzes how to realize the calculation expansion while inheriting the virtual currency exchange platform of Ethereum, the virtual currency exchange platform of digital currency and the virtual currency exchange platform of digital currency, and the digital currency home page newsletter blockchain blockchain encyclopedia home page encyclopedia deeply understands the overall architecture and transaction execution process. 比特币今日价格行情网_okx交易所app_永续合约_比特币怎么买卖交易_虚拟币交易所平台

Polygon zkEVM系列文章的第一篇,简要的阐述了polygon zkEVM的的整体架构和交易执行流程,并且分析了polygon zkEVM是如何实现计算扩容的同时继承以太坊的安全性的。

同时还会在接下来两篇文章会详细介绍Polygon zkEVM的zkEVM Bridge和zkEVM的设计细节,以及polygon zkEVM接下来的去中心化sequencer的路线图。

目录 Rollup 是为了给以太坊实现计算扩容 不同 Rollup 路线之间的区别 Polygon zkEVM 的具体执行流程 & 整体架构 从模块化区块链的角度解析 Polygon zkEVM Polygon zkEVM 如何继承L1的安全性 Polygon zkEVM 激励机制 1.Rollup为了给以太坊实现计算扩容

首先,我们需要明确rollup的大概工作原理:

rollup的出现的是为了给Ethereum实现计算扩容,具体的实现方法是将交易的执行外包给 Rollup,然后将交易和交易执行后的状态(state)存储在 Ethereum 的合约内。

由于技术路线的不同演变出了两种类型的 Rollup:

Optimistic Rollup: 乐观的认为发送到 EthereumRollup 交易(Rollup transaction)和对应的 Rollup 状态(Rollup State )都是正确的,任何人都可以通过提供欺诈证明(fraud proof)对还处于挑战期的Rollup State进行挑战(challenge) Zero-knowledge Rollup: 会为发送到 EthereumRollup交易(Rollup Transaction)和对应的 Rollup 状态(Rollup state)提供一个有效性证明(validity proof)(由以太坊上的合约验证,来证明 Rollup 的执行对应交易后的状态时正确的) (以太坊官方定义) https://ethereum.org/en/developers/docs/scaling/

Zero-knowledge RollupOptimistic Rollup 最大的区别就是由于验证状态有效性的不同方式导致达成 finality 的时间不同;

Optimistic Rollup 乐观的认为提交到 Ethereum 上的交易和状态都是正确的,所以存在7天的挑战期(达成finality的时间是7天),期间任何人发现在 Ethereum 上的交易对应状态不正确都可以通过提交正确的状态进行挑战。

Zero-knowledge Rollup( zk-Rollup ) 达成 finality 的时间,则取决于: 交易对应的有效性证明( validity proof )提交到以太坊并且验证通过所花费的时间。目前可能在1个小时左右的finality居多。(因为需要考虑到Gas成本问题)

2.Polygon zkEVM 执行流程

接下里我们以一个简单的交易被确认流程来看看 Polygon zkEVM是怎么工作的,从而对整体协议有一个具体的理解;

整个过程可以主要分为三个步骤:

Sequencer 将多个用户交易打包成 Batch 提交到L1的合约上。 Prover 为每笔交易生成有效性证明(validity proof),并将多个交易的有效性证明聚合成一个有效性证明。 Aggregator 提交聚合了多个交易的有效性证明(validity proof) 到 L1 的合约中。 1) Sequencer 将用户交易打包成 Batch 提交到 L1 合约上 用户将交易发送给Sequencer, Sequencer会在本地按照收到交易的快慢顺序进行处理(FRFS),当Sequencer在本地将交易执行成功后,如果用户相信Sequencer是诚实的,那么他可以认为这个时候的交易已经达成了finality。 这里需要注意,目前大多数Sequencer内部的Mempool(交易池)都是私有的,所以暂时可以获取的MEV是比较少的 Sequencer 会将多笔交易打包进一个Batch里(目前是一个Batch里只包含一个交易) , 然后在收集到多个Batches之后, 通过L1上的 PolygonZKEvm.sol 的sequenceBatch()函数将多个Batch一起送到L1的交易calldata上。

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。