You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/index.md
+33-34Lines changed: 33 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
Polygon zkEVM, as an L2 scaling-solution to Ethereum, processes and rolls up many transactions into batches.
1
+
As an Ethereum Layer 2 scaling solution, Polygon zkEVM gathers transactions into batches after executing them.
2
2
3
-
The batches are sent to Ethereum, sequenced, proved to be valid, as well as being verified. All these steps are carried out under the control of smart contracts.
3
+
Aggregated batches are then dispatched to Ethereum for verification and validation, all managed through smart contracts.
4
4
5
-
The aim with this document is to provide a broader sense of the protocol design while stating the currently implemented configuration.
5
+
This document aims to offer a comprehensive understanding of the protocol design while delineating the currently implemented configuration.
6
6
7
7
The major components of Polygon zkEVM are:
8
8
@@ -30,15 +30,14 @@ The earlier version, Polygon Hermez 1.0, was based on the Proof of Donation (PoD
30
30
31
31
PoD was basically a decentralized auction conducted automatically, with participants (coordinators) bidding a certain number of tokens in order to be selected for creating batches.
32
32
33
-
It was based on a decentralized auction model to get the right to produce batches in a specific timeframe.
34
33
35
-
The latest Consensus Contract (PolygonZkEVM.sol) is designed to leverage the experience of the PoD in v1.0 and adds support for the permissionless participation of multiple coordinators to produce batches in L2.
34
+
The updated consensus contract (PolygonZkEVM.sol) is designed to build upon the insights gained from PoD in v1.0 and adds support for permissionless participation of multiple coordinators in producing L2 batches.
36
35
37
-
In the PoD mechanism, the economic incentives were set up so the validators need to be very efficient in order to be competitive.
36
+
In the PoD mechanism, economic incentives were structured to _require_validators to operate with high efficiency to remain competitive.
38
37
39
-
The latest version of the zkEVM Consensus Contract (deployed on Layer 1) is modelled after the [Proof of Efficiency](https://ethresear.ch/t/proof-of-efficiency-a-new-consensus-mechanism-for-zk-rollups/11988).
38
+
The latest version of the zkEVM consensus contract (deployed on Layer 1) is modeled after the [Proof of Efficiency](https://ethresear.ch/t/proof-of-efficiency-a-new-consensus-mechanism-for-zk-rollups/11988).
40
39
41
-
Although designed to support for permissionless participation of multiple coordinators to produce batches in L2, for security sake and due to the protocol being in its early development stages, only one coordinator (called the Sequencer) is currently brought to service.
40
+
While the protocol design is intended to support permissionless participation of multiple coordinators to generate L2 batches, for security reasons and given the protocol's early development stage, only one coordinator (referred to as the Sequencer) is currently operational.
42
41
43
42
### Implementation model
44
43
@@ -61,35 +60,35 @@ The strategic implementation of the contract-based consensus ensures that the ne
61
60
62
61
A full zk-rollup schema requires on-chain publication of both the transaction data (which users need to reconstruct the full state) and the validity proofs (zero-knowledge proofs).
63
62
64
-
However, given the Ethereum configuration, publishing data on-chain incurs gas prices, making the choice between a full zk-rollup and a hybrid configurations challenging.
63
+
However, given Ethereum's current framework, publishing callback data to L1 incurs high gas fees, complicating the decision between opting for a full zk-rollup or a hybrid configuration.
65
64
66
65
Under a Hybrid schema, either of the following is possible:
67
66
68
67
- Validium: Data is stored off-chain and only the validity proofs are published on-chain.
69
-
- Volition: For some transactions, both the data and the validity proofs remain on-chain while for the remaining ones, only proofs go on-chain.
68
+
- Volition: For some transactions, both the data and the validity proofs are published on-chain, while in others, only the proofs are stored on-chain.
70
69
71
-
Unless, among other things, the proving module can be highly accelerated to mitigate costs for the validators, a Hybrid schema remains viable.
70
+
Unless, among other considerations, the proving module can be significantly accelerated to alleviate high costs for validators, a hybrid schema remains a viable option.
72
71
73
72
### `PolygonZkEVM.sol`
74
73
75
74
The underlying protocol in zkEVM ensures that the state transitions are correct by employing a validity proof.
76
75
77
-
In order to ensure that a set of pre-determined rules have been followed when allowing state transitions, the consensus contract (`PolygonZkEVM.sol`, deployed on L1) is utilized.
76
+
In order to ensure adherence to a set of pre-determined rules for state transitions, the consensus contract (`PolygonZkEVM.sol`, deployed on L1) is utilized.
78
77
79
78
!!!info
80
-
The consensus contract is currently deployed on both [Ethereum Mainnet](https://etherscan.io/address/0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2) and [Cardona Testnet](https://sepolia.etherscan.io/address/0xa997cfD539E703921fD1e3Cf25b4c241a27a4c7A).
79
+
The consensus contract is currently deployed on both [Ethereum mainnet](https://etherscan.io/address/0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2) and [Cardona testnet](https://sepolia.etherscan.io/address/0xa997cfD539E703921fD1e3Cf25b4c241a27a4c7A).
81
80
82
81
A smart contract verifies the validity proofs to ensure that each transition is completed correctly.
83
82
84
-
The verification is accomplished by employing zk-SNARK circuits.
83
+
State transition verification is carried out by employing zk-SNARK circuits.
85
84
86
-
A system of this type requires two processes: transaction batching and transaction validation.
85
+
A system of this type necessitates two processes: transaction batching and transaction validation.
87
86
88
-
Polygon zkEVM employs two types of participants in order to carry out the two procedures: A sequencer and an aggregator.
87
+
Polygon zkEVM implements two participant network roles in order to carry out its procedures: A sequencer and an aggregator.
89
88
90
89
Under this two-layer model:
91
90
92
-
- The sequencer proposes transaction batches to the network for execution. That is, they roll-up transaction requests into batches and add them to the Consensus Contract.
91
+
- The sequencer proposes transaction batches to the network upon executing them. That is, it rolls up transactions into batches and adds them to the consensus contract.
93
92
94
93
- The aggregator checks the validity of the transaction batches and provides validity proofs.
95
94
@@ -102,41 +101,41 @@ The smart contract, therefore, makes two calls:
102
101
103
102
!!!info
104
103
105
-
Although the current protocol design allows for several sequencers and aggregators, for the sake of security and due to the protocol being in its early development stages, only one sequencer and one aggregator are currently put into service.
104
+
Although the current protocol design allows for several sequencers and aggregators, to prioritize security and given the early stage of protocol development, only one sequencer and one aggregator are currently operational.
106
105
107
-
These are henceforth referred to as _trusted sequencer_ and _trusted aggregator_.
106
+
These are henceforth referred to as the _trusted sequencer_ and the _trusted aggregator_.
108
107
109
108
### Tokenomics
110
109
111
-
The consensus smart contract imposes the following requirements on the trusted sequencer and the trusted aggregator:
110
+
The consensus smart contract imposes the following requirements on the trusted sequencer and the trusted aggregator.
112
111
113
112
#### Sequencer
114
113
115
114
- The trusted sequencer must run the software necessary for a full zkEVM node.
116
115
117
116
- The trusted sequencer should pay a fee in the form of POL tokens for the right to create and process batches.
118
117
119
-
- The trusted sequencer is incentivized for proposing valid batches (which consist of valid transactions,) with the fees paid by the users of the network who sent the transactions.
118
+
- The trusted sequencer is incentivized to propose valid batches (consisting of valid transactions) with the fees paid by the network users who initiated the transactions.
120
119
121
120
#### Aggregator
122
121
123
-
An trusted aggregator receives all the transaction information from the trusted sequencer and sends it to the prover, which in turn provides a zk-proof after performing some complex computations.
122
+
A trusted aggregator receives all the transaction information from the trusted sequencer and sends it to the prover, which in turn provides a zk-proof after performing some complex computations.
124
123
125
124
A special _verfier_ smart contract validates the validity proof.
126
125
127
126
The trusted aggregator's task is to therefore:
128
127
129
128
- Provide validity proofs for the L2 transactions proposed by the trusted sequencer.
130
129
131
-
- Run zkEVM's zkNode software and the zkProver for creating the zero-knowledge validity proofs.
130
+
- Run zkEVM's zkNode software and the zkProver for generating zero-knowledge validity proofs.
132
131
133
132
- For a given batch, the trusted aggregator earns the POL fees (paid by the trusted sequencer) for providing a validity proof.
134
133
135
-
- In a decentralized setting, an trusted aggregator needs to indicate their intention to validate transactions. And subsequently competes to produce validity proofs based on their own strategy.
134
+
- In a decentralized setting, each trusted aggregator needs to declare its intention to validate transactions, and subsequently compete to produce validity proofs based on its own strategy.
136
135
137
136
## zkNode
138
137
139
-
zkNode is the software needed to run a zkEVM node. It is a client that the network requires to implement the synchronization and govern the roles of the participants (trusted sequencer or trusted aggregator).
138
+
zkNode is the essential software for running a zkEVM node. It is a client that the network requires to implement the synchronization and govern the roles of the participants, including the trusted sequencer and the trusted aggregator.
140
139
141
140
Other than the trusted sequencer and the trusted aggregator, participants in the Polygon zkEVM network can take part as nodes that seek to know the state of the network.
142
141
@@ -170,7 +169,7 @@ Below is a summary of the fee structure for the trusted sequencer and the truste
170
169
171
170
## zkProver
172
171
173
-
zkEVM employs zero-knowledge technology to create validity proofs.
172
+
zkEVM employs zero-knowledge technology to generate validity proofs.
174
173
175
174
It uses a zero-knowledge prover (zkProver), which is intended to run on a server and is being engineered to be compatible with most consumer hardware.
176
175
@@ -198,7 +197,7 @@ It is a combination of two smart contracts, one deployed on one chain and the se
198
197
199
198
The L1 and L2 contracts in zkEVM are identical except for where each is deployed.
200
199
201
-
Bridge L1 contract is on the Ethereum mainnet in order to manage asset transfers between rollups, while bridge L2 contract is on a specific rollup and it is responsible for asset transfers between mainnet and the rollup (or rollups).
200
+
Bridge L1 contract is on the Ethereum mainnet in order to manage asset transfers between rollups, while bridge L2 contract operates in a designated rollup, managing asset transfers between mainnet and the rollup(s).
202
201
203
202
Layer 2 interoperability allows a native mechanism to migrate assets between different L2 networks. This solution is embedded in the bridge smart contract.
204
203
@@ -208,15 +207,15 @@ Verifier is a smart contract which is able to verify any zk-SNARK cryptographic
208
207
209
208
The SNARK verifier proves the validity of every transaction in the batch.
210
209
211
-
It is the key entity in any zk-rollup architecture as it verifies the correctness of each proof, and thus ensuring integrity in state transitions.
210
+
It is the core entity in any zk-rollup architecture as it verifies the correctness of each proof, thus ensuring the integrity of state transitions.
212
211
213
212
The verifier contract is currently deployed on the [Ethereum mainnet](https://etherscan.io/address/0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9) and [Cardona testnet](https://sepolia.etherscan.io/address/0x8EdA1d8c254a77a57A6A7A1C0262e9A44A7C6D6d).
214
213
215
214
## Transaction life cycle
216
215
217
-
Before getting transactions in the L2 flow, users need some funds to perform any L2 transaction.
216
+
Users need funds on L2 to be able to send transactions to the L2 network.
218
217
219
-
To do so, users need to transfer some ether from L1 to L2 through the zkEVM bridge dApp.
218
+
To do so, users need to deposit Ether to L2 through the [Polygon Portal](https://portal.polygon.technology/bridge).
220
219
221
220
- Bridge
222
221
@@ -226,15 +225,15 @@ To do so, users need to transfer some ether from L1 to L2 through the zkEVM brid
226
225
227
226
- L2 transactions
228
227
229
-
- User initiates a transation in a wallet (e.g. MetaMask) and sends it to a trusted sequencer.
228
+
- User initiates a transaction using their wallet (e.g. MetaMask) and sends it to a trusted sequencer.
230
229
231
230
- The transaction gets finalized on L2 once the trusted sequencer commits to adding the transaction to a batch. This is known as the trusted state.
232
231
233
232
- Sequencer sends the batch data to L1 smart contract, enabling any L2 node to synchronize from L1 in a trustless way. This is also known as the virtual state.
234
233
235
-
- Aggregator will take pending transactions, and build a proof.
234
+
- Aggregator takes the pending transactions, and builds a proof.
236
235
237
-
- Once the proof is verified, user's transactions attain L1 finality (important for withdrawal purposes). This is called the consolidated state.
236
+
- Once the proof is verified, the transactions attain L1 finality (important for withdrawal of funds from L2). This is called the consolidated state.
238
237
239
238
The above process is a summarized version of how transactions are processed in Polygon zkEVM.
240
239
@@ -256,7 +255,7 @@ Smart contracts are deployed to ensure that everyone who executes state changes
256
255
257
256
## Efficiency and overall strategy
258
257
259
-
Efficiency is key to network performance. Polygon zkEVM applies several implementation strategies to guarantee efficiency. A few of them are listed below:
258
+
Efficiency is key to network performance. Polygon zkEVM uses several implementation strategies to maximize efficiency. A few are listed below:
260
259
261
260
1. The first strategy is to deploy the consensus contract, which incentivizes the aggregator to participate in the proof generation process.
0 commit comments