Polygon zkEVM: A Deep Dive

Polygon's zkEVM is a scalable and efficient version of Ethereum's virtual machine using zero-knowledge proofs.

In recent years, the blockchain industry has seen tremendous growth, with Ethereum being one of the most prominent players in the game.

With the increasing popularity of decentralized applications (dApps), the demand for fast, efficient, and secure transactions has skyrocketed. This has led to the need for scalability solutions for the Ethereum network.

Enter Polygon zkEVM, a decentralized Ethereum Layer 2 scalability solution that offers quick finality to off-chain transaction computation.

What is Polygon zkEVM?

Polygon zkEVM is a zero-knowledge (zk) rollup solution that enables the Ethereum network to scale while maintaining the security and decentralization of the underlying blockchain.

The solution uses cryptographic zero-knowledge proofs to offer validity and quick finality to off-chain transaction computation, thus solving the scalability issues faced by the Ethereum network.

In simpler terms, Polygon zkEVM is a layer 2 scaling solution for Ethereum that enables fast and secure off-chain transactions.

Architecture of Polygon zkEVM

polygon zkEVM Architecture
image Source: Polygon zkEVM

Polygon zkEVM has four pillars that make up its architecture:

  1. zkNode
  2. Consensus Contract (PolygonZkEVM.sol)
  3. zkProver
  4. LX-to-LY Bridge

Let’s take a closer look at each of these pillars.

zkNode

The zkNode is a client that enables the synchronization of sequencers or aggregators. It has three components – Synchronizer, Sequencer, and Aggregator.

The Synchronizer is responsible for getting all the data posted by the Sequencer and Aggregator. The Sequencer runs a zkEVM node in Sequencer mode and is responsible for ordering the transactions, generating batches, and submitting them to the Consensus Contract’s storage slots in the form of sequences.

The Sequencer is either Trusted or Permissionless and receives L2 transactions and fees from users. It has a transaction pool with a sorting algorithm to choose the most profitable transactions. A fee in MATIC is paid by the Sequencer for publishing a series of transactions.

The Aggregator takes the L2 batches committed by the Sequencer, sends them to the Prover, and generates ZK proofs attesting to the batch’s integrity. ZK proofs are generated by the Aggregator using a special off-chain EVM interpreter.

The MATIC fee paid by the Sequencer is given to the Aggregator. The more the demand, the higher the MATIC cost, incentivizing the Aggregators to generate verifiable proofs.

Consensus Contract (PolygonZkEVM.sol)

The Consensus Contract is a smart contract that takes sequencer batches and stores them in the PolygonZkEVM.sol contract, creating a repo of sequences.

It enables the Aggregator to publicly verify transitions from one L2 state root to the next. Verification is required before committing new L2 state roots to the Consensus Contract.

A verified proof is a piece of irrefutable evidence that a given sequence of batches led to a specific L2 state.

zkProver

zk Prover
image source: Polygon zkProver

The Polygon zkProver is the true game changer that sets Polygon zkEVM apart from other rollups. It is powered by Hermez Network.

It performs complex mathematical computations to create verifiable proofs of transactions. These proofs are essential for ensuring the validity and integrity of the transactions in the L2 ecosystem of Polygon.

The zkProver is responsible for performing the required computations and generating the proofs, which are later verified on a smart contract.

LX-to-LY Bridge

The LX-to-LY Bridge is a crucial component of the Polygon zkEVM infrastructure, which enables users to transfer their assets between two layers of the Ethereum blockchain – the Ethereum mainnet (L1) and the Layer 2 scalability solution (L2).

The LX-to-LY Bridge is implemented as a smart contract and operates in a decentralized manner, providing a secure and trustless way for users to move their assets between the two layers.

The LX-to-LY Bridge consists of two components – the Bridge L1 Contract, which is deployed on the Ethereum mainnet, and the Bridge L2 Contract, which is deployed on the specific L2 scalability solution (such as Polygon zkEVM).

The Bridge L1 Contract is responsible for managing asset transfers between the Ethereum mainnet and the L2 scalability solutions, while the Bridge L2 Contract is responsible for managing asset transfers between the Ethereum mainnet and the L2 scalability solutions.

