Blockchain Layers: How are L0, L1 and L2 Chains Different?

發佈於 Nov 10, 2022 | 部落格

blockchain_layers_banner

Blockchain technology has only been around about a dozen years, but already it has caught on just about everywhere in the world. The promises of decentralization, privacy, and creator ownership put forth by this innovation have captured the imaginations of people on every continent and are increasingly penetrating our use of technology, often without us knowing it. 

While there is still a long way to go until the technology reaches mass adoption, it is estimated there are already around 320 million crypto users worldwide. Since blockchains are distributed ledgers, meaning that the data is maintained by all parties, they can run a lot slower than centralized databases. This has required creative solutions on the part of Web3 developers to figure out how best to scale these rapidly growing behemoths.

One terminological convention crypto users may have come across is “blockchain layers.” These layers have arisen to help blockchains deal with scaling issues. Layers can range from L0s to L2s, though the most commonly seen are L1s and L2s.

Let’s explore the reasons behind this system and the basics of each layer.

Blockchain basics

Blockchains are made up of a collection of nodes that store data. This is the distributed ledger. The chain processes a new batch of transactions called a “block,” and then the information from the block is stored across the nodes in the network. The data is immutable and everywhere, meaning what happens on the blockchain stays on the blockchain. The record cannot be tampered and remains distributed across the nodes forever.

When it comes to transactions, this technology enables all parties to operate in a trustless manner, since there is no need to put faith in a centralized entity to maintain the records. These qualities of the blockchain are the reason cryptocurrencies took off, while previous attempts at digital money all fell short due to the impossibility of guaranteeing trust in the system.

Why are blockchains so hard to scale?

The goal of just about every blockchain is to become as decentralized as possible; however, it’s not uncommon for compromises to be made for sake of security and scalability. This is called the “blockchain trilemma,” which posits that you can only have two out of three with regard to decentralization, security, and scalability.

As a blockchain scales, it tends to see reduced transaction throughput. While one response might be to make it easier to generate new blocks, this could lead to increased exposure to malicious actors attempting to take over the chain.

Attempting to solve the blockchain trilemma has been a major driving force for innovation in the Web3 space. Some chains attempt to solve it single-handedly with their own technology, while others try to attack the problem from multiple angles with scaling solutions in the form of layers.

Layer-0 vs Layer-1 vs Layer-2 chains

What is a Layer-0 (L0) chain?

Blockchains often have limitations that make them more suited to some DApps than others. The typical base level, a layer-1 chain, has already made choices that narrow it out of the range of usefulness for certain projects.

A layer-0 blockchain, such as the Cosmos Hub, gets around this issue by creating an agnostic core that can be coated with many layer-1 chains. A multi-chain network is created around the hub, which has its own native token for certain transactions.

Additionally, layer 0s not only tend to boast extremely high levels of interoperability with all the layers stacked on top of them but also across chains. The multi-chain infrastructure facilitated by layer 0s is also very much in line with the ethos of decentralization.

What is a Layer-1 (L1) chain? 

This is the one that most people have in mind when they use the word blockchain. Bitcoin and Ethereum are the two largest layer-1 chains. Many newer chains like Solana or Aptos qualify for the term as well.

Older layer-1s tend to have more difficulty in scaling. Chains like Ethereum and Bitcoin, both designed in earlier eras of blockchain technological development, have largely turned to layer-2 scaling solutions such as Polygon, rollups, or the Bitcoin Lightning Network.

However, layer-1 scaling solutions such as sharding exist too. Sharding, which is set to debut on Ethereum possibly in 2023, involves the network being siloed into pieces called shards. These smaller pieces are then managed by nodes that do not need to hold the entire blockchain’s history while they validate transactions in parallel. 

What is a Layer-2 (L2) chain?

Layer 2s can take a variety of forms. The most common include the following:

Rollups

Rollups process transactions off-chain in bundles and then send them back to the mainchain. Zero-knowledge (ZK) rollups handle this by using proofs that validate transactions very quickly, while Optimistic rollups depend upon a dispute period where transactions can be contested.

State channels

State channels enable a two-way transaction lane between parties off-chain. A batch of transactions is executed and then after completion the “state” is sent back to the chain to be validated. The Bitcoin Lightning Network and Ethereum’s Raiden rely on state channels.

Nested blockchains

Nested blockchains execute transactions that the layer 1 then receives and verifies. The layer-1 sets all the parameters for the functioning of the nested chain but typically doesn’t get involved in transactions unless there is a dispute to be resolved. The OMG Network on Ethereum is an example of a nested blockchain.

Sidechains

Sidechains operate independently of their parent chains and even have their own consensus networks and validators. Transactions are sent to the main chain via bridging smart contracts, which are not validated by the parent chain, meaning the user must make certain the sidechain is trustworthy. The P2E game Axie Infinity uses the sidechain Ronin, which connects to Ethereum. Ronin made headlines in 2022 when it suffered a dramatic $600 million hack.

Conclusion

Layers matter in blockchain, and will continue to do so for the foreseeable future, due to the challenges that network scaling such as congestion and subsequent rising transaction fees bring. As leading blockchain like Ethereum and Solana mature over time and scale exponentially while they find mass adoption, it is possible that these and other layer-0 and layer-1 chains will become foundational layers largely used to secure each network, while the majority of transactions take place on cost-effective and fast layer-2 solutions. 

This is a vision shared by Ethereum creator Vitalik Buterin who in 2021 stated that L2 rollup protocols were the future of Ethereum scaling, and in August 2022 declared that layer-2 scaling would once again help crypto payments make sense.