Blockchain Layers: L1, L2, and the Role of Rollups

chucks1093

Sebastian Anioke

Posted on August 12, 2024

Blockchain Layers: L1, L2, and the Role of Rollups

Layer 1 (L1)

A Layer 1 (L1) blockchain refers to the base-level blockchain network on which transactions are validated and executed. They serve as the backbone for other layers and applications built on top of them. L1 blockchains provide the foundation for Layer 2 solutions, which are designed to enhance scalability and transaction speed by processing transactions off-chain.

Image description

L1 blockchains often face challenges related to scalability, as increasing transaction throughput can impact decentralization and security. This is part of the "blockchain trilemma," which states that achieving decentralization, security, and scalability simultaneously is difficult.

Image description

Layer 2 (L2)

Layer 2 solutions significantly increase transaction speed and throughput by handling transactions off the main chain. This reduces the load on the L1 blockchain, allowing it to process more transactions per second.

By processing transactions off-chain, L2 solutions can lower transaction fees, making blockchain operations more cost-effective for users and developers. Layer 2 solutions inherit the security of the underlying L1 blockchain. They rely on the L1 network to verify and confirm transaction data, ensuring that the integrity and security of the transactions are maintained. Common Layer 2 solutions include the Lightning Network for Bitcoin and Rollups for Ethereum. These solutions handle transactions off the main chain and then periodically settle them on the L1 blockchain.

Image description

Blockchain rollups

Blockchain rollups are a Layer 2 (L2) scaling solution designed to increase the throughput and efficiency of blockchain networks, particularly Ethereum, by processing tmultiple transactions off the main blockchain, which reduces the computational load and congestion on the Layer 1 (L1) network. These transactions are then batched together and submitted to the main blockchain as a single transaction, which helps to lower gas fees and increase transaction speed. There are of two types Optimistic Rollups and Zereo Knowledge (ZK) Rollups.
Image description

Optimistic rollups

Optimistic rollups execute transactions off-chain, bundling them into batches that are then submitted to the Layer 1 (L1) blockchain, such as Ethereum, as a single transaction. This method reduces the computational load on the L1 network, resulting in faster and more cost-effective transactions. The term "optimistic" refers to the assumption that all off-chain transactions are valid by default. Unlike zero-knowledge rollups, which use cryptographic proofs, optimistic rollups rely on a fraud-proof mechanism to ensure correctness, verifying transactions only if a dispute arises.

If someone believes a transaction in a rollup batch is invalid, they can submit a fraud proof during a designated challenge period. If the fraud proof is successful, the incorrect transaction is re-executed on-chain, and the responsible sequencer is penalized. Optimistic rollups support smart contracts in a manner similar to the underlying L1 blockchain, allowing developers to deploy decentralized applications (dApps) with minimal adjustments. This makes them more versatile compared to other Layer 2 solutions like zero-knowledge rollups. The security of optimistic rollups is derived from the L1 blockchain, as they publish transaction results on-chain and rely on the L1's consensus mechanism to maintain security and decentralization.

Image description

Zero-knowledge rollups (ZK-rollups)

Zero-knowledge rollups (ZK-rollups) are a Layer 2 scaling solution designed to enhance the scalability and efficiency of blockchain networks, particularly Ethereum, by processing transactions off-chain and using cryptographic proofs to ensure their validity. ZK-rollups handle transaction execution and state changes off-chain, reducing the computational load on the Layer 1 (L1) blockchain, which allows for higher transaction throughput and lower costs. Transactions are grouped into batches and processed off-chain, with these batches then summarized and submitted to the L1 blockchain, significantly reducing the amount of data that needs to be posted on-chain. ZK-rollups use zero-knowledge proofs (ZKPs) to verify the correctness of off-chain transactions, ensuring that the state changes proposed by the Layer 2 network are accurate and secure without revealing any underlying information about the transactions themselves.

A smart contract on the L1 blockchain manages the state of the ZK-rollup, verifying the validity proofs and updating the state based on the verified transactions. Unlike optimistic rollups, ZK-rollups do not require a challenge period for transaction finality. Once the validity proof is verified by the smart contract, the transactions are considered final, allowing for faster movement of funds between the ZK-rollup and the L1 blockchain. Additionally, ZK-rollups employ data compression techniques to minimize the amount of data stored on the L1 blockchain, further reducing transaction costs. This combination of features makes ZK-rollups a powerful solution for improving blockchain scalability and efficiency.

Image description

Sequencers

Sequencers in blockchain, particularly within Layer 2 (L2) solutions like rollups, are essential for managing the order and execution of transactions. They determine the transaction order, which is crucial for maintaining blockchain consistency and preventing issues like double-spending. Sequencers aggregate multiple transactions off-chain and submit them as a single batch to the Layer 1 (L1) blockchain, enhancing throughput and reducing fees. They also execute transactions and update the system's state, ensuring network participants have a consistent view of the blockchain.

Image description

However, sequencers can sometimes act as centralized authorities, raising concerns about potential censorship and reduced decentralization. To address these issues, efforts are underway to decentralize sequencers by allowing multiple entities to operate them, thereby improving decentralization and reducing the risk of a single point of failure.

Stages of a Rollup

The stages of a blockchain rollup describe the development and maturity levels of rollup projects, focusing on decentralization and security. Inspired by Vitalik Buterin's milestones, these stages assess rollup maturity. In Stage 0—Full Training Wheels, the rollup is mostly managed by its operators and relies heavily on centralized components for transaction ordering and state updates. This stage is used during early development and testing, making it the least decentralized. Stage 1—Enhanced Rollup marks the transition towards increased decentralization, with the implementation of decentralized governance mechanisms, such as smart contracts, to manage certain operations. This stage reduces reliance on centralized operators.

Image description

In Stage 2—Full Rollup, the rollup achieves high decentralization and security by fully leveraging decentralized governance and minimizing trust in centralized components. At this mature stage, the rollup operates independently of any single entity, aligning closely with blockchain principles of decentralization and security. The ultimate goal of these stages is to achieve "Stage 2" decentralization, characterized by trustless operation, ensuring that rollups minimize trust in specific humans and maximize trust in code.

Bridging

Bridging in blockchain refers to the process of connecting two separate blockchain networks to enable the transfer of data and assets between them. This addresses the challenge of blockchain interoperability, where different networks often operate in isolation with limited ability to communicate and exchange information. The bridging process begins with asset locking, where users lock assets, such as cryptocurrencies, on the source blockchain through a smart contract that securely holds the assets. The bridging mechanism then verifies the transaction and ensures the locked assets are legitimate, often involving consensus validation to confirm the transaction's validity. Once the assets are locked, a representation of these assets, known as wrapped tokens, is created on the target blockchain. These tokens mirror the value of the original assets and can be used within the target blockchain's ecosystem.

Image description

The bridge facilitates communication between the source and target blockchains, often using cross-chain communication protocols or relay chains to ensure seamless data transfer. On the target blockchain, users can unlock the equivalent amount of assets by interacting with the bridging mechanism, which involves burning the wrapped tokens or executing a smart contract function. The bridge ensures that the assets are properly settled and the transaction is finalized on both blockchains, providing users with confirmation of the successful transfer. This process allows for greater flexibility and utility across different blockchain networks, enhancing the overall functionality and reach of blockchain technology.

💖 💪 🙅 🚩
chucks1093
Sebastian Anioke

Posted on August 12, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related