What is zk Assembly?

Polygon zkASM
Source: Polygon zkASM

zkASM, or Zero-Knowledge Assembly, is a specialized assembly language designed specifically for the efficient execution of smart contract code in a zero-knowledge setting.

It is a key component of the zkEVM (Zero-Knowledge Ethereum Virtual Machine), which is used in the Polygon network to increase scalability and efficiency.

zkASM is designed to minimize the size of zero-knowledge proofs and reduce the time and computational resources needed to generate them. It does this by reducing the number of operations required to execute smart contract code and by using highly optimized algorithms for generating zero-knowledge proofs.

The basic idea behind zkASM is to translate high-level smart contract code into a lower-level representation that can be executed more efficiently in a zero-knowledge setting. This lower-level code, or assembly code, is then executed by the zkProver.

Efficiency of Polygon zkEVM

Efficiency plays a vital role in network performance, and zkEVM implements various strategies to achieve it. Some of the key strategies include:

  1. Implementing PoE (Proof of Efficiency), which incentivizes the most efficient aggregators to participate in a proof generation.
  2. Performing all computations off-chain while maintaining only the essential data and zk-proofs on-chain.
  3. Designing the bridge smart contract in a UTXO (Unspent Transaction Output) manner, settling accounts only using Exit Tree Roots.
  4. Utilizing specialized cryptography in the zkProver to speed up computations and minimize proof sizes. For example:
  • Using zkASM (a zero-knowledge Assembly language) to interpret byte codes.
  • Employing zero-knowledge tools like zk-STARKs for proof purposes, although these proofs are fast, they are larger in size.
  1. Using zk-SNARKs to attest to the correctness of zk-STARK proofs, instead of publishing the larger zk-STARK proofs as validity proofs. These zk-SNARKs are then published as validity proofs for state changes, reducing gas costs.

Benefits of Using Polygon ZkEVM

  1. Scalability: Polygon ZkEVM offers scalability solutions to the Ethereum network by offloading a portion of the computation to a layer 2 platform, allowing for faster and more efficient processing of transactions.
  2. Cost-Efficiency: By moving some of the transactions off the main chain, the cost of conducting transactions on the Ethereum network is reduced, making it more affordable for users.
  3. Security: Polygon ZkEVM uses cryptographic zero-knowledge proofs to ensure the validity and quick finality of off-chain transaction computation. This adds an additional layer of security to the platform, making it more robust and resistant to attacks.
  4. Decentralization: The decentralized nature of Polygon ZkEVM allows for a more equal distribution of power and control, as opposed to a centralized platform where a single entity has complete control.

What are zk-Rollups?

Zk-rollups are a type of layer-2 scaling solution for blockchain networks. They use zero-knowledge proof (zk-proofs) to efficiently and securely batch-process transactions off-chain.

Transactions are grouped and verified by a smart contract known as the “rollup operator.” The smart contract then compacts all of the verified transactions into a single transaction, or “rollup,” which is committed to the main blockchain.

This reduces the number of transactions that need to be processed on the main chain. This results in higher throughput and reduced costs compared to processing all transactions directly on the main chain.

The use of zk-proofs provides security guarantees that the rollup operator cannot alter transaction data or steal funds. The proof ensures that the transactions within the rollup are valid.

Zk-rollups are a more scalable and efficient alternative to traditional on-chain transactions

Must Read: Top zk-rollup Projects in 2023

Conclusion

In conclusion, Polygon ZkEVM represents a significant advancement in the field of Ethereum scalability solutions.

By utilizing cryptographic zero-knowledge proofs, Polygon ZkEVM provides a scalable, cost-efficient, secure, and decentralized platform for conducting transactions on the Ethereum network.

The successful implementation of this platform will have a significant impact on the overall success and adoption of the Ethereum network.

Amit Chahar

Amit Chahar

Hey! I am Amit Chahar, a Crypto and blockchain content creator at Wallet Reviewer. With 3+ years of experience as a SEO content writer, I love talking about blockchain technology, digital assets, DeFi, Smart Contracts, DApps, Digital Wallets, Metaverse, and NFTs.

Want to hire me? Contact: thecrypticera18@gmail.com

Articles: 273