🔍 A Comprehensive Guide to Layer 2 Solutions: ZK-Rollups and Optimistic Rollups

Ali
ChainIDE
Published in
6 min readApr 22, 2023

--

Layer 2 scaling solutions are being developed to overcome the limitations of the Ethereum network, mainly high fees, and slow transaction processing. Rollups are the most promising and widely adopted Layer 2 scaling solutions for Ethereum. Rollups aggregate multiple transactions into one batch, reducing the transaction fees and increasing the network throughput. Rollups come in two different types, ZK-Rollups, and Optimistic Rollups. In this article, we will dive into the technical details and differences between ZK-Rollups and Optimistic Rollups.

đź’­ What are Rollups?

Rollups are Ethereum Layer 2 scaling solutions that bundle multiple transactions together into a single batch, reducing transaction fees and increasing the network throughput. Rollups aim to overcome Ethereum’s network limitations by executing complex operations off-chain while maintaining on-chain security. Rollups can be classified into two types, ZK-Rollups, and Optimistic Rollups, based on the way they achieve scalability.

đź’ˇ What are ZK-Rollups?

ZK-Rollups rely on Validity Proofs to achieve scalability. Validity Proofs ensure that a new state is presented to the blockchain only if it is valid. In other words, the data is always correct and verified. ZK-Rollups provide a higher degree of security compared to Optimistic Rollups because they do not rely on the assumption that the proposed state is valid. Instead, the proposed state is always accompanied by Validity Proof, which ensures that the state is valid.

👉 Example: dYdX is a ZK-Rollup solution built on StarkEx. dYdX uses ZK-SNARKs, a type of Zero-Knowledge Proof, to bundle multiple transactions into a single batch, reducing gas fees.

đź’ˇ What are Optimistic Rollups?

Optimistic Rollups rely on Fraud Proofs to achieve scalability. A new state is assumed to be valid unless proof is submitted to the blockchain within a specific timeframe (challenge window). If the state is fraudulent, anyone can submit proof to challenge the proposed state. Optimistic Rollups assume that most transactions are valid and that it is unlikely that someone will try to cheat the system. Optimistic Rollups provide a better user experience by reducing the latency compared to ZK-Rollups.

👉 Example: Arbitrum One is an Optimistic Rollup solution that focuses on decentralized finance (DeFi) and Non-Fungible Token (NFT) projects. Arbitrum Nitro is the upgraded version of Arbitrum One and enables higher throughput and lower fees. Arbitrum Nova, on the other hand, has lower transaction fees than Arbitrum One.

🎨 Arbitrum One, Nova, and Nitro — What is the difference between Arbitrum One and Arbitrum Nova?

Arbitrum is a Layer 2 scaling solution that uses Rollup technology. The Arbitrum One stack is focused on decentralized finance and NFT projects, while Nitro is designed for social and gaming use cases. Arbitrum Nova provides a lower transaction fee than Arbitrum One. The main difference between the One/Nitro and Nova rolls up is their data availability approach. While One/Nitro stores data on the Ethereum mainnet in the form of Calldata, Nova stores data on the off-chain Data Availability Committee. DAC is a group of trusted validators that signs and returns a certificate to the sequencer, indicating that they have received and verified the data. If the sequencer does not collect enough proofs, Nova will fall back to the Rollup mode (releasing data to the main network in the form of Calldata). Nova’s sequencer sends the complete data set to all DAC committee members at the same time, and the committee signs and returns the signed certificate to the sequencer, and the sequencer collects enough certificates to aggregate them and create a valid data availability certificate (DACert).

