Layer 2 (L2). How to improve blockchain performance

WhiteBIT
Published 20 December 2022
4048
Layer 2 (L2). How to improve blockchain performance

Content

Since the advent of the blockchain in 2008, thousands of researchers have been optimizing the technology, in particular improving its scalability.

Scalability is the ability of the blockchain to equalize supply and demand so that transactions within the system are fast and affordable. However, limitations caused by low scalability resulted in high fees and slow transactions. It, in turn, prevents blockchains from working on an industrial scale.

Eat, Pray, Love. What is the blockchain trilemma?

Performance is characterized by the TPS (Transactions Per Second). In the context of blockchain, TPS stands for the number of transactions that the network is able to process every second. For example, Bitcoin is able to process 7 transactions per second, for Ethereum this figure equals to about 15 TPS. Given the popularity of those blockchains, the figures are very low, especially when compared to the TPS of centralized payment systems. For example, the VISA payment system processes up to 24.000 transactions per second.

Why can’t blockchain improve its throughput?

As a rule, a blockchain network consists of nodes, i.e., computers on the network that store a whole register of transactions. It means that each node must use significant computing resources to provide access to the ledger and maintain consensus, an agreement to add a new block of transactions. The more decentralized the blockchain is, the more nodes it has. This redundancy is good for the security of the network, but it has a bad effect on its speed, since many nodes participate in the verification of transactions. In turn, a small number of nodes will increase the vulnerability of the network, which can lead to a 51% attack.

The Holy Grail of the blockchain technology is in creating a safe, decentralized, and scalable network. The blockchain trilemma points out that decentralized networks can provide only two of these characteristics.

1) Scalability is the ability of the distributed system to process big amounts of data.

2) Security refers to the ability to protect data on the network from attacks and double spending.

3) Decentralization ensures that the network is not controlled by a limited number of people.

Increasing Ethereum transaction fees during times of high demand is an example of an unresolved trilemma. The Ethereum network mainly focused on decentralization and security, limiting the number of transactions per second, that is, scalability.

The struggle for scalability forces blockchain developers to come up with new solutions that improve network performance without sacrificing security and decentralization.

First level solutions (Layer 1, L1)

L1 are the networks that allow processing transactions “on the spot”. That is, they carry out their operations without another network.

For example, the main network of the huge Ethereum ecosystem is Ethereum, that is, this is L1. The same works for Bitcoin, its main network is the “backbone” of the ecosystem.

Typically, L1 blockchains suffer from the blockchain trilemma and only implement two of the three properties. The number of people who want to conduct a transaction at the same time is growing, while TPS remains low.

First-level scaling solutions (for the blockchain base itself or its code) are fundamental and affect the structure of the blockchain itself.

Second level solutions (Layer 2, L2)

If the main blockchain is the first layer, then the add-on on top of the main network is the second layer. These are third-party integrations with L1 that solve one of the problems of the trilemma for L1, most often the problem of scaling, and also help to expand the capabilities of the base layer network.

One of the main requirements of L2 is the inherent security of the blockchain on which it is built.

Transaction data must be validated by the underlying blockchain network, not by a separate set of nodes. So, for example, side chains are often not considered L2 because they use their own mechanisms, resulting in a different set of security guarantees than in the underlying network.

As a rule, L2 use the following technical solutions:

  • State Channels are so-called spaces to perform an exchange of transactions outside the blockchain, after which only the result is written to the blockchain itself.
  • Nested Blockchains. The operation of a more scalable L2 blockchain due to a less secure consensus mechanism on top of L1.
  • Rollups presuppose combining several transactions and processing them in the L1 network.
  • SideChains is a combination of Nested Blockchains and State Channels, which is used to process numerous transactions.

For example, Bitcoin is a first-level blockchain, its second layer solution is Lightning Network, a network of payment channels between users deployed on top of the main network. It helps to carry out transactions outside the Bitcoin blockchain, passing it information about transactions that have already been completed. The well-known networks Polygon, Arbitrum, and Optimism are L2 solutions for Ethereum.

Resume

Improving network performance without sacrificing decentralization and security is one of the main tasks of the blockchain community. The search for the optimal solution led developers to two main methods. Those are changes in the “backbone” of the blockchain, or its first level, and external add-ons, the second-level solutions. Both methods, with all their variations, help the blockchain giants to “handle” their popularity.

The first layer (L1) blockchain network is about speed, security, and scalability, while the second layer (L2) refers to technology enhancements and products that can be used to expand the scalability of existing networks.

The blockchain community strives to balance the two levels, which may soon change the rules of the game, as well as introduce blockchain technologies to more of the various areas.

So, these infrastructure solutions are represented by applications and various software deployed on top of the main blockchain. Their main task is to process large amounts of information and take the load off the main network.