Exploring Rollups, zk-Proofs, and the Path to Ethereum's Scalable, Sustainable Future.
This post is taking part in the Lens x Kiwi Writing Contest.
Understanding Blockchain Layers
In the blockchain world, several layers are defined to optimize scalability and functionality, each serving a unique purpose. You may have encountered terms like “Layer 1s (L1)”, “Layer 2s (L2)”, and “Rollups”. To fully grasp the role of Layer 2 solutions, it’s important to first distinguish between these layers and their respective functions.
In this case, Ethereum will be our primary focus, as it serves as the foundation for many L2 solutions. We will also explore how Ethereum L2 networks, such as zkSync, aim to improve scalability while maintaining decentralization and security.
Layer 1: The Foundation of Blockchain
A Layer 1 (L1) blockchain refers to the base layer of a blockchain ecosystem. These handle the critical task of maintaining consensus among the network’s nodes, with the core functionality operating without any additional plugins. L1s are commonly referred to as the “settlement layer” because it is the layer of a blockchain ecosystem that all plugins, layers and additional components write back to.
- Layer 1 (L1): The base blockchain network that handles the core operations, including transaction processing and network security. Examples: Bitcoin, Ethereum, and Solana.
Layer 2: Enhancing Ethereum’s Capabilities
A Layer 2 (L2) solution is any application or protocol built on top of a Layer 1 blockchain, like Ethereum. While L2s interact with the base layer, they operate as separate entities, processing transactions independently before syncing with the main chain. This distinguishes L2s from decentralized applications (DApps), which are directly deployed and operate on the base layer itself.
- Layer 2 (L2): Technologies built on top of a Layer 1 (L1) to improve scalability and efficiency by processing transactions off the main blockchain. Examples: zkSync, Optimism, Arbitrum, etc.
- DApp (Decentralized Application): A DApp is an application that operates on a decentralized network or blockchain, powered by smart contracts, and functions without a central authority. DApps can be used for various purposes, including finance and gaming. Example: Uniswap, a decentralized finance application deployed on Ethereum’s Blockchain.
L2s aim to address the scalability limitations of Ethereum by reducing network congestion and lowering gas fees. They achieve this by processing transactions off-chain and then submitting a compressed batch of transactions to the L1 for final settlement.
There are several types of L2 solutions. Chainlink (LINK), for instance, is an L2 application that serves as a decentralized oracle network, bringing off-chain data onto the blockchain while maintaining decentralization. Another example is The Graph (GRT), an event-indexing network that allows applications to efficiently access and query on-chain data.
Read more about how L2 solutions, such as decentralized oracle networks, address the major challenge blockchains face known as "The Oracle Problem" here.
Among the various L2 solutions, Rollups are the most prominent. Rollups enhance Ethereum’s transaction throughput by processing transactions off-chain and then settling them on-chain, all without compromising the network's security or decentralization.
Rollups: The Backbone of Layer 2 Scaling
Rollups are at the forefront of L2 scaling solutions. They work by bundling multiple transactions together and submitting them as a single batch to Ethereum. By doing so, Rollups dramatically reduce gas costs, as the transaction fees are shared among all users involved in the batch.
As previously mentioned, blockchains face several significant challenges. Ethereum, like many other L1s, Ethereum struggles with the “The Blockchain Trilemma”, which states that a blockchain can only achieve two out of the three properties; Decentralization, Security, and Scalability. Ethereum sacrifices scalability as it can only process roughly 15 transactions per second. Rollups provide the solution to Ethereum’s “Blockchain Trilemma” by enhancing scalability without compromising the network’s security or decentralization.
- Rollups: Rollups are an L2 Scaling Solution that increases the number of transactions on the L1 chain by “rolling up” multiple transactions into 1 transaction.
There are two main types of Rollups: Optimistic Rollups and Zero-Knowledge (ZK) Rollups. Both aim to boost scalability, but they differ in how they verify the validity of the transactions.
Optimistic Rollups: Efficiency with Fraud Detection
Optimistic Rollups work under the assumption that the off-chain transactions are valid by default.
Under these assumptions, operators propose the valid state of the Rollup chain, and during a “challenge period”, other operators can challenge potentially fraudulent transactions by computing a “fraud proof” to verify transaction validity. This “fraud proof” involves the operator engaging in a “call and response“ interaction with another operator to identify and isolate a specific computational step. This specific computational step is then executed on the L1.
If the result differs from the original blockchain state, it indicates that the transaction was fraudulent. When the “fraud proof” succeeds (i.e. a fraudulent transaction was identified) the Rollup will re-execute the entire batch of transactions correctly, and the operator responsible for including the incorrect transaction will be penalized, usually by losing staked tokens (a.k.a. Slashing).
- Slashing: A mechanism where an operator loses a portion or all of their staked tokens as a penalty for including fraudulent transactions or failing to properly validate transactions. This penalty serves as a deterrent against dishonest behavior and helps maintain the integrity of the network.
This approach minimizes the need for constant verification, allowing Optimistic Rollups to achieve higher transaction throughput. However, they rely on the community’s vigilance to catch potential fraud, which introduces a slight delay due to the challenge period.
- Optimistic Rollups: This type of Rollup assumes off-chain transactions are legitimate. They use fraud proofs to verify legitimacy of transactions in the case of disputes. Examples: Arbitrum, Base and Optimism.
Zero-Knowledge (ZK) Rollups: Instantaneous Validity Proofs
Zero-Knowledge (ZK) Rollups, on the other hand, use validity proofs, known as zk Proofs, to verify transaction batches.
- Zero-Knowledge (ZK) Rollups: This type of Rollup use validity proofs (a.k.a zk Proofs) to verify transaction batches. Examples: zkSync, StarkNet and Scroll.
How zk Proofs Work?
zk Proofs are mathematically complex algorithms designed with three main components:
- Prover: This party is responsible for generating a zk proof to demonstrate that their inputs (e.g., transactions) satisfy a specific mathematical equation.
- Verifier: This is typically a L1 contract that verifies the zk proof to confirm that the result matches the expected output.
- Witness: The witness refers to the solution the prover uses to prove that their inputs satisfy the equation within the zk proof.
This mechanism ensures near-instant verification without requiring a "challenge period," as the validity of the transaction batch is mathematically guaranteed. Additionally, the process does not reveal the underlying data, preserving privacy.
- zk Proofs: A validity / cryptographic proof where one party (the “prover”) can prove to another party (the “verifier”) that they know a certain piece of information (e.g., a solution to a math problem) without revealing the information itself.
ZK Rollups are considered a more advanced scaling solution due to their efficiency and robust security. However, they are computationally complex and can be more difficult to implement compared to Optimistic Rollups.
The Leading zk Proof Technologies
zk Proofs come in various forms, with the two most prominent types being:
- zk-SNARKs: Succinct, non-interactive proofs that are small and fast to verify. Example: zkSync.
- zk-STARKs: Scalable and transparent proofs designed for larger data sets and post-quantum security. Example: StarkNet.
zkSync’s Utilization of zk-SNARKs for L1 Scalability
zkSync utilizes zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) as its primary cryptographic technology.
zk-SNARKs have the following core properties:
- Succinctness: The proofs are small in size, meaning they can be verified quickly, ensuring high scalability.
- Non-Interactivity: They do not require multiple rounds of interaction between the prover and verifier. A single proof is generated and sent to the verifier (such as an L1 contract), ensuring efficiency.
- Privacy & Security: zk-SNARKs enable zkSync to validate transactions without revealing any underlying transaction data, preserving user privacy.
With zkSync 2.0, smart contract support is introduced, and Ethereum compatibility is achieved, allowing developers to build decentralized applications (dApps) using zk-SNARKs for transaction validation and scalability.
StarkNet’s Primary Use of zk-STARKs for L1 Scalability
StarkNet, on the other hand, uses zk-STARKs to achieve scalability.
Here’s how zk-STARKs differ from zk-SNARKs:
- Scalability: zk-STARKs are designed to handle larger datasets more efficiently, making them more suitable for complex applications requiring massive scalability.
- Transparency: Unlike zk-SNARKs, zk-STARKs do not require a trusted setup. This is a crucial feature, as zk-STARKs are more transparent and easier to deploy without relying on any initial trust assumptions.
- Post-Quantum Security: zk-STARKs are resistant to attacks from quantum computers, making them future-proof in terms of security, while zk-SNARKs could be vulnerable to quantum computing advancements.
zkSync vs StarkNet: A Comparison of zk-SNARKs and zk-STARKs
The table below highlights the key differences between zk-SNARKs and zk-STARKs;
zkSync utilizes zk-SNARKs to provide fast, low-cost transactions and scalability on Ethereum with privacy-preserving features. Known for its user-friendly design, zkSync emphasizes wallet integrations, payments, and low-cost Ethereum L2 transactions. With zkSync 2.0, it also supports smart contracts and full Ethereum Virtual Machine (EVM) compatibility, making it a versatile platform for dApp developers.
In contrast, StarkNet employs zk-STARKs, which are engineered for applications that demand high scalability and robust security. StarkNet handles complex dApps and smart contracts with advanced data-processing capabilities, making it suitable for more intensive use cases. Additionally, zk-STARKs provide post-quantum security, enhancing StarkNet's long-term viability.
While both zk-SNARKs and zk-STARKs are part of the broader family of zero-knowledge proofs, they cater to different needs;
- zk-SNARKs (used in zkSync) are optimal for smaller, more efficient proofs with a focus on ease of use and low costs.
- zk-STARKs (used in StarkNet) are designed for large-scale data verification and do not require a trusted setup, making them more secure and transparent.
Both zkSync and StarkNet are key players in the Layer 2 space, but their use of different zk-proof technologies positions them to address distinct aspects of Ethereum’s scaling challenges.
Different Types of zk-Proofs and Their Use Cases
Beyond the most well-known zk-Proofs - zk-SNARKs and zk-STARKs, there are several other types and variations, each of which are tailored to suit different application needs. The table below provides a summary of these different zk-Proofs and their respective use cases;
L2 Rollup Centralized Sequencers: A Centralization Challenge
In blockchain ecosystems, Sequencers play an essential role by determining the order and bundling of transactions. These operators are responsible for managing how transactions are organized and processed. Many L2 Rollup solutions rely on Sequencers that are currently centralized and controlled by a single entity (Centralized Sequencers).
- Centralized Sequencers: In L2 Rollups, a Centralized Sequencer is a single entity or operator responsible for managing and ordering transactions.
There are a number of risks involved when relying on Centralized Sequencers for transaction management;
Censorship and Transaction Manipulation: A key risk with Centralized Sequencers is their ability to selectively block or delay certain transactions. This could prevent users from withdrawing their assets in a timely manner. Furthermore, a Centralized Sequencer has the potential to manipulate transaction ordering for personal benefit, creating an unfair system.
System Downtime: Another concern is that if a Centralized Sequencer experiences technical issues or downtime, it can lead to a complete halt in transaction processing. Until the sequencer resumes operations, no new transactions or withdrawals can be finalized, which could be disruptive to the network.
To address these risks, some projects, like zkSync, are focusing on decentralizing their sequencer infrastructure. By distributing the control among multiple operators, they aim to enhance security and reduce the potential for censorship and manipulation.
The reliance on Centralized Sequencers in L2 Rollups introduces potential risks such as censorship, transaction manipulation, and operational downtime. Decentralization efforts, like those undertaken by zkSync, are vital to ensuring the fairness, security, and resilience of blockchain networks in the future.
L2 Rollup Stages: Vitalik’s Proposed Milestones
A Stage of a Rollup is a categorization based on Vitalik Buterin’s proposed milestones. The idea of this assessment is to evaluate a L2 chain’s maturity based on specific properties to encourage these chains to progress towards a greater decentralized ecosystem, the very core value that blockchain technology aims to fulfill. The L2Beat team leveraged off of Vitalik’s proposed milestones to create this opinionated assessment categorizing these L2 Rollup Solutions into different stages.
Rollup Development Stages
Stage 0: Initial Governance and Transparency
At this initial stage, governance of the rollup is primarily controlled by a combination of operators and a security council. This structure ensures that critical decisions and operations are managed by a trusted group of entities. The rollup's open-source nature allows for state reconstruction from Layer 1 (L1) data, maintaining transparency and ensuring that users can verify the system's integrity. In this stage, users have an exit mechanism that permits them to leave the rollup within a set period, typically seven days, though this often requires action from the operators.
Stage 1: Transition to Smart Contract Governance
During Stage 1, governance begins to transition towards smart contracts, though the security council continues to play a supportive role, particularly in resolving any technical issues or bugs. The proof system becomes fully operational at this stage, enabling the decentralized submission of validity proofs for transactions. Additionally, the exit mechanism is upgraded to allow users to exit the rollup independently, without needing to coordinate with operators.
Stage 2: Achieving Full Decentralization
In the final stage, the rollup reaches complete decentralization. Governance is entirely managed by smart contracts, eliminating the need for operators or a security council in daily operations. The proof system becomes permissionless, and the exit mechanism is fully decentralized, allowing users to manage their exits without central oversight. The role of the security council is limited to addressing any errors that occur on-chain, ensuring that the system operates fairly while minimizing reliance on centralized control.
The table below summarizes the key characteristics and transitions across different stages of rollup development, from initial centralization to full decentralization;
The stages of Rollups provide a valuable framework for evaluating the evolution and decentralization of Layer 2 solutions. Understanding these stages and their requirements is crucial assessing the maturity and potential risks of various Rollups. For insights into the progression of leading L2 projects and their path toward complete decentralization, consider exploring resources from the L2Beat team.
Conclusion
L2 solutions represent a critical step forward in Ethereum's evolution, addressing the “Blockchain Trilemma” of scalability, security, and decentralization. By processing transactions off-chain and settling them on the main Ethereum network, L2s significantly reduce gas fees and increase transaction throughput without compromising the network's fundamental principles. As projects like zkSync and StarkNet continue to develop and refine their technologies, we can expect to see further improvements in efficiency, user experience, and overall ecosystem growth. The ongoing efforts for L2 decentralization and progress through Vitalik's proposed milestones for the different Rollup Stages demonstrates the community's commitment to realizing the full potential of Layer 2 solutions. As these technologies mature and gain wider adoption, they will play an increasingly vital role in shaping Ethereum's scalable and sustainable future, enabling a new era of decentralized applications and services.
Stay tuned for upcoming articles where we’ll work together to Secure the Chain and make Web3 a better space. My goal is to make this technology accessible and understandable, whether you’re interested in Web3 Development, Web3 Security, Investing, or just getting a better sense of how it all works. I hope this article inspires you to explore the complex world of L2 solutions. Don’t miss the chance to participate in StarkNet’s Competitive Audit Currently Live on CodeHawks. Thank you for supporting my work.