Layer1 and Layer2 Blockchains. What you need to know.

Layer1 & 2, interoperability, sharding, bridges… Here is a straightforward guide.

The adoption of blockchain technology has evolved rapidly, transitioning from a niche group of users to a widespread user base numbering in the millions. Recent data, as of early 2023, indicates that over 420 million individuals globally are now cryptocurrency owners. While this surge in user participation is noteworthy, it introduces a significant challenge to the operational efficiency of blockchain networks — an infrastructural bottleneck. This challenge is encapsulated by the critical issue of blockchain scalability, how to make blockchain projects grow safely while maintaining ease of use and efficiency. The attainment of high scalability is paramount, as it directly influences the potential for blockchain to achieve mainstream adoption.

Scalability Trilemma

To understand these concepts thoroughly, it is essential to break down key terms. First, “Trilemma” is derived from Latin, denoting the challenge of selecting the best option among three available choices. “Scalability” refers to the capacity to efficiently process a growing volume of transaction data without sluggishness. The Scalability Trilemma posits that blockchain networks must prioritize two out of three qualities: resilient security, complete decentralization, and the ability to handle a high transaction volume rapidly.

This trade-off among qualities is reminiscent of a fundamental concept in Computer Science known as CAP or Brewer’s theorem. According to Brewer’s theorem, distributed systems can only prioritize two qualities among partition tolerance, availability, and consistency. For example, the BNB Chain, with 21 validators, contrasts with Solana, boasting 1,900 validators. While the BNB Chain may be considered less decentralized, it deliberately sacrifices absolute decentralization to bolster security and transaction speed.

A recent attack on the chain exemplifies this strategic decision, as the limited number of validators promptly agreed to pause the chain, thwarting the attack effectively. On the other hand, Ethereum, with 500,000 validators, sacrifices scalability for enhanced security and decentralization. The substantial number of validators in Ethereum serves two crucial purposes. Firstly, it virtually eliminates the possibility of a 51% attack, as acquiring a majority of validators’ compromise is nearly impossible. Secondly, it underscores the transparency and decentralization of the chain.

Solving The Blockchain Trilemma

Layer 1Layer 2
Change in Consensus Mechanism State Channels
Chain ForkRollups
ShardingNested Blockchains
Sidechains

Addressing the challenge posed by the scalability trilemma in blockchain technology involves exploring actionable solutions proposed by Web3 researchers. These solutions encompass diverse mechanisms designed to enhance network processing speed, fortify security measures, and preserve the decentralized nature of blockchain networks.

Layer 1 Networks Overview:

A Layer 1 network serves as the foundational blockchain or primary blockchain network, supporting and executing fundamental blockchain transactions and activities. It possesses distinct layers, including data availability, consensus, and P2P network, making it capable of hosting dependent blockchains.

Layer 1 Blockchains and Scalability Solutions:

Notable Layer 1 blockchains, such as Aptos, Algorand, Avalanche, Bitcoin, Cardano, Celo, Cronos, Cosmos, Elrond, Ethereum, Fantom, Harmony, and Hedera, play a pivotal role in the blockchain landscape. However, due to escalating transaction volumes, each Layer 1 blockchain must either develop or adopt custom scaling solutions for sustained performance.

Scalability Solutions:

  1. Change in Consensus Mechanism: The agreement among nodes in a blockchain protocol, known as the consensus mechanism, influences transaction validation. Not all consensus mechanisms are equally efficient for Layer 1 scaling solutions. For instance, Ethereum transitioned from proof-of-work to proof-of-stake, significantly increasing its data processing capabilities from around 10 transactions per second to approximately 32 blocks. While Ethereum continues its scalability journey, the shift to PoS marks a substantial step forward.
  2. Chain Fork: Forking a chain involves upgrading or adjusting it, with soft forks compatible with the chain’s existing nature and hard forks introducing new changes. Bitcoin’s successful implementation of a soft fork, specifically the Segregated Witness (SegWit) Soft Fork, significantly enhanced its performance. The Bitcoin blockchain’s processing capacity increased from handling over 1600 transactions per block to nearly 3000 after the implementation of SegWit.
  3. Sharding: Sharding, a promising scaling solution, involves partitioning data into smaller portions or shards to expedite processing. This approach allows nodes within an individual shard to process transactions independently, offering greater efficiency than the time-consuming process of achieving consensus across all nodes in a blockchain protocol. While sharding remains a conceptual framework, major Layer 1 blockchains, including Ethereum, are actively exploring its implementation for future scalability improvements.

