What is a layer‑2 solution in blockchain?
Key points
- A layer‑2 (L2) solution is a protocol built atop a base blockchain (layer 1) to improve scalability.
- L2s are used with popular but throughput‑constrained platforms such as Ethereum and Bitcoin.
- An L2 is tightly integrated with the base network, with compatible smart contracts and cryptoassets.
- On Ethereum, moving funds between the mainnet and an L2 requires a cross‑chain bridge.
Why do layer‑2 solutions matter?
Blockchains face the “scalability trilemma”: it is hard to build a network that is simultaneously fast, decentralised and secure. Developers often optimise at most two of the three.
Early architectures—most notably Bitcoin and Ethereum—were not designed for high volumes of users and transactions, leaving them with low throughput. Bitcoin processes roughly 5–7 transactions per second (TPS); Ethereum about 15 TPS.
Scalability can be improved by changing the base protocol—eg via sharding—but such upgrades take time, can span years and alter core architecture, so communities do not always agree to them.
L2s address low throughput and high fees without touching the base chain’s code. Their chief virtue is enabling transfers between layer‑1 addresses while using a “second layer”, which can be an off‑chain protocol or a separate blockchain.
Which layer‑2s exist for Bitcoin?
The main L2 for the first cryptocurrency is the Lightning Network (LN). It operates via smart contracts and so‑called state channels. Launched in 2015, it has continued to develop; by late May 2022 total channel capacity reached 3,900 BTC.
LN’s core function is to let bitcoin holders transact directly without recording every transfer on the base chain. Users open a special channel via a single on‑chain transaction and deposit BTC into it.
Once active, the payment channel enables off‑chain transfers—outside the base network—at far higher speeds and lower fees. Unlike on‑chain transactions, operations within Lightning channels are visible only to the participants. Only the initial and final states are written to the main blockchain.
This approach sharply reduces load on Bitcoin’s base layer: Lightning can process thousands of operations per second while maintaining a high level of security.
How are Lightning Network payment channels secured?
Channels are verified by their participants via mutual smart contracts. When off‑chain exchanges conclude, the final state is recorded in a new block on the base chain. Smart contracts safeguard transactions within state channels and act as “judges” between participants.
Some channels use a timer that automatically updates or locks the on‑chain state. When the set period expires, the system triggers a final transaction, updates the base blockchain and closes the state channel using the last verified transaction. Any new attempt to unlock the channel generates new cryptographic data and restarts the timer.
Which layer‑2s exist for Ethereum?
Despite modest speed, Ethereum is the busiest platform for decentralised applications. Many leading projects in decentralised finance (DeFi) and non‑fungible tokens (NFTs) run on it, making scalability a pressing issue.
Several major L2s are developing in parallel:
The core enabling technology is Rollups, in two main flavours:
- Optimistic Rollups. Transactions execute on the L2, then are bundled into compact batches and submitted by validators to the Ethereum mainnet. Optimistic Rollups power Arbitrum and Optimism.
- ZK‑Rollups. Transactions on the second layer are also batched and posted to Ethereum, but they are confirmed using special verifiers that provide cryptographic proofs of validity. Polygon is built on ZK‑Rollups. Ethereum co‑founder Vitalik Buterin views this as the primary scaling technology for Ethereum.
Whatever the L2, Ethereum as the “first layer” handles transaction verification and block production, maintains the ledger of final states and provides the consensus mechanism. Projects therefore need not build their own infrastructure.
There are other L2 projects. For example, in July 2022 the startup Matter Labs announced the launch of zkSync 2.0. A month later, the StarkWare project launched its own protocol written in Cairo.
How do you move assets from layer 1 to layer 2?
To transfer cryptocurrencies from a layer‑1 blockchain to an L2 network, use cross‑chain bridges.
You will need a browser‑based Web3 wallet such as MetaMask or WalletConnect. Add the desired network in the wallet settings—for example, Optimism.
The project offers an official bridge. On the bridge site, choose the asset to transfer, enter the amount, confirm the transaction and receive the same tokens on the L2. There are also native bridges for Polygon and Arbitrum.
L2 tokens can be used much like “originals”—for transfers, trading on decentralised exchanges or in DeFi protocols. Most major applications support L2 assets. Uniswap has called this approach “multichain”.
Are sidechains layer‑2 solutions?
Sidechains used in ecosystems such as Cosmos or Polkadot are not L2s. The former use their own security, whereas the latter rely on a parent blockchain.
Further reading
What is a Bitcoin Improvement Proposal (BIP)?
Рассылки ForkLog: держите руку на пульсе биткоин-индустрии!