What is a Layer 2 Blockchain? | Horizen Academy (2024)

The scalability trilemma is a persistent problem that has plagued blockchain developers ever since the Bitcoin blockchain was launched in 2009.

Amongst the many solutions that have been tested over the years, bigger block sizes, alternative consensus mechanisms, more sophisticated mining hardware, etc, layer two networks have stood out as the most elegant solution for enabling blockchains to scale without compromising on decentralization.

Key Takeaways - Layer 2

  • A Layer 2 is a scaling solution that sits on top of a layer 1 blockchain like Bitcoin or Ethereum. Layer 2’s (or L2s) increase the speed and reduce the cost of transacting on a blockchain.
  • Layer 2’s exist to address the scalability challenges of L1 networks, particularly the issue of high gas fees during times of network congestion.
  • Layer 2 scaling solutions can take different forms, including payment channels, state channels, sidechains and rollups.
  • Some potential drawbacks of L2 networks is that the withdrawal times from an L2 to the Ethereum mainnet can sometimes take several hours to 7 days to complete.
    • Also, Layer 2s compromise on decentralization and security in order to achieve speed, which can make it more risky to store funds on them.

What is Layer 2 Scaling?

A Layer 2 is a scaling solution that sits on top of a layer 1 blockchain like Bitcoin or Ethereum. Layer 2’s (or L2s) increase the speed and reduce the cost of transacting on a blockchain by setting up separate networks or channels where transactions can be executed between a limited set of nodes or participants, thereby reducing the time it takes to achieve consensus.

Transactions from layer 2 networks are batched together every so often and transmitted back to their base layer 1 network, where they are validated by the layer 1 node as a single transaction.

This modular design enables the layer 1 network to prioritize decentralization and security, while the layer 2 can focus on speed and scalability.

Off-chain Scaling

Layer 2’s are also seen as off-chain scaling solutions because the transaction execution process happens off of the layer 1 blockchain.

This means that the layer 2 network does not have to be a separate blockchain, it can simply be a payments channel for transferring funds between 2 or more participants using smart contacts, or even a centralized network where participants agree to trust each other instead of relying on code to enforce trust.

The key objective of layer 2’s is speed and scalability, which means it can explore a variety of designs that are not limited to the need for decentralization, as long as the data is communicated to the Ethereum mainnet at some point in order to reinforce its security.

Why is Layer 2 Needed?

Layer 1 Scalability Challenges

While layer 1s like Ethereum offer a highly decentralized infrastructure for developing secure and censorship resistant applications, the network has been marred by high gas fees during times of network congestion, which is a direct result of its inability to scale while relying solely on an L1.

High gas fees are a costly deterrent for users trying to perform transactions on dapps. They also undermine the value proposition of blockchains as a tool for making cheaper and faster payments.

Users who leave centralized payment services like Paypal because of their 3% fees are no better off if they have to spend $200+ to make a single transaction on Ethereum.

Layer 2 solutions like Polygon, Arbitrum, Loopring and Optimism currently exist on Ethereum to mitigate some of these scalability challenges.

They allow users to transfer their ETH to these networks in order to transact on many of the same Dapps available on the Ethereum mainnet, but for much lower gas fees.

What are the Differences Between Layer 2 and Layer 0?

A layer 0 is a type of protocol that enables developers to launch multiple layer 1 blockchains that are connected to the L0 mainchain, but operate independently.

Each layer 1 blockchain on a layer 0 can potentially operate its own set of L2 networks in order to scale its underlying infrastructure.

Layer 0 protocols are designed to give developers greater flexibility in how they design dapps by allowing them to also control the underlying infrastructure of their dapps, via their own blockchain.

Layer 0 networks are also optimized for cross-chain interoperability, as it becomes easier for the various L1s connected to a single mainchain to speak with one another.

By contrast, layer 2 networks exist primarily to scale a single layer 1 network. Increased protocol flexibility and cross-chain interoperability are not the core focus of an L2.

Types of Layer 2 Scaling Solutions

