ZK Rollups – A Solution to Ethereum’s Inefficiencies
Key Questions Answered
Due to its huge popularity and the fact that it hosts the largest number of decentralized apps (DApps) of all blockchains, Ethereum (ETH) has struggled with network congestion. The massive load on the network has led to high fees, slow transactions, and limited scalability.
One of the solutions to these problems has been Layer 2 (L2) protocols, which are platforms that run on top of the underlying blockchain. Zero knowledge rollups are one type of L2 solution designed to achieve superior transaction speeds and low costs.
What Is Layer 2 on Ethereum?
Ethereum has always had a maximum throughput limitation of around 15 to 20 transactions per second (TPS). This is largely due to the platform’s laborious, energy-intensive Proof of Work (PoW) block validation method.
L2 solutions represent a way to address these inefficiencies. L2 refers to protocols built on top of the underlying Ethereum blockchain, which itself is referred to as Layer 1 (L1). This allows the combination of on-chain and off-chain data processing. The combined processing helps achieve improvements in speed, fees, and scalability that the underlying L1 Ethereum blockchain is incapable of on its own.
Layer 2 solutions are built on top of the underlying blockchains, which are referred to as Layer 1 (Source: ListedReserve.com)
In addition to layers 1 and 2, Ethereum also has a third layer. L3 on the blockchain refers to the apps comprising the platform’s rich decentralized app (DApp) ecosystem. These apps are built either on L1 directly or utilize L2 solutions. Unlike the L2 protocols, L3 apps do not normally process transactions off-chain and rely on smart contracts on the blockchain.
What Is a Rollup?
There are several different types of L2 solutions, among which rollups are some of the most popular. Rollups are protocols that execute transactions off the blockchain, then roll hundreds of processed transactions into a batch, and post that finalized batch to the underlying L1 blockchain all at once. Off-chain processing and batching allow rollups to achieve superior speeds and fees compared to purely L1 Ethereum-based processing.
There are two main types of rollup solutions – zero-knowledge rollups and optimistic rollups.
Both of them are based on the same process of executing transactions off-chain, then posting them in batches to the underlying blockchain for final data storage. The difference lies mostly in the transaction verification process.
What Is a Zero-Knowledge Rollup?
Zero-knowledge rollup solutions process transactions off-chain and batch them before posting to the underlying blockchain. They also generate a cryptographic validity proof used to verify the authenticity of transaction data.
The validity proof, called SNARK (succinct non-interactive argument of knowledge), is generated without the need to know all the details of a transaction. Only some key details of a transaction are required to verify it in a zero-knowledge rollup.
This concept of verifying a transaction without knowing all the sensitive transaction details is why this type of rollup is called “zero-knowledge.”
What Is an Optimistic Rollup?
Unlike zero-knowledge rollups, optimistic rollups do not generate a validity proof to authenticate transaction data posted to the L1 blockchain. Optimistic rollups post the processed transactions to the blockchain without proof, but there is a certain waiting period of time during which a transaction may be disputed by network participants.
If any network user posts valid proof that a transaction in the rollup is fraudulent, the transaction in question gets rejected. If no such proof is produced during the waiting period, the transaction is assumed to be valid and is written to the ledger.
Optimistic rollups are based on the presumption that transactions are valid unless a network user challenges the presumption (Source: Ethereum.org)
This initial presumption of transaction validity without proof is the reason why these rollups are called “optimistic.” Among the variety of optimistic rollup solutions, the two most prominent ones are Arbitrum and Optimism crypto platforms.
Zero-Knowledge vs. Optimistic Rollups: What are The Differences?
The key advantage of zero-knowledge rollups over optimistic ones is the speed of on-chain processing. Since there is no waiting time for zero-knowledge rollups during which the authenticity of a transaction may be challenged, they are posted to the underlying blockchain ledger faster than optimistic rollup transactions.
However, the cryptographic validity proofs used by zero-knowledge rollups rely on significant hash power to compute. Therefore, programs that have limited on-chain activity may find it more beneficial to use optimistic rollup solutions.
Optimistic rollups also currently enjoy greater scalability thanks to the absence of the validity proof computation. A big spike in transactions is unlikely to affect an app utilizing optimistic rollups, but may significantly slow down a zero-knowledge rollup solution.
A further difference between the two rollup types lies in their interactions with the smart contracts on the blockchain. Optimistic rollup solutions are capable of directly executing the smart contracts on the L1 platform, while zero-knowledge rollups are not.
What Are the Examples of Zero-Knowledge Rollup Solutions?
Hermez (now Polygon Hermez)
Hermez is an L2 platform that uses zero-knowledge rollups to provide faster and cheaper peer-to-peer (P2P) payment solutions to individuals and companies. The project launched its mainnet in March. Within half a year, it triggered the interest of Polygon, a leading L2 solutions provider.
In early August, Polygon acquired Hermez for $250 million and rolled its brand under a unified Polygon Hermez branding. Hermez continues to operate its own network, but this may change in the future as the acquisition deal leads to possible technical setup changes.
The essence of Hermez’s solution is its auction that selects the coordinator nodes for processing transactions. To become a coordinator, you need to bid using the platform’s HEZ cryptocurrency. A portion of your bid goes to various social services run on Ethereum.
Hermez calls this bidding process proof-of-donation. While currently all the bidding is done using HEZ, the platform may change to Polygon’s MATIC coin in light of the acquisition deal.
Starkware is a company that offers two primary zero-knowledge rollup solutions – StarkNet and StarkEx.
StarkNet is a platform for developing highly scalable decentralized apps (DApps). Its main target is app developers looking for solutions with a very high degree of scalability, a feature that would be impossible to achieve on L1 Ethereum alone. Starkware promotes StarkNet as an “unlimited scalability” solution.
StarkNet has just launched on the mainnet, and some features are still in the development stage. The company plans to finalize the entire feature set in the next few months.
Another product from Starkware is StarkEx, a scalable SaaS L2 solution mainly targeted at developers of decentralized finance (DeFi) and NFT apps. Some of the apps using StarkEx include DeFi exchanges such as DeversiFi and dYdX, and NFT platforms such as Immutable and Sorare.
DeFi and NFT project developers can try out StarkEx’s capabilities using a test environment called StarkEx Playground before deciding on their commitment to the platform.
Loopring is an L2 zero-knowledge rollup solution aimed at operators of decentralized exchanges (DeXs) and other payment apps. The platform claims that it is capable of achieving transaction processing speeds which are around 1,000 times faster and fees that are 100 times cheaper than on Ethereum.
Loopring was initiated in 2017, and launched on the mainnet in late 2019. Recently, there has been some industry speculation about a potential merger between Loopring and an NFT platform GameStop. If the speculation materializes, Loopring might add a focus on NFT projects.
Ethereum’s inherent speed and cost inefficiencies gave rise to L2 solutions, protocols built on top of the underlying blockchain which improve speed, cost, and scalability. Some of the most popular L2 solutions are rollups, which execute transactions off-chain and transfer processed transactions to Ethereum for storage.
Rollups come in two main varieties – zero-knowledge rollups and optimistic rollups. Zero-knowledge rollups process transactions off-chain in batches and generate cryptographic validity proofs to verify the authenticity of the transactions within each batch. The validity proof is used to add batch transactions to the layer one blockchain.
Optimistic rollups do not generate validity proofs. Instead, transaction batches are posted to the blockchain and are added to the ledger after a waiting period. During the waiting period, if any network user proves the presence of fraud in any transaction, the transaction gets rejected.
Zero-knowledge rollups have the advantage of no waiting period but require greater computation power. Unlike optimistic rollups, zero-knowledge rollups can’t directly execute smart contracts on the underlying blockchain.