What are blockchain layers and why do we need them

Layers of the blockchain ecosystem show how the ecosystem is structured and how the underlying, parent blockchains solve their problems, the main among them is scalability. In this article, we are going to discuss L0 to L2 blockchain layers.

Any computer network has data transmission bandwidth. Blockchain is no exception. But such decentralised databases are more prone to scaling problems than centralised networks.

A blockchain consists of a set of nodes, which is computers of the network that store a registry of data. This means that each node uses significant computing power to provide access to the distributed ledger and achieve consensus on a unified version of the blockchain (all nodes in the network recognise the new block of transactions as legitimate and create copies of that block of data).

The more nodes are involved, the more decentralised blockchain is. While decentralization is useful for network security, it has a negative impact on transaction processing speed.

On the other hand, the fewer nodes, the faster the network runs, but the more vulnerable it is. And the control of 51% of nodes by hackers generally means that you can do anything with the network. And we mean anything.

To sum it up, it is not possible to make a perfectly decentralised, secure and scalable blockchain at this time. This problem is known as the blockchain trilemma.

To put it simply: the blockchain trilemma is an assumption that a decentralised network can provide only two of the three benefits (decentralisation, security, scalability) at a time.

Blockchain layers are designed to solve this problem.

Blockchain Layer 1 (L1)

Let's start with Layer 1, not Layer 0, as L1 is the primary layer. Layer 1 involves those blockchains that conduct transactions autonomously, without any other network participation.

Important tasks regarding network operation are performed at L1: programming languages, dispute resolution, consensus mechanisms, limitations.

Blockchains L1: Bitcoin, Ethereum, Solana.

As mentioned above, decentralised L1 databases face a blockchain trilemma. Layer 2 blockchains are there to solve it. As the number of L1 blockchains is constantly increasing, the problem of transferring crypto assets from one blockchain to another arises. Layer 0 is invented to solve this problem.

Blockchain Layer 0 (L0)

This layer provides communication of different networks and solves the scalability problem. It involves:

  • crypto transferring between different networks;
  • facility to develop a single dApps on multiple blockchains simultaneously;
  • fast and inexpensive transactions on crosschain exchanges due to L0 communication protocols.

Blockchains L0: Cosmos, Avalanche, Polkadot.

layers_213eng.png

Blockchain Layer 2 (L2)

Layers 2 are designed to improve the scalability of the underlying blockchain (L1). Layers 2 are commonly referred to as third-party integrations with the first layer of the network. Layer 2 blockchain protocols reduce the workload on the underlying Layer 1 network, process transactions outside of L1 and transfer them back.

Layer 2 solutions have different approaches to making the network more scalable. It involves:
1. State Channels. Transactions are exchanged outside a blockchain and then the result is written to the blockchain itself. Users can make multiple transactions directly outside the network using an open channel. Only two transactions (final state channel) will be sent to the settlement layer (L1). This solution significantly reduces costs and increases network bandwidth.
2. Nested blockchains. They are functioning on a L2 network on top of L1. L1 sets the parameters, L2 executes the processes. This technical solution is based on hash trees that create child chains of the underlying blockchain. The nested blockchains function according to the regulations of the parent network. The parent blockchain (L1) is not involved in transaction processing, but only resolves disputes when necessary. The child networks (L2) process the transactions and then send the result back to the parent blockchain (L1) at the first level. This helps make transactions faster and cheaper.
3. Rollups. This technology involves combining several transactions and processing them in a L2 network. There are two types of rollups:

  • Zero-Knowledge rollups combine multiple transactions into one. They combine transactions to execute them off-chain. In effect, this results in only one transaction being sent to L1, significantly increasing transaction speed.
  • Optimistic rollups run parallel to the main chain of a blockchain. They deploy smart contracts that already exist on the L1 of the blockchain. Transactions are bundled, compressed and processed in the L2, which multiplies its processing speed. With optimistic rollups, the blockchain does not check every transaction for L2, meaning it does not perform calculations (hence the increase in network bandwidth), but simply broadcasts the transactions and optimistically assumes they are valid until it is proven otherwise.

4. Sidechain, a hybrid between channels and nested blockchains used to process multiple transactions simultaneously. Sidechains operate separately from the blockchain L1 and have their own consensus algorithm. They use a cross-chain bridge to connect to the mainnet. In the parent blockchain (L1), crypto-assets are blocked while they are being handled on the sidechain, once they return to the L1, they are unblocked. The difference between a sidechain and a statechain is that the former publicly records all transactions in the register. Also, if security is breached in a sidechain, there is no impact on other sidechains or the mainnet.

Blockchains L2: Optimism (solves Ethereum's scalability problem by using Optimistic rollups), Polygon (increases the scalability of the Ethereum blockchain by using sidechain technology), Lightning Network (integrated into the Bitcoin network, helps make transactions faster and cheaper).

Blockchains Layer 2 also have disadvantages:

  • New blockchains on top of the mainnet result in additional obstacles to communication between blockchains.
  • L2 has a lower level of security than the mainnet causing additional risks.
  • Layer 2 does not solve the problems of the underlying networks, but only 'polishes' a blockchain.

Understanding blockchain layers will help you realize your crypto project's place in the blockchain ecosystem.