A layer 2 scaling solution can be designed as a payment or state channel for processing transactions between 2 participants using smart contracts, or as an entirely separate network (or sidechain) with its own set of validator nodes.

Payment Channels

A payment channel is a two way channel that runs between 2 participants and exists entirely off-chain. Two users can form a payment channel by each locking a certain amount of tokens in a smart contract on-chain.

We can think of this like an escrow account.

Locking the funds in a smart contract initiates the channel to open, allowing both parties to send tokens to each other as long as the total amount spent by either participant remains under the amount that is locked in their smart contract.

Each time tokens are transferred from one person to another, the current state of each person's account is also shared. We can think about this like the transferring of IOU’s between 2 banks that each hold a certain amount of capital in their accounts that has been verified by both banks.

Within the payment channel, the IOUs will be accepted as money because both parties know that they have enough assets locked away for their IOUs to be redeemed in full when necessary.

To close out the channel, a user can submit the latest state update (i.e the final balance of both users accounts) to the L1, which validates this entry as a single transaction on the blockchain.

What is a Layer 2 Blockchain? | Horizen Academy (1)

Payments made with an L2 channel are much faster because they don’t require broad network consensus to verify.

They are also much cheaper because users only need to pay a fee to the L1 when locking their funds in a smart contract to open the channel, and when submitting the final balances to the L1 in order to close the channel.

Payment channels can also be set up using a multisig-wallet.

With the multisig approach, each user holds a portion of the private keys to a wallet that stores their locked funds and mediates transactions within the payment channel. This ensures that both parties must provide a digital signature to authorize funds to be spent from that wallet.

Payment channels can be set up for one-off transactions or kept open for extended periods of time to allow participants to transact with each other off-chain, and periodically post the current state of the channel to the L1 when a user wants to withdraw some of their funds.

Lightning Network

Lightning Network is the most popular example of an L2 payment channel for the Bitcoin blockchain.

What is a Layer 2 Blockchain? | Horizen Academy (2)

State Channels

State channels are a more generalized form of payment channels. They enable participants to conduct more complex operations than sending simple payments back and forth.

An example of an operation that could be conducted in a state channel is a game of tic-tac-toe between 2 users, where the ‘game logic’ contains the rules of the game and the ‘state logic’ records the current state of the game while also determining where the funds locked in the smart contract should go based on the final outcome.

Like a payments channel, fees are only incurred to open and close the channel, and any transactions that occur between users within the channel are essentially instantaneous and free.

What is a Layer 2 Blockchain? | Horizen Academy (3)

This state channel mechanism makes it possible for play-to-earn games and other dapps that are not strictly financial to be launched on an L2.

Sidechains

Unlike payment or state channels, Sidechains are independent blockchains with their own set of validator nodes. Sidechains will normally have fewer nodes than the L1 mainchain, which allows them to achieve consensus faster.

A developer might adopt a sidechain over a payment or state channel if they need even more flexibility and control over their underlying infrastructure.

This could be for the purpose of launching a token or dapp while still taking advantage of the low cost and faster speeds enabled by not deploying smart contracts directly on the L1.

Sidechains operate using their own consensus mechanism, which means developers can optimize their network for scalability, security or decentralization, and can even choose to make their networks private and permissioned or public and permissionless.

While sidechains are not required to submit state data to the mainchain, many still choose to do so in order to leverage the larger, more decentralized chain's security.

Rollups

The two main methods of transferring value between L2s and the Ethereum mainnet are Optimistic Rollups and zk-Rollups.

Both offer different approaches for the Ethereum mainnet (consensus layer) to confirm the true state of operations on the execution layers (i.e., account balances and total values in each L2) without the need to validate every single transaction.

Optimistic Rollups

Optimistic rollups submit transaction data to the Ethereum network and leverage a dispute resolution system for detecting fraudulent transactions to ensure that all submitted transactions are valid.

The party responsible for submitting batches of transactions to the Ethereum network must post a bond of ETH that can be taken away, or slashed, if their submission is discovered to be fraudulent.

