paint-brush
The Rise of Zero-Knowledge Rollups in Ethereum Scalingby@mariefromdcenter
836 reads
836 reads

The Rise of Zero-Knowledge Rollups in Ethereum Scaling

by Marie PoteriaievaNovember 14th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Zero-knowledge rollups are gaining momentum as the ultimate Ethereum scaling solution. They allow to outsource computation, all while leveraging the main chain’s decentralization and security. Unlike their closest competitor, optimistic rollups, zk rollups offer quicker transaction finality time and better user privacy.

People Mentioned

Mention Thumbnail
featured image - The Rise of Zero-Knowledge Rollups in Ethereum Scaling
Marie Poteriaieva HackerNoon profile picture

Zero-knowledge rollups are gaining momentum as the ultimate Ethereum scaling solution.

This year alone, no less than four major projects based on ZK rollups were launched, and four more are in the works. The technology has proven to be exceptionally fitting for the crypto space, and given the growing enthusiasm from venture capitalists, the ZK trend is here to stay.


This is a comprehensive overview of the current zk rollup landscape and its most prominent projects: zkSync, Starknet, Polygon zkEVM, Linea, and Scroll.


But first: What are zk rollups, and why is everyone so excited about them?

What are ZK rollups?

The ZK FOMO has a good reason behind it.


This method allows executing smart contract computations off the blockchain, rolling them up in batches, and then submitting these batches back to the main chain using zero-knowledge proofs to show that the computations happened within the rules of the EVM. Simply put, zk-rollups allow to outsource computation, all while leveraging the main chain’s decentralization and security.


Unlike their closest competitor, optimistic rollups, zk rollups offer quicker transaction finality time and better user privacy. Optimistic roll-ups take an “optimistic” stance, assuming that all layer-2 transactions are valid unless proven otherwise by an honest network validator. If the optimistic rollup batch faces no challenges during the dispute period, the transaction data is successfully added to the Ethereum main chain.


In contrast, ZK rollups count on cryptography: after all, math is always more reliable than humans. However, this comes with its own set of complications, such as high computation costs, as well as a more complex cryptographic and engineering network. Fortunately, the former can be solved with special hardware, such as FPGA or ASIC, and the latter – with quality engineering education, like the one provided by RareSkills.


Yet, there is another hurdle associated with ZK rollups.

EVM-compatibility vs performance

Ethereum was not designed to be ZK-friendly, and there are many parts of its protocol that take a large amount of computation to generate validity proofs. This means that building a functional zkEVM – a replica of the Ethereum Virtual Machine that uses zk-rollups – implies a major trade-off: EVM compatibility vs performance. There is a balance between these two qualities, and different zk rollup-based projects are trying different ways to find the perfect one.


Vitalik Buterin formulated this dichotomy in 2022, drafting a chart with five types of protocols using zk-proofs, from the most compatible to the most performant.

source: vitalik.ca


Each approach has its pros and cons, and several major projects are exploring them now.

zkSync Era

According to Vitalik’s framework, this protocol corresponds to Type 4: high-language-equivalent.

Developed by Matter Labs, zkSync Era went live in March 2023. Its current TPS (transaction per second) stands at 4.75, down from this summer’s 9.9. However, according to the protocol’s documentation, it can offer up to 2,000 TPS at peak load.


ZkSync uses its LLVM compiler to translate code from Solidity, Vyper, and Yul. A compiler adds a step in the coding process and increases the risks of bugs, but in exchange for this inconvenience, zkSync offers other perks. Not only does its custom VM generate zk-proofs fast, but it also implements native account abstraction, which allows programmable authorizations, enabling a greater diversity of wallet and protocol design.


ZkSync is among the most developed projects, coming with a Hardhat plugin, Web3 API parity, and a well-functioning L2-L1 messaging infrastructure.


The most popular zk rollup, zkZync Era, processes 22 million monthly transactions (source: L2Beat), ranking second only to Polygon PoS with its 75 million monthly transactions.


Starknet

Starknet is a zk-rollup using a slightly different version of the cryptographic proof system. Unlike other popular protocols built on zk-SNARKs (zero-knowledge succinct non-interactive argument of knowledge), it uses zk-STARKS (zero-knowledge scalable transparent argument of knowledge). The main difference between the two is that the former uses elliptic curve pairings, while the latter relies on transparent post-quantum algebraic proofs, which generally makes zk-STARKs more efficient but also more computationally demanding. Zk-SNARKS are also being criticized for the trusted setup they require for the initial creation of keys. If the secret used to create the keys is not destroyed, this may introduce a security threat.


ZK-STARKs were discovered several years after ak-SNARKs, which were already used in the Zcash protocol. Hence, zk-SNARKs are considered more developed as a technology, with extensive developer libraries and numerous projects working on them. Starknet is a notable exception, adopting STARKs as a base for its protocol. The project also puts emphasis on Layer-3 development, providing a set of tools that can help build customizable “App Chains.”

Starknet Alpha went live in November 2022 and has since developed an important ecosystem, handling 13 million monthly transactions.


With Warp, a compiler from Solidity to its language Cairo, Starknet can also be considered as a Type 4 zkEVM.

Polygon zkEVM

The famous Ethereum sidechain joined the zk race by releasing in March its own version of zkEVM as a separate blockchain (so far in Beta). It will be a part of Polygon 2.0, an ambitious vision of a network of zk-powered layer-2 chains unified via a novel cross-chain protocol.


ZkProver, Polygon zkEVM’s main component, follows the state machine model, which uses both STARK and SNARK methods. STARK is used to prove the transactions, and then a SNARK circuit is used to verify it, de facto submitting to Ethereum a proof of a proof. To achieve full compatibility, the Polygon team has come up with the concept of micro opcodes, or instructions that EVM will use to manipulate inputs.


Currently, Polygon zkEVM is a Type 3 (almost EVM-equivalent), which will turn into Type 2 (fully EVM-equivalent) when all pre-compiled contracts are supported. It processes 1.1 million monthly transactions.

Linea

This zk-proof solution was developed by none other than Consensys, the Godfather of all things Ethereum. Released in March 2023, Linea (Type 3 aiming for Type 2) strikes its own balance of speed and EVM compatibility.


Linea uses lattice-based cryptography, known to be quantum-resistant, to efficiently generate zero-knowledge proofs, making for a faster prover time.


Linea aims for a full equivalence with Ethereum. It is able to execute an unaltered, native bytecode in accordance with the EVM specifications, thus reducing the risk of bugs and hacks. Developers can deploy and verify any smart contract with Truffle, Hardhat, or Foundry exactly as if they were building on Layer 1. Linea’s developer-friendliness is enhanced by the native integrations of Consensys tools, such as MetaMask and Infura.


With Alpha mainnet launched in August, Linea now handles 3.5 million monthly transactions.

Scroll

The most recent protocol to go live, Scroll, launched its mainnet in October 2023.

The project aims at fully mapping the Ethereum opcode to the zkEVM, which would allow Ethereum native smart contracts to be fully executed without modifying the bytecode. Currently, Scroll is still a Type 3 but aims to become Type 2.


Launched with a centralized sequencer and a centralized central approver, Scroll intends to decentralize over time.


Several other projects based on zk-proof are still in the works. This includes Taiko, a rare Type 1 (fully Ethereum-equivalent) rollup, as well as projects based on the Polygon’s codebase, such as Immutable zkEVM, Canto, and Astar zkEVM.