What is Layer2? The key to Layer1’s expanding ambitions (Part1)

The scalability trilemma is a persistent problem that has plagued blockchain developers ever since the Bitcoin blockchain was launched in 2009. Layer2 is the best solution for this iusse.

Definition

Layer1 Explained

To start, we need to define what a layer 1 is?

A layer 1 network is the base layer, or the underlying infrastructure of a blockchain. Also known as the main network or “mainnet,” it not only defines the core rules of the ecosystem, but can also validate and finalize transactions, as seen with examples like Ethereum, Bitcoin and Solana.

Layer 1 blockchains often start with an emphasis on decentralization and security – both of which are core tenets of any sound network and (with some exceptions) are maintained by a diverse, global network of developers and participants like validators.

Layer2 Explained

Like the second floor of a house, a Layer 2 network is a secondary protocol built on top of an existing blockchain (Layer 1). Therefore, Layer2 inherits the properties of layer1 for extensibility purposes.

The main goal of Layer2 is to solve the transaction speed and scaling difficulties that are being faced by the major cryptocurrency networks.

Particular, by moving transactions off-chain to a separate network, this additional layer can significantly increase the network’s capacity and reduce congestion. Basically, this dramatically improves the user experience by giving us faster blockchains and reduced gas fees, solving Vitalik Buterin’s iconic blockchain trilemma.

Most importantly, all application Layer2 networks operate an EVM (Ethereum Virtual Machine), which makes it easy to deploy Ethereum-based smart contracts, algorithms, and dApps on faster networks. Besides, these protocols also enjoy the security and consensus of the underlying blockchain. Layer 2 networks offer a way to scale blockchain networks without compromising their core principles of security, decentralization, and trustlessness.

Especially, layer 2 is not only for Ethereum, but also any blockchain that wants to meet user needs on a larger scale, such as Bitcoin, BNB Chain…

The reason why Layer2 is important

Because Layer1 is a priory of decentralization and security in design, not to mention the immense resources it takes to maintain a fully functional ecosystem, it has often lacked scalability.

Therefore, the network’s capacity is over 1.5 million daily transactions. Furthermore, as the mainnet can only process around 15 transactions per second, periods of high network activity often lead to data congestion. This, in turn, causes gas (transaction fees) to rise and slows the performance of applications.

To combat these issues, layer2 extends Ethereum as a separate blockchain above the layer1 network. As mentioned, it communicates and helps offload the heavy burden of transactions from the mainnet through smart contracts that integrate and benefit from Ethereum’s robust decentralized security model. In essence, Layer1 handles security, data availability and decentralization, while layer2 handles scaling related to transactions.

Layer2’s operating mechanism

Layer2 protocols provide a second framework where transactions can take place separately from layer1. This means that a decent amount of the work that would be performed by the main chain can be moved to the second layer. Layer2 applications then post the data of transactions to layer1 where it’s secured in the blockchain ledger and history.

As with any other open or closed platforms, layer2s also vary in accessibility. Some can be used by a range of applications, while others only cater to the whims of a specific project. That said, several of the key components that layer2s leverage include rollups and sidechains.

Types of Layer2 scaling solutions

Payment channels 

A payment channel, like an escrow account, 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 number of tokens in a smart contract on-chain.

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.

Especially, payments made with layer2 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.

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

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.

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.

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 (account balances and total values in each L2) without the need to validate every single transaction.

Optimistic Rollups

Optimistic Rollups are Layer 2 solutions that achieve scalability through Optimistic Execution. These solutions process transactions off-chain while relying on the underlying blockchain for security and finality.

Optimistic Rollups allow participants to submit transactions to a Layer 2 chain without immediate verification. Instead, they rely on a fraud-proof mechanism that ensures the correctness of transactions.

Essentially, Optimistic Rollups work on the belief that everyone is behaving themselves. If a node is found to submit fraudulent transactions, they are penalized.

Examples of Optimistic Rollups: Optimism, Arbitrum, Boba…

zk-Rollups

zkRollups, or zero-knowledge rollups, use zero-knowledge proof systems to create faster, safer blockchains. In zkRollups, transaction data is compressed and submitted to the mainchain as a cryptographic proof rather than including every transaction detail.

These authentication proofs allow the Ethereum mainnet to verify the correctness of the transaction batch without needing to process each transaction individually. ZkProofing also gives users greater privacy by letting them validate information without needing to share sensitive data. In a world of privacy breaches and hacks, protecting data transmission is vital for internet protocols.

This approach significantly reduces the computational overhead and storage requirements on the mainnet while maintaining high security and privacy. zkRollups provide a promising solution for scaling blockchain networks by bundling multiple transactions into a single proof, enabling faster and more cost-effective transaction processing.

Examples of zk-Rollups: Polygon, zkSync, Starknet…

Conclusion

Layer 2 is an important solution to expand the Layer 1. Ethereum is currently leading the development of Layer 2 solutions, prominent among them is the Rollup solution. It is expected that the race between Layer 2 solutions is likely to be increasingly exciting in the future.