1. How Ethereum Scales with Nitro (https://soliditydeveloper.com/arbitrum-nitro)

👉 ZkSync Era: ZkSync Era is a platform created by Matter Labs that uses a technology called zk-rollup to improve Ethereum’s scalability. It is designed to work with Ethereum Virtual Machine (EVM) and implements a standard Web3 API, which allows developers to write smart contracts in a familiar environment. The platform introduces some new concepts, such as native account abstraction, while preserving key EVM features like smart contract composability.

👉 StarkNet: StarkNet is a decentralized ZK-Rollup that also aims to improve Ethereum’s scalability. It allows developers to deploy their smart contracts independently and is built using the STARK cryptographic proof system. StarkNet uses the Cairo programming language for its infrastructure and for writing StarkNet contracts. It also has a messaging infrastructure that allows communication between Layer 1 and Layer 2 networks. Currently, it is launched with a single Sequencer.

👉 Boba Network: Boba Network is a solution built by the Enya team to augment and scale Ethereum. It uses a technology called Optimistic Rollup and is EVM-compatible. It has two notable features: a fast withdrawal facility that allows users to remove funds immediately without waiting for the end of the 7-day fraud-proof window, and Hybrid Compute technology that enables Ethereum developers to build dApps that trigger code executed on web-scale infrastructure. Boba Network operates on multiple Layer 1 blockchain.

đź’° Layer 2 for DeFi

dYdX and StarkWare have built a Layer 2 protocol for cross-margined perpetuals called Perpetuals. Traders can expect lower gas costs, and in turn, much lower trading fees and minimum trade sizes in a fully non-custodial protocol. Trades are settled on a Layer 2 system that publishes Zero-Knowledge Proofs periodically to an Ethereum smart contract in order to prove that state transitions within Layer 2 are valid.

Immutable X and Sorare are Layer 2 protocols that have been designed specifically for NFTs. Sorare uses ZK-rollup technology to reduce the friction that comes with Ethereum gas fees.

👉 Polygon ZkEVM

Polygon ZkEVM Beta aims to reduce transaction costs and increase throughput by harnessing the power of ZK proofs while inheriting the security of Ethereum L1.

👉 Scroll

Scroll is a new Layer-2 solution aiming to provide unlimited scalability, lightning-fast confirmation latency, full decentralization, and trustless privacy. It does so by building upon zk-Rollup and high-performance off-chain distributed systems, with several key improvements.

🚀 Conclusion

Layer 2 scaling solutions have emerged as the most promising approach to improve Ethereum’s performance and scalability capabilities. Each approach works differently, but all have the potential to make significant improvements to the Ethereum network. As the Ethereum ecosystem continues to mature, we will see more innovative approaches to scaling solutions.

đź”—References

  1. L2BEAT: A website dedicated to analytics and research on Ethereum Layer2 scaling solutions. Retrieved from https://l2beat.com/scaling/tvl.
    2. Buterin, V. (2021, January 5). An Incomplete Guide to Layer 2 Solutions. Retrieved from https://vitalik.ca/general/2021/01/05/rollup.html.
    3. Foresight News. (n.d.). Explanation of Arbitrum One, Nova, and Nitro. Retrieved from https://foresightnews.pro/article/detail/13471.
    4. Optimism. (n.d.). Roll-up Protocol: Optimism. Retrieved from https://community.optimism.io/docs/protocol/2-rollup-protocol/#.
    5. dYdX. (n.d.). What is Layer 2? Retrieved from https://help.dydx.exchange/en/articles/4797156-what-is-layer-2.
    6. Sorare. (n.d.). We’re Live on Our Scaling Solution, Starkware. Retrieved from https://medium.com/sorare/were-live-on-our-scaling-solution-starkware-62438abee9a8.
    7. Polygon. (n.d.). Polygon ZK-EVM. Retrieved from https://polygon.technology/polygon-zkevm.
    8. Scroll. (n.d.). Scroll: A Layer 2 Ecosystem Based on zk-rollup. Retrieved from https://scroll-zkp.medium.com/scroll-a-layer-2-ecosystem-based-on-zk-rollup-186ff0d764c.
    9. Zhang, Y. (n.d.). Scroll — A Layer 2 Ecosystem Based on zk-rollup. Retrieved from https://hackmd.io/@yezhang/S1sJ2cEWY.

đź”—Contact us

Should there be any questions, please reach us at the below-given links. Thanks.
Twitter | Telegram | Discord | YouTube

--

--

Ali
ChainIDE

Ali Arshad, student of computer science, interested in blockchain.