What’s the Difference Between Layer 1 vs. Layer 2 Networks? | Blockchain Layers Explained
Blockchain technology and the way we use it is constantly evolving. The constant evolution of blockchain technology has led to the iteration of models such as layer 1 and layer 2 networks.
In our years of experience, we have found that understanding the types of blockchains and how they operate is crucial. A proper understanding of the blockchain can be vital to avoid losses. It also helps in making the right choice of projects to buy into.
In the following paragraphs, we will be explaining Layer 1 vs. Layer 2 blockchains. We will be discussing the differences between the two, and how they operate.
Key Takeaways
- Growing adoption and use of blockchain technology mean that networks have to scale to meet demand and functions.
- The scalability trilemma is an idea that networks have to tradeoff one of security, decentralization, and scalability to achieve the others.
- Layer 1 networks are primary networks. Layer 2 are additional protocols built on L1 networks.
- L1 solutions like sharding and Consensus mechanisms focus on modifying the blockchain. L2 solutions like roll-ups and sidechains add to the blockchain infrastructure.
Blockchain Layer 1 vs Layer 2
Layer 1 blockchains, or networks, are primary blockchain networks. Layer 2 networks on the other hand are protocols built on top of Layer 1 networks.
Layer 1 networks are the foundation of any network in an ecosystem. Layer 2 networks are additional protocols on layer 1 networks that allow them to do much more.
Layer 2 networks usually offer a wider range of functions. However, layer 2 is dependent on layer 1.
What are Blockchain Layers?
To perform its many tasks, the blockchain is organized in several ways. These levels of organization are called blockchain layers. A blockchain layer is a part of the blockchain architecture, usually fulfilling a specific purpose.
One blockchain is often added on top of another to expand its capacity or scale. They are created as a solution to the scalability trilemma. That is, blockchain layers exist to increase the functionality of a blockchain while maintaining its security.
Think of it like a story building – each layer is a floor built on top of another. One floor can be dedicated to providing security, and the other improved convenience. In this way, blockchains can preserve core principles while expanding their reach and functions.
What is the Scalability Trilemma?
To start with, scalability is the ability of a system to grow or expand. When it comes to blockchains, scalability refers to how they can take on more users and workload. If a network can “scale”, it can onboard more users and take on more functions with maintained efficiency.
Blockchains aim to obtain three elements:
- Security
- Decentralization
- Scalability
As blockchain networks attempt to “scale”, they are often faced with the scalability trilemma. This says that it is hard for a blockchain network to achieve optimal levels of all three simultaneously.
The idea is attributed to Vitalik Buterin, co-founder of Ethereum.
According to the scalability trilemma, increasing one element will lead to a reduction in another. For example, blockchains with more decentralization tend to be unable to scale. Networks that prioritize scalability may do so at the risk of losing decentralization and security.
The scalability trilemma is why networks adopt multiple scaling solutions.
Why is Blockchain Scalability so Important?
As the adoption of blockchain technology grows globally, more people are getting involved. In addition, the technology is being utilized in diverse ways. For these reasons, blockchains must constantly scale up.
Broadly speaking, blockchain scalability is important for two reasons:
Growth: Blockchain and cryptocurrency technology present great promise. This has led to increased global adoption. A growing number of users means blockchains also have to grow to accommodate the demand. As even more users are expected in the future, networks need to have the capacity to take them in.
Efficiency: Today, more people use the blockchain to do more things – including basic transactions. The current capacity of networks is limited, however. For example, the Bitcoin Network can process 7 transactions per second. The Ethereum network, on the other hand, can process up to 15 transactions per second. It is important that networks scale to handle more transactions, and faster. This is vital for the next level of adoption of cryptocurrencies.
Blockchains Scalability Issue
Since scalability is so important for the present and future of blockchain, what are some of the issues that still limit it?
Speed
Compared to conventional payment options like Visa, blockchains have a low transaction per second. This is due to decentralization, and the need for consensus. While additional nodes may allow for more transactions and users, it can increase the confirmation time, and slow transactions altogether.
Security
Scaling often comes at the cost of decentralization or security. A network may onboard several new participants but difficulties in confirming their identity could put it at risk. Security is a core focus of the blockchain, and maintaining it can come at the tradeoff of scalability.
Infrastructure
A blockchain is a decentralized network made up of many “nodes” or computers. A number of these systems are limited in storage and processing capacity. Scaling makes it hard if not impossible for these nodes to maintain the network, or even participate.
Layer 1 Blockchains Explained
Remember our story-building analogy?
Layer 1 blockchains are the ground floor and base of all blockchains. They are the primary networks within any ecosystem. L1s provide the infrastructure for other blockchain networks.
Based on distributed ledger technology, it records each new transaction within a “block” which is then attached to the preceding block. The blockchain is publicly accessible and is replicated on various computers called nodes. These support the blockchain and ensure it stays immutable.
L1 networks provide security and structure, process basic transactions and use a native cryptocurrency. They utilize a consensus mechanism which is how new blocks are added. The most popular consensus mechanisms are Proof of Work (PoW) and Proof of Stake (PoS).
The two biggest layer 1 networks are Bitcoin and Ethereum.
Layer 2 Blockchains Explained
Layer 1 networks perform well as base networks. However, they are limited in capacity and difficult to scale. They can perform only basic functions and store blockchain data.
Advancements in blockchain technology have led to the emergence of layer 2 blockchains.
Referring back to our analogy, layer 2 blockchains are on the second floor. It can take in more people and has a lot more features. Since it can simply rely on the security provided by the ground floor (L1), it is usually built with other considerations in mind.
Layer 2 utilizes off-chain solutions, like side chains, to scale blockchains. Bitcoin’s Lightning Network and Plasma which is based on Ethereum are examples of layer 2 blockchains.
What are the Key Differences Between Layer 1 Vs Layer 2?
Layer 1 | Layer 2 |
Base blockchain – can process transactions on its own | Additional Protocol on base blockchain – relies on L1 to process transactions |
Does not scale well | Scales well |
More secure | Security may be compromised |
L1 is the base blockchain and the primary network. The main architecture of the blockchain is at the L1 level, while L2 is an addition on top of this framework.
L1 networks have blockchain infrastructure and can run completely on their own. L2 relies on L1 for security and stability.
L1 networks are more secure but do not scale well, due to issues we have already highlighted. This means they are limited in capacity to function efficiently. L2 networks scale well and have a greater capacity to perform tasks and onboard more users. L2 is however less secure and relies on the infrastructure of L1 networks.
The Scalability Methods of Layer 1 Vs Layer 2 Blockchains
Scaling is difficult at the L1 level, but it is not impossible. As blockchains attempt to scale, in light of the scalability trilemma, they can adopt L1 scaling solutions or L2 scaling solutions. The choice of scaling solution is based on the capacity and the priorities of the network.
Layer 1 scaling solutions
Layer 1 scaling solutions include:
- Sharding
- Improving Consensus mechanism
Sharding
Sharding is a new technique for scaling L1 networks, but is fairly popular. It means dividing up blocks into smaller pieces to make them faster and easier to manage.
Data in the blockchain is contained in blocks. By breaking blocks down, it is easier and faster to record and transmit data.
Each of these smaller units is called a “shard”, and contains unique and independent data. Before sharding, each node must process every transaction in the network. By reducing the workload on individual nodes, networks can process more transactions per second.
There are still some security concerns about sharding, although it is in its early stages. The advantages of sharding are improved performance, speed, and reduced transaction costs.
Improved Consensus Mechanisms
A consensus mechanism is a procedure through which all blockchain technology users agree on the validity of fresh blocks. This is critical for all cryptocurrencies because it keeps track of who owns specific coins and prevents users from spending the same coins again.
Blockchains use consensus mechanisms to validate new transactions, instead of trust, before they are added to the blockchain. The speed of the mechanism affects the scalability and performance of a network. Improving, or changing, the consensus mechanism can help the network scale.
Proof of Work (PoW) and Proof of Stake (PoS) are two of the most popular consensus mechanisms.
L2 scaling solutions
L1 solutions focus on modifying the blockchain and are limited in how they enable networks to scale. There is always a limit to the ability of a blockchain, without risking one or more of its core principles.
L2 solutions surpass this by going “off-chain”. That is, instead of modifying the blockchain, it adds another layer to it. The original blockchain is called a mainchain, and the new layer is usually called a sidechain. The sidechain can focus on processing transactions at greater speeds and capacity, using the security provided by the first layer.
The various L2 solutions are:
- Sidechain
- Roll-ups
- State Channels
Sidechains
A sidechain is a distinct blockchain linked to the mainchain by a two-way bridge. The two-way bridge allows for the exchange of tokens and other digital assets between the mainchain and the sidechain.
Sidechains have their own protocol, token, and consensus mechanisms
They reduce the computational load on the mainchain, improving the throughput and reducing expensive fees. Sidechains may however be vulnerable to security breaches.
Roll-ups
Roll-ups involve the combination of multiple transactions executed off-chain with a smart contract. This way the blockchain only has to process one transaction (the rolled-up transaction) allowing blockchains to do more, and quicker.
Since the fee is split across transactions, roll-ups also reduce transaction processing costs. There are two types of roll-ups – optimistic roll-ups and zero-knowledge roll-ups.
What is the Nakamoto Coefficient in a Blockchain Network?
Decentralization is an important principle behind blockchain and cryptocurrency technology. As networks scale, or make necessary changes, the level of decentralization may shift. To test how decentralized a network is, a Nakamoto Coefficient is used.
The Nakamoto Coefficient is named after Satoshi Nakamoto, the creator of Bitcoin. It asks, “How many nodes would one need to control to disrupt the network?” The higher the Nakamoto Coefficient compared to the number of nodes, the more decentralized the network is.
It is important to consider it, to guard against collusion and other 51% attacks. Where the coefficient is low, it is easier to attack or take over those nodes, and compromise the network.
Layer 1 and the Collapse of Cryptokitties
Cryptokitties is a game based on the Ethereum blockchain that allows users to make, buy and sell NFTs of virtual cats. Launched in 2017, and often credited as the first blockchain game, it experienced explosive popularity. This would eventually lead to congestion on the Ethereum network.
At some point, it was responsible for around 12% of the total traffic on the network.
Since it was built on the Ethereum network, it relied on its infrastructure to function. As a layer 1 blockchain, the Ethereum network was unable to cope with the number of new users and transactions brought in by Cryptokitties. Queues were long, and transaction fees increased due to the traffic.
The difficulties faced in coping with the demand and popularity were a contributing factor to its eventual decline. High fees and long queues discouraged some new users from the blockchain game. What this exemplifies is the weakness of L1 blockchains and the need for scalability.
The Architecture of Layer 1 Vs Layer 2 Blockchains
Blockchain architecture refers to the design structure of a peer-to-peer network. The way blocks are created and added and how nodes function all factor into the blockchain infrastructure.
Every component of the blockchain contributes to part of its infrastructure. They have defined roles they perform, and each layer usually provides a specific function to the network.
Typically a blockchain architecture contains the following layers:
- Hardware
- Data
- Network
- Protocol/Consensus
- Service
- Application
The hardware layer consists of multiple physical computers, or nodes, that create and maintain the virtual network. This layer is responsible for providing the infrastructure on which the blockchain is based.
The data layer is concerned with data and how it is created and stored. It is also concerned with the integrity of and security within the blockchain. The network layer on the other hand facilitates interactions between nodes, at which point the blockchain is active.
The protocol layer introduces the rules of consensus in a network, as well as some additional functionality. Service layers add more functionality than simply processing transactions. The application layer introduces applications that interact with the network.
L1 networks usually do not extend beyond consensus at the protocol layer. L2 networks incorporate the protocol, service, and application layers for a more robust blockchain.
What are the Limitations of Layer 1 Vs Layer 2 Networks?
Limitations of Layer 1 networks
- Scalability: L1 networks are limited in their ability to scale, without compromising core principles of the blockchain.
- Cost and efficiency: lower throughput (transaction per second) and high fees resulting from network congestion. Consensus mechanisms used can also contribute to low throughput.
- Improvement: making improvements on existing L1 networks is difficult, due to the nature of the blockchain, and the need for consensus.
- Functionality: L1 networks have limited functionality, usually just processing transactions. Interoperability is also limited at this level.
Limitations of Layer 2 networks
- Dependency: L2 networks are always reliant on L1 networks and their infrastructure to perform their functions. This dependency means that anything affecting the mainchain will likely affect the L2 network as well.
- Restrictions: L2 networks can only process transaction items that are routed via them. They have a restricted set of functionality since they cannot act autonomously. As a result, they can only be used in certain blockchains.
- Security: there are increased vulnerabilities within L2 networks. With increased risks of hacks and attacks, L2 networks may not be suitable for every network.
Final Thoughts on Layer 1 Vs. Layer 2 Blockchain Networks
Blockchains today require scalability to cope with growing adoption and new use cases. To achieve this, L1 and L2 solutions are being employed. These seek to either reduce the computational load on networks or improve their overall speed.
In scaling, networks are faced with the scalability trilemma – increasing one element is often at the tradeoff of others. For example, while L2 solutions allow for more functionality for a blockchain, they often invite more security risks.
On the other hand, L1 solutions tend to be difficult to implement and do not scale well.
Given the limitations of both solutions, networks should choose based on their unique considerations. It should also be noted that networks can use both L1 and L2 solutions or a combination of the two.