Caleb & Brown

May 4, 2022  ·  4 min read

What is a Layer 2?

What is a Layer 2?

Summary

Layer 2s are off-chain scaling solutions designed to improve the scalability and efficiency of Layer 1 blockchains. These auxiliary networks or protocols operate on top of the underlying blockchain. They handle transactions off-chain and then report back to the main blockchain to finalise results. Developers have created various Layer 2 solutions, each with their own trade-offs and specific application use cases.

Scaling Overview

Why is Scaling Important?

While crypto has experienced unprecedented adoption over the past couple of years, it has not been without teething issues. As the number of users of Layer 1 blockchains such as Ethereum has grown, these blockchains have reached certain technical capacity limitations. If you have used the Ethereum network over the past couple of years, you will know it can be very slow and expensive. Increased congestion has driven up the cost of using the network, creating the need for scaling solutions.

The goal of scalability is to increase transaction speed (faster finality), and transaction throughput (high transactions per second), without sacrificing decentralisation or security. On Layer 1 blockchains, higher network demand generally leads to slower transactions and non-viable gas prices, as transaction senders aim to outbid each other. Just like a freeway, too much traffic makes them congested and painful to use.

There are two ways to scale a blockchain ecosystem, through on-chain and off-chain scaling strategies.

  • On-chain scaling involves making the Layer 1 blockchain itself have a higher transaction capacity. The main challenge with this technique is that blockchains with ‘bigger blocks’ are inherently more difficult to verify and likely to become more centralised. Ethereum developers have identified ‘sharding’ as a long-term scaling solution to this issue, which involves splitting the Ethereum Layer 1 into multiple chains with shared security.
  • Off-chain scaling changes the way blockchains are used. Instead of putting all the activity on the Layer 1 directly, users perform the bulk of their activity off-chain in a Layer 2 protocol.

What is Layer 2 Scaling?

Layer 2s are secondary networks or protocols that operate on top of an underlying Layer 1 blockchain. Layer 2 protocols are supported by their own nodes, separate from the primary blockchain. They abstract a portion of the underlying blockchain protocol’s transaction burden to an adjacent system architecture. This auxiliary layer then independently handles transactions and processes, and only reports back to the main blockchain to finalise its results.

Generally speaking, a majority of the work usually performed by the main chain can be moved off-chain to Layer 2s. Transactions are submitted to the Layer 2 instead of being submitted directly to the Layer 1. The Layer 2 then batches them into groups before anchoring (publishing) them to the Layer 1, after which they are secured by the Layer 1 and cannot be altered.

If we continue using the freeway analogy, you can think of Layer 2s like high-occupancy vehicle (HOV) lanes, which are common in the United States. Rather than having every single passenger travel on the freeway in an individual car, it helps with congestion if multiple passengers bundle or carpool together in the HOV lane. By offloading some of the transaction ‘traffic’ to the Layer 2, the core blockchain (Layer 1) can move faster. The details of how this process is conducted varies depending on the Layer 2 scaling technology.

Types of Layer 2 Scaling Solutions

The leading Layer 2 solution for scaling on Ethereum is rollups. Rollups move computation (and state storage) off-chain, but keep some data per transaction on-chain. They enable increased scalability by executing transactions off-chain and only publishing the proof of transactions on-chain. A rolled-up transaction could include tens of thousands of transactions, which means tens of thousands of transactions can be recorded on the main-chain for the price of one. As transaction data is included in Layer 1 blocks, this allows rollups to be natively secured by the same Layer 1 security measures. There are two kinds of rollups with different security measures:

  • Optimistic Rollups: ‘roll up’ many off-chain transactions into batches. These rollups ‘optimistically’ assume transactions are valid unless successfully challenged through what are known as fraud proofs. Several applications leverage optimistic rollups such as Arbitrum, Boba, Cartesi, and Optimism.
  • Zero-knowledge rollups (ZK-rollups): ’roll up’ many off-chain transactions into a single verifiable batch with a zk-SNARK, a special cryptographic proof. These small validity proofs are then efficiently posted to the base blockchain. Applications that use ZK-rollups include Immutable X, Starkware, and Polygon Hermez.
Source: Shutterstock
Source: Shutterstock

Bitcoin Layer 2 Scaling Solutions

The Lightning Network

The Lightning Network is one of the best-known Layer 2 solutions for the bitcoin network. The Lightning Network uses smart contracts to establish off-chain payment channels between pairs of users. Once these payment channels are established, funds can be transferred between them almost instantly. The final balance is only reported back to the main bitcoin blockchain once the channels are closed.

As the name suggests, this Layer 2 solution promises lightning-fast payment transactions on the bitcoin blockchain. The current bitcoin network processes around 7 transactions per second (TPS), but can vary greatly if the network is congested. The Visa network handles around 1,700 TPS on average. The Lightning Network processes transactions off-chain much more quickly and cheaply than bitcoin’s core blockchain - with fees typically around a fraction of a cent. The Lightning Network can theoretically handle millions of transactions a second. Notable Lightning Network applications include Walletofsatoshi, Strike, and Moon.

The most mainstream integration and adoption of the Lightning Network has been in El Salvador. After announcing Bitcoin as legal tender last year, the El Salvadorian government created Chivo, a Lightning-compatible wallet designed to enable seamless cross-border payments. Since its launch, Chivo has been used by over 4 million people.

Source: Shutterstock
Source: Shutterstock

Future State of Scaling

Layer 2s are a powerful new scaling paradigm and are expected to be the cornerstone of scaling blockchains in the short and medium-term. They have attracted huge excitement in the crypto community. There are many different choices in the Layer 2 design space, each with their own trade-offs. Therefore, different solutions may dominate for different applications and use cases. Much of the technology is still in its early stages and development is continuing rapidly, but critically they work well. With much more exciting work to come, the future of blockchains looks bright.

Recommended reading: What is a Layer 1 Blockchain?

Disclaimer: This assessment does not consider your personal circumstances, and should not be construed as financial, legal or investment advice. These thoughts are ours only and should only be taken as educational by the reader. Under no circumstances do we make recommendation or assurance towards the views expressed in the blog-post. The Company disclaims all duties and liabilities, including liability for negligence, for any loss or damage which is suffered or incurred by any person acting on any information provided.

Share this article
Stay up to date
Exclusive market analysis from our expert team of brokers and traders, delivered weekly.
Cookie Settings