Zero-Knowledge (ZK) Rollups

A Zero-Knowledge Proof, or ZKP, is a form of cryptography that enables one party in a transaction (the prover) to prove that they have knowledge of a specific piece of information to another party (the verifier) without revealing what that information is.

This technology has many advantages not only in protecting users’ sensitive data, but also in simplifying how nodes communicate to enable blockchain networks to confirm transactions with greater efficiency and become more scalable.

Zero-Knowledge Rollups or zk-Rollups enable thousands of layer 2 transactions to be bundled into one transaction, and then be transmitted and validated by the Ethereum network without the Ethereum nodes knowing the details of each transaction.

Zk-Rollups leverage ZK-SNARKs to offer greater scalability to the Ethereum network by only requiring the Ethereum nodes to verify the proof of computation of batches of transactions rather than verifying each transaction on the Ethereum mainnet or L1.

Ethereum L2 ZK-Rollups

ZK-Rollups enable faster settlement of L2 transactions on the Ethereum L1 using only proof of computation. The Ethereum network must verify proof of computation for batches of L2 transactions.

This requires submission of some limited information about each transaction to the the Ethereum network, which reduces scalability

L2s are considered off-chain scaling solutions for Dapps. They are not independent blockchains and therefore are less secure and rely on the Ethereum network for final transaction settlement

Drawbacks to Layer 2 Scaling

Withdrawals from layer 2 networks to the Ethereum mainnet can sometimes take several hours to 7 days to complete. Optimistic rollups experience the longest withdrawal times because it takes a while for verifiers to determine if there is any fraud in the transactions submitted to the network.

Layer 2s also compromise quite heavily on decentralization and security, however this is mostly mitigated by the fact that there are security guarantees provided by the Ethereum L1.

Meaning, in the event of an exploit, users will always be able to recover their funds based on the most recent state of the L2 network that was validated on the Ethereum mainnet.

Nevertheless, sidechains like Polygon carry greater security risks because they operate as independent blockchains which have a native token for rewarding their own set of validators.

Because sidechains are independent, the security guarantees provided by the Ethereum L1 are not automatically applied to the protocol in the same way that it is for a payment or state channel.

This means that if a sidechain does not choose to periodically submit state data to the Ethereum mainnet, it could incur permanent loss of user funds if it were ever 51% attacked, as there would be no alternative network carrying validated proof of its most recent state prior to the attack.

Despite the risks of increased centralization, layer 2s offer a more cost effective and faster alternative for developers and end users to interact with the blockchain, thereby enabling layer 1s like Bitcoin and Ethereum to increase user adoption without compromising on decentralization at the base protocol layer.

As long as layer 2 networks continue to leverage the security of the underlying L1, the risks of hacks can mostly be mitigated by the knowledge that the most recent data of the L2 network's state is backed up on a more decentralized and secure blockchain.

Frequently Asked Questions - Layer 2

What are the Differences Between Layer 2 and Layer 1?

Layer 2 is a scaling solution that sits on top of a layer 1 like Bitcoin or Ethereum. L2s increase the speed and reduce the cost of transacting on an L1 by setting up separate networks or channels where transactions can be executed between a limited set of nodes or participants, thereby reducing the time it takes to achieve consensus.

L2 networks rely on the underlying L1 for security, meaning that all transactions that occur on the L2 network must eventually settle on the larger, more decentralized L1.

What are Rollups?

A rollup is a technique used to transfer value between L2 networks and the Ethereum mainnet. With rollups, transactions from layer 2 networks are periodically batched together and transmitted back to the base layer 1 network, where they are validated by the layer 1 node as a single transaction.

Optimistic and zk-Rollups are 2 variations of the rollup technique that each take a different approach to securely and accurately submitting state data from the L2 to the L1 without the need for the L1 to validate every single L2 transaction.

What are the Most Popular Layer 2 Networks?

Polygon, Arbitrum, Loopring and Optimism are among the most popular L2 networks.

