Polygon zkEVM at a glance
Polygon zkEVM is a Layer 2 (L2) scaling solutions for Layer 1 (L1) Ethereum.
Polygon zkEVM has the advantages of high transations per second (TPS), low gas fees, while benefits from Ethereum’s underlying security.
zkEVM Node:
zkEVM Node (zkNode) is the software required to run Polygon zkEVM.
The components of zkNode:
Sequencer: generates the batched transactions
Synchronizer: fetch data from L1 Ethereum
Aggregator: produce zk proof of the batched transactions
Prover: cryptographic tool that is capable of producing zk proof
State: database for storing state data
Pool: database for storage of submitted transactions
Polygon zkEVM transaction steps:
- Submitting Transactions
It means sending blockchain transactions to Polygon zkEVM network, such as via the Metamask wallet.
2. Executing Transactions
After clicking the confirm button in Metamask, the transaction is sent to pending transaction pool. zkEVM sequencer picks it up, execute it. If execution is successful (sequencer checks transactions for validity, such as if sender has enough funds, smart contract method exists, etc), transaction is broadcast to zkevm nodes.
3. Batching Transactions
The Polygon zkEVM sequencer serializes and concatenates the transactions into a batch, and sends it to Polygon zkEVM smart contract that is in Ethereum L1.
The diagram below illustrates the serialization and concatenation of multiple transactions into a batch of transaction.
4. Sequencing Batches of Transactions
Polygon zkEVM sequencer calls Polygon zkEVM smart contract (in Ethereum L1).
Behind the scenes, the sequenceBatches method of Polygon zkEVM smart contract is called and L1 Ethereum is made aware of the transactions in L2.
5. Aggregating Batches of Transactions
The purpose of this step is to prove that the transactions are valid. Polygon zkEVM aggregator will generate a proof, and Polygon zkEVM smart contract will verify the proof as valid or not.
The diagram below shows the zk proof generation overview in Polygon zkEVM node. Basically, the main state machine recursively generates STARK proof. The STARK proof are proved with a SNARK proof. The last SNARK proof is the zk validity proof.
After proof is generated, the aggregator sends the zk proof to Polygon zkEVM smart contract.
After proof is received, the Polygon zkEVM smart contract verifyBatches method is called to verify the proof.
Conclusion:
Polygon zkEVM L2 has the advantages of high TPS and low gas fees. It sends zk proof to the Ethereum L1. After zk proof is verified, the L2 transactions are recorded in Ethereum L1.
In this way, Polygon zkEVM benefits from the underlying security of Ethereum L1, without incurring the high gas fees of Ethereum L1.