It is important for blockchain technology to be scalable in nature to compete with legacy systems and revolutionize the financial world. Blockchain layers are critical to enhancing scalability and making meaningful progress.
In this article, we understand layer 1, layer 2, and sidechains for a better grasp of blockchain-related concepts.
Layer 1 Blockchain
Layer 1 network is called the base blockchain. It is called so since they are the main blockchain networks in the ecosystem. Layer 2 and other off-chain solutions are built on top of these main chains. Bitcoin (BTC), Ethereum (ETH), BNB Smart Chain (BNB), Solana (SOL), etc are all a few examples of Layer 1 protocols.
In other words, a blockchain network or protocol is said to be a Layer 1 when it processes and completes the transactions on its own blockchain. There are also unique native tokens used to pay transaction fees. Some of the layer 1 blockchain examples include Elrond, Harmony, and Thorchain.
Layer 1 Blockchain Solutions
From the most basic perspective, a Layer 1 blockchain protocol provides decentralization, security, and scalability. Layer 1 blockchain networks can ensure better scalability results through different approaches.
Here are examples of two different types of layer 1 blockchains based on the approach we follow for scalability:
Consensus Protocol Mechanism
The first category of layer 1 blockchain solutions contains references to switching consensus mechanisms. Many traditional blockchain networks like BTC use proof-of-work, a resource-intensive consensus mechanism. Proof-of-work supports security through distributed consensus and cryptography but has significant scalability drawbacks.
Layer 1 blockchain network and protocols use Proof-of-stake (PoS) as a consensus mechanism. PoS, with post-staking block transaction verification, helps achieve decentralized consensus on the blockchain network. However, proof-of-stake loses security but increases transaction speed. Therefore, new layer 1 blockchain improvements are needed to solve scalability issues while maintaining security.
Sharding
Fig 1. Sharding
Another feature of Layer 1 blockchain list entries indicates sharding opportunities, which is a productive method primarily used for database partitioning. Sharding acts as one of the reliable Layer 1 scaling solutions to improve transaction throughput. It is currently an experimental approach in the blockchain domain.
Sharding involves splitting the network into a collection of various separate database blocks, also known as shards. By dividing the network and its nodes, one can effectively distribute the workload while increasing transaction speed. Each shard in a Layer 1 blockchain manages a subset of the activity of the entire network. So each shard has its own transactions, separate blocks, and nodes.
When sharding is performed on the Layer 1 blockchain, all nodes do not need to maintain a complete copy of the entire blockchain. On the contrary, nodes report accounts of completed work to the main chain and share the status of local data.
Layer 2 Blockchain
Layer 2 protocols address the need of improving blockchain networks. Layer 2 protocols run parallel to Layer 1 protocols and act as secondary protocols on top of another blockchain network. They are independent of the base layer or layer 1 blockchain. In addition to transaction validation, secondary protocols minimize the workload on the base layer and help in reducing transaction fees.
Importance of Layer 2
Transactions on the blockchain are slow due to the various validations and mechanisms involved, which can result in massive network congestion due to a substantial increase in users on a particular network.
Typically, layer 1 blockchains handle all of these aspects of transaction validation, which often affects the scalability and experience of blockchain networks, along with the processing speed. Certain tasks can be offloaded by layer 1 blockchains onto layer 2 blockchains.
In recent years, blockchain networks, which offered good user traffic management capabilities and were associated with cryptocurrencies, have undergone significant changes with growth in DeFi and NFT solutions.
As a result, blockchain networks are overburdened with transactions, making developers look for low-cost solutions to improvise blockchain layers. Secondary blockchains, for instance, can alleviate network congestion.
Currently, blockchain projects with Layer 2 are important because of reduced transaction fees, no capacity limits, and faster transaction speeds which makes it easy to improve the efficiency of layer 1 blockchain networks.
Layer 2 Protocols
Here is an overview of common Layer 2 protocols available today:
Nested Blockchain
Nested blockchain combines the main chain along with several side chains, letting one chain to inter-operate with other chains seamlessly. In this case, the architecture involves the main chain to assign tasks while controlling parameters. The secondary chain helps execute and report various transactions on the main chain for feedback and approval.
Sidechains
Fig 2. Sidechains
A sidechain is a secondary blockchain connected to the primary chain, meant for large-batch transactions and often offering a lower degree of decentralization. It can support the primary chain in validating various transactions on the blockchain network, which helps it resolve security issues.
State Channels
Layer 2 blockchains include state channels or payment channels that allow parties to participate directly in the blockchain network. State channels can be bi-directional and can also handle another party if channels have been previously opened. They incorporate smart contracts for transaction verification.
Rollups
Rollups store transactions all bundled up into one cryptographic proof and stored in the primary layer 1 chain. Typically, network participants (AKA sequencers or validators) are responsible for handling transaction data before submitting batches of “rolled-up” transaction data to the main chain.
Additionally, rollups facilitate transactions without interfering with the primary tier, thereby increasing blockchain throughput and reducing costs. The two types of rollups are:
- Optimistic rollups: An optimistic rollup assumes that all transactions are valid, submitting batches without executing any computation, which can significantly improve scalability, yet can raise disputes regarding the legitimacy of the data contained in a batch.
- Zero-knowledge rollups: A zk-rollup generates cryptographic proofs for the validity of transactions. The main chain receives validity proofs for each batch of transactions.
Sidechains
A sidechain is a blockchain interacting with the mainnet with the help of bridges. They use an independent consensus mechanism, while simplifying computation and still ensuring the same level of security as the main chain. Sidechain transactions are recorded publicly and the security breaches in one sidechain have no effect on the mainchain or other sidechains. Examples of sidechains include Liquid network and Polygon.