These networks feature many of the most popular dapps on the Ethereum blockchain, including Uniswap, Opensea, the Sandbox and more.

What is a Layer 2 Blockchain? | Horizen Academy (2024)

FAQs

What is a Layer 2 Blockchain? | Horizen Academy? ›

A Layer 2 is a scaling solution that sits on top of a layer 1 blockchain like Bitcoin or Ethereum. Layer 2's (or L2s) increase the speed and reduce the cost of transacting on a blockchain.

What is layer 2 in blockchain? ›

Layer 2 refers to a secondary framework or protocol that is built on top of an existing blockchain system. The main goal of these protocols is to solve the transaction speed and scaling difficulties that are being faced by the major cryptocurrency networks.

What is Layer 2 simplified? ›

Layer 2 solutions are secondary frameworks or protocols built atop a pre-existing blockchain (the “Layer 1”). They facilitate faster transactions or offer more functionality than what could be achieved directly within the main blockchain.

What is the blockchain 2.0 all about? ›

The concept of blockchain 2.0 was the extended version of blockchain 1.0 for more interesting application known as Smart Contracts as shown in Fig. 1. It can be defined as an automated computerized protocol which is used to digitally facilitate, verify, or apply the agreement for the performance of a legal contract.

What is layer 2 used for? ›

Layer 2 is equivalent to the link layer (the lowest layer) in the TCP/IP network model. Layer2 is the network layer used to transfer data between adjacent network nodes in a wide area network or between nodes on the same local area network.

What do layer 2 blockchain solutions provide? ›

Layer 2 solutions, often referred to simply as "Layer 2", are a set of secondary protocols built on top of an existing blockchain (the primary being Layer 1). The primary goal of these solutions is to increase transaction throughput and efficiency, thereby addressing scalability issues that many blockchains face.

What is layer 2 example? ›

Generalized Layer 2 networks offer blockchain-like features with more scalability than the mainnet, faster transaction settlement, and lower fees. For example, Arbitrum One and Optimism are generalized L2s. Application-specific layer 2s are chains that are specialized in optimizing a specific type of application.

What does a layer 2 blockchain inherit from the main chain? ›

A Layer 2 network refers to an off-chain network or technology that's built on top of a Layer 1 blockchain. Typically, a Layer 2 acts as a separate blockchain that extends the underlying Layer 1 blockchain and inherits its security guarantees.

What is the difference between Layer 2 and blockchain? ›

Layer 1 refers to a base blockchain protocol, (e.g., Bitcoin or Ethereum) while layer 2 refers to a third-party protocol built to have integrated functionality with that base blockchain.

Why is blockchain so special? ›

Decentralized network: Blockchain spreads its data across many computers, so hackers can't gain anything from attacking one single place. The network also eliminates the need for a middleman. This decentralization makes transactions more transparent and trustworthy.

What is the difference between blockchain 1 and 2? ›

Layer-1 is the term that's used to describe the underlying main blockchain architecture. Layer-2, on the other hand, is an overlaying network that lies on top of the underlying blockchain. Consider Bitcoin and Lightning Network. Bitcoin is the layer-1 network, while the lightning network is layer-2.

What is an example of L2 blockchain? ›

Layer 2 – Sub-Blockchains (or software upgrades)

Because they use infrastructure from Layer 1 blockchains, they are more scalable and efficient. For example, Ethereum has L2 blockchains Polygon, Arbitrum, and Optimism, which are faster and cheaper. However, they are more centralized because of their smaller size.

What is the advantage of Layer 2 blockchain? ›

Advantages of Layer 2 Blockchains: Scalability: Layer 2 solutions can significantly increase transaction throughput and reduce congestion on the main blockchain, making it possible for more transactions to be processed per second.

What is the fastest Layer 2 blockchain? ›

1. Arbitrum. Any Layer 2 crypto-list must start with Arbitrum. Based on Optimistic Rollups, Arbitrum can process transactions up to 10 times quicker than Ethereum's mainnet and save up to 95% on gas expenses.

