What is a Layer2?

Tokuji.Club NFT
4 min readOct 20, 2022

--

A layer 2 refers to any off-chain network, system, or technology built on top of a blockchain (commonly known as a layer-1 network) that helps extend the capabilities of the underlying base layer network. Layer-2 networks can support any blockchain to introduce enhancements such as higher transaction throughputs.

One core requirement for a network, system, or technology to be considered a layer 2 is that it inherits the security of the blockchain it is built on top of. Transaction data must be verified and confirmed by the underlying blockchain network rather than a separate set of nodes.

For example:

Sidechains are often not considered layer 2s because they usually deploy their own consensus mechanisms and validators, leading to a different set of security guarantees than the base layer chain.

Although sidechains and Layer 2 chains are often considered synonymous, their only similarity is that they function as independent networks with an interface to Layer 1. Like a Layer 1 chain, a sidechain has its own validators and consensus method for adding blocks. This means it is viable only if a sufficient number of validators are on board and its consensus mechanism is secure.

For blockchains that sacrifice scalability to achieve higher decentralization and security, layer 2s enable greater transaction throughput, which can lead to lower fees. Layer 2s can be seen as one solution to the problem of scalability, enabling fast and scalable execution without compromising on decentralization or security.

Other chains:

Plasma chains: Like sidechains, plasma chains have their own consensus algorithm and create blocks of transactions. Plasma provides a framework for building Layer 2 chains on Ethereum. At a fixed interval, a compressed representation of each block is committed to a smart contract on Ethereum.

State Channels (Payment Channels): With state channels, crypto is deposited in a multi-signature smart contract on Layer 1, and a connection is opened between two parties. Payments are made on Layer 2, and when completed, a ticket is signed on Layer 1. State channels can be bi-directional and also handle another party if channels have previously been opened. Bitcoin’s Layer 2 Lightning chain uses state channels (see Lightning Network).

Rollup Chains: Rollup chains accumulate and settle transactions. At some interval, a summary of the transactions is “rolled up” into a cryptographic proof and posted on the main Layer 1 chain. Optimistic Rollups assume people are honest but transactions can be disputed (see Optimism). Zero-Knowledge Rollups (ZK Rollups) provide proof without divulging every detail (see zero-knowledge proof).

The Need for Layer 2s

Since the emergence of blockchain technology in 2008, thousands of researchers and developers have worked to solve pressing limitations in blockchain scalability to match growing adoption. These limitations have historically resulted in high fees and slow execution times, diminishing the ability of blockchains to operate at scale.

Coined by Ethereum Co-founder Vitalik Buterin, the blockchain scalability trilemma posits that blockchains are incapable of scaling effectively while keeping the underlying network both secure and decentralized. Instead, there must be tradeoffs between these three features — today’s blockchain networks can fulfill two out of the three conditions, but not all three simultaneously.

Layer 2s are an emerging technology built on the premise that this scalability limitation exists because blockchains are tasked with too many things. This is because blockchains today fulfill three core functions:

  • Execution — transaction processing and throughput. Measured by the number of computations (of which transactions are a subset) per second a blockchain can process.
  • Data Availability — storage requirements for nodes and validators on the network for transactions, state, and other data. Measured in standard storage terms such as megabytes, gigabytes, etc.
  • Consensus — broad agreement by nodes and validators on the state of the network and ordering of transactions. Measured in terms of decentralization and time-to-finality, or the time it takes for all nodes to agree on a particular state change.

How Layer-2 Solutions Work

Layer-2s typically have two parts: A network that processes transactions and a smart contract on the underlying blockchain that resolves any disputes and achieves consensus on the state of the layer-2 network by cementing it to an underlying blockchain.

Layer-2 networks are where fast execution of transactions and computations occur. They can vary wildly in how they achieve this throughput. A common denominator between each layer-2 environment, however, is that when looking to settle on the base chain, layer 2s must provide some kind of cryptographic and verifiable “proof” to the blockchain on the integrity of the proposed state change, either preemptively or retroactively.

Similarly, the underlying smart contract implementation can vary between layer 2s, but the core functions of the smart contract are always to:

  1. Hold and release funds transferred to the layer 2
  2. Receive some kind of proof generated by the layer 2, validate it, resolve disputes, and then finalize transactions

Scaling Blockchains

Layer 2s in a larger sense are all methods of approaching the blockchain scalability problem in a sustainable and long-term-oriented manner — supporting both the growing adoption of Web3 applications and enhanced user experience.

As a nascent and continually developing technology, most Web3 infrastructural components, including base blockchains and layer 2s, have yet to reach the inflection point where it is definitively known which approach best suits the needs of the market. However, thousands of developers and researchers continue to work tirelessly to find viable solutions via the expansive ecosystem of blockchain networks, DAG solutions, and layer 2s that exist today in order to bring the promises of Web3 to the forefront of society.

--

--

Tokuji.Club NFT

Enter the temple, and become an exclusive member of our clan ⛩️ | Utility-based NFT collection | https://www.tokuji.club/