Layer 2 Scaling Solutions:

Layer 2 networks serve as overlaying blockchains designed to enhance the performance of primary networks. Given the current absence of widespread sharding implementation in overlaying networks, these networks play a crucial role in augmenting throughputs.

Functionality of Layer 2 Networks:

Layer 2 (L2) networks alleviate the load on the main chain by extracting bundles of transactions, processing them independently, and reintegrating them into layer 1. By adopting Layer 2 scaling solutions, the burden on the overlaying network is lightened, resulting in reduced transaction congestion.

Characteristics of Layer 2 Blockchains:

Prominent examples of Layer 2 blockchains encompass platforms like Arbitrum, Boba Network, Lightning Network, Loopring, Metis, StarkNet, Skale, Optimism, Parastate, and Polygon. While these overlaying networks often rely on a layer 1 blockchain for security and data availability, they introduce custom consensus and execution layers, ensuring synchronization with the state of layer 1.

  1. State Channels:State channels serve as a commendable mechanism for scaling Layer 2 blockchain networks. This method, known for its speed and privacy, involves moving a portion of the layer 1 state into a multi-signature wallet outside the blockchain. Participants can then conduct activities directly between themselves without involving miners. Once completed, the last state of the channel integrates with the current state of the main chain. Notably, the Lightning Network, a state channel on Bitcoin, demonstrates exceptional scalability, processing around 1 million transactions per second.
  2. Rollups:Rollup, a scaling solution gaining wider acceptance, consolidates transaction bundles from the main chain, executes them off-chain, and loads the processed transactions back into the main chain. This approach alleviates the main chain’s processing load and enhances the scalability of layer 1 networks, with variations such as zero-knowledge (ZK) rollups (e.g., StarkNet) and optimistic roll-ups (e.g., Optimism) demonstrating high transaction capacities, with ZK rollups achieving up to 100,000 transactions per second.
  3. Nested Blockchain: Nested blockchain, a form of layer 2 scaling solution, involves a blockchain protocol housing other blockchains within or on top. The parent chain delegates transactions to child chains, which execute them and send the results back to the parent. Ethereum Plasma is a prime example, demonstrating a relatively fast transaction capacity of 5,000 transactions per second.
  4. Sidechains: Sidechains operate alongside main chains to optimize performance, with assets locked during sidechain transaction processing. Sidechains often include a federation or independent third party that cross-checks activities between the mainnet and the sidechain. While sidechains rely on the security of the main chain to some extent, breaches in sidechain security do not impact the main chain. Sidechains like Polygon boast transaction processing capacities of around 65,000 transactions per second.

Blockchain Layer 1 vs. Layer 2: Key Distinctions

When comparing Layer 1 and Layer 2 blockchain networks, several primary differences stand out:

  1. Purpose: Layer 1 blockchains are designed to operate independently. They are self-sufficient and function as standalone entities with all the necessary layers, including data availability, consensus, and execution, embedded within. On the other hand, Layer 2 scaling solutions serve a different purpose – they are designed to enhance and support Layer 1 blockchains rather than acting as independent base blockchains. This means that Layer 2 networks depend on the primary network for their functionality.
  2. Scalability Methods: Another significant difference lies in how each achieves scalability. Layer 1 blockchains employ various methods such as changing the consensus mechanism, forking the chain, and sharding to enhance scalability. In contrast, Layer 2 scaling solutions take a different approach. They include mechanisms like state channels, nested blockchains, rollups, and sidechains to address scalability challenges. Each of these methods aims to improve the efficiency and performance of Layer 1 blockchains without altering their foundational structure.