Demystifying Layer-2 Blockchains: Optimistic and ZK Roll-ups (Part 3)
This blog posts explains the most popular and most promising of layer-2s: roll-ups, and compares optimistic and zero-knowledge roll-ups.
In a previous blog post, we delved into the differences between layer-1 and layer-2 blockchains and compared various layer-2 scaling solutions, including payment channels and Plasma Chains. In this article, we will shift our focus to roll-ups, a promising and innovative approach to solving the critical scalability challenges faced by blockchain systems.
The Scalability Challenge
The rising popularity of blockchain technology has led to increased demand and adoption, but this very success has exposed a fundamental problem: scalability. As more users and transactions flood the network, the limitations of blockchain systems become evident. To address this issue, various scaling solutions have been proposed, each with its own set of advantages and disadvantages. This article aims to provide an overview of roll-ups, one of the most promising scaling solutions, and discuss their modes of operation, state-of-the-art implementations, features, and limitations.
Roll-Ups in the Ethereum Ecosystem
Roll-ups have gained significant importance in the Ethereum ecosystem. The Ethereum roadmap now heavily emphasizes the integration of multiple roll-ups while other scaling solutions, such as sharding, are put on hold. Ethereum is actively working on a specific roll-up sharing called "Danksharding."
Roll-up Architecture
Roll-ups represent a unique form of layer-2 scaling that doesn't custody any data by themselves. This means that roll-ups do not store any information outside of the base layer-1 chain. In essence, roll-ups offload complex calculations from the Ethereum mainnet and store the results (along with other transactions) in Ethereum after compressing them.
Key components of every roll-up include:
Sequencers: They roll up transactions to the layer-1 chain. It's essential to bundle transactions to save on gas fees, and sequencers play a crucial role in this process.
Veryfiers: Smart contracts that operate on Ethereum and verify the transactions stored by the sequencer. They ensure the correctness of the transactions.
Optymistic Roll up
Optimistic roll-ups operate on the assumption that transactions are valid unless proven otherwise. This approach significantly improves scalability, as no immediate computation is performed for verification. Instead, a contract maintains a history of state root updates and batch hashes. Challenging a batch requires publishing a proof of incorrect computations, known as fraud proofs, on-chain. The contract then verifies these proofs and reverts the incorrect batch and subsequent batches.
Zero-knowlege Roll up
In contrast to optimistic roll-ups, zero-knowledge roll-ups scrutinize every transaction. Each batch includes cryptographic proofs, called validity proofs, which verify that the new state root matches the output of executing the batch of transactions. These proofs are constructed using advanced cryptographic techniques like zk-SNARK and PLONK. While constructing validity proofs is complex, their on-chain verification is relatively quick.
Risks
Two significant challenges associated with roll-ups are:
Finality: The time required to ensure that transactions from roll-ups settle on the layer-1 blockchains.
Miner Extractable Value (MEV): While it's not currently possible, once sequencers become decentralized, MEV auctions may become a concern. Work is already underway to address this issue.
MEV in L2s
·In the rapidly evolving world of blockchain and cryptocurrencies, few concepts have captured the imagination of researchers and enthusiasts quite like Maximum Extractable Value (MEV). MEV represents the hidden potential within every block, an opportunity for validators to reorder transactions to their advantage, often at the expense of other participant…
For a comprehensive risk analysis of roll-ups, you can refer to L2beat.
Conclusions
The future of blockchain transactions is likely to take place on roll-ups (L2s on Ethereum) rather than the base layer-1 Ethereum mainnet. Additionally, the emergence of L3s on roll-ups is expected. This shift has the potential to replace private blockchains as permissioned L2s or L3s offer all the advantages of private blockchains without the disadvantages, such as the need to maintain nodes. Lastly, roll-ups are not limited to Ethereum and are poised to bring DeFi to Bitcoin.