What is layer 2 and Layer 3 in blockchain? ›

Layer 1 is the core architecture, Layer 2 adds functionalities, and Layer 3 hosts applications built on these functionalities. These layers differ in key aspects, such as consensus mechanisms, scalability solutions, transaction speed & price, and security features.

What is Layer 1, layer 2, and layer 3 blockchain? ›

Layer 1 maintains dispute resolution, consensus mechanisms, and blockchain programming (e.g., Bitcoin, Ethereum). 3. Layer 2 offers better scaling capabilities and third-party integration. 4. Layer 3 hosts decentralized applications (dApps) and user-facing applications.

What is Layer 1 and layer 2 in blockchain? ›

Layer 1 refers to a base blockchain protocol, (e.g., Bitcoin or Ethereum) while layer 2 refers to a third-party protocol built to have integrated functionality with that base blockchain. There, that's it. If you wanted a high-level overview, that's pretty much all you needed to know.

Top Articles
BDO reports Global revenues rise to US$7.6 billion
5 Things to Know About Schwab Bank
What Did Bimbo Airhead Reply When Asked
Fernald Gun And Knife Show
Cranes For Sale in United States| IronPlanet
Weeminuche Smoke Signal
How To Get Free Credits On Smartjailmail
Craigslist Nj North Cars By Owner
2013 Chevy Cruze Coolant Hose Diagram
Max 80 Orl
Weekly Math Review Q4 3
What Is A Good Estimate For 380 Of 60
Indiana Immediate Care.webpay.md
Explore Top Free Tattoo Fonts: Style Your Ink Perfectly! 🖌️
Rhinotimes
Nene25 Sports
Colorado mayor, police respond to Trump's claims that Venezuelan gang is 'taking over'
Craiglist Tulsa Ok
Napa Autocare Locator
Powerball winning numbers for Saturday, Sept. 14. Check tickets for $152 million drawing
Talbots.dayforce.com
Amazing deals for DKoldies on Goodshop!
Missed Connections Inland Empire
Pokemon Unbound Shiny Stone Location
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Aes Salt Lake City Showdown
Wnem Tv5 Obituaries
Raw Manga 1000
Roanoke Skipthegames Com
Keyn Car Shows
Skymovieshd.ib
Medline Industries, LP hiring Warehouse Operator - Salt Lake City in Salt Lake City, UT | LinkedIn
Mercedes W204 Belt Diagram
Wisconsin Volleyball Team Leaked Uncovered
What Is Xfinity and How Is It Different from Comcast?
1987 Monte Carlo Ss For Sale Craigslist
Shnvme Com
Devotion Showtimes Near Mjr Universal Grand Cinema 16
CVS Near Me | Somersworth, NH
Case Funeral Home Obituaries
Alpha Asher Chapter 130
Prior Authorization Requirements for Health Insurance Marketplace
2023 Fantasy Football Draft Guide: Rankings, cheat sheets and analysis
Updates on removal of DePaul encampment | Press Releases | News | Newsroom
Bill Manser Net Worth
Random Animal Hybrid Generator Wheel
Brown launches digital hub to expand community, career exploration for students, alumni
Displacer Cub – 5th Edition SRD
Hampton Inn Corbin Ky Bed Bugs
Naughty Natt Farting
Heisenberg Breaking Bad Wiki
Latest Posts
Article information

Author: Fredrick Kertzmann

Last Updated:

Views: 6410

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Fredrick Kertzmann

Birthday: 2000-04-29

Address: Apt. 203 613 Huels Gateway, Ralphtown, LA 40204

Phone: +2135150832870

Job: Regional Design Producer

Hobby: Nordic skating, Lacemaking, Mountain biking, Rowing, Gardening, Water sports, role-playing games

Introduction: My name is Fredrick Kertzmann, I am a gleaming, encouraging, inexpensive, thankful, tender, quaint, precious person who loves writing and wants to share my knowledge and understanding with you.