What is Layer 2 blockchain| What, why, types

Blockchain Jew
Coinmonks
6 min readJun 19, 2022

--

layer 2 blockchain
Layer 2 blockchain.

In a company where there is a division of labour; work is shared and carried out across different sections, saving time and making production scalable.

Just as division of labour is important in the economy; so it is in the blockchain. Most Layer 1 blockchains take time in carrying out transactions and some of them have horrible gas fees. (e.g Ethereum). This is where the Layer 2 scaling solution steps in; to make the transaction faster and cheaper.

Do you prefer to pay a fortune as gas fees to a blockchain that is slow, or would you rather move to one that is faster and cheaper? Definitely the latter.

What is Layer 2 blockchain?

The layer 2 blockchain is a secondary chain built on top of an existing blockchain (layer 1). The sole purpose of layer 2 is to increase all-around scalability in the blockchain ecosystem.

They help enhance the speed of transactions and make them relatively cheap. The layer 2 blockchain takes part of the transaction load from the main chain to its own off-chain protocol, once the network confirms the transaction, it is sent back to the mother chain (layer 1). This way, the main chain is less congested, and the transaction is completed faster.

Why we need the layer 2 blockchain
Layer 2 = Scalability.

Why we need layer 2

The blockchain is an amazing technology that changes the way we transact to a more decentralized, secure and transparent way; but a major issue is in the case of scalability. According to Vitalik Buterin (co-founder of Ethereum), the blockchain comprises three elements; Decentralization, Security and Scalability.

He says that no blockchain can sufficiently provide the trio and thus, each blockchain will have to sacrifice one element in order to operate optimally. For the top two blockchains; Bitcoin and Ethereum, scalability was the element that had to be sacrificed to make their network decentralized and secure.

Scalability in this context; is the ability of a blockchain to efficiently accommodate increasing loads of transactions as its ecosystem grows.

Ethereum is one of the most sophisticated, if not the most sophisticated blockchain, with different tokens and protocols being deployed almost every day. Due to its massive growth and adoption; thousands of transactions take place minutely, leading to congestion and gas war.

With the help of layer 2 blockchains; a portion of that congestion can be moved to the off-chain protocol, now you don’t have to wait hours before your transaction is completed.

A problem with Layer 2

Problems with Layer 2 Blockchains
Layer 2 and its problem.

Layer 2 actually solves the issues of blockchain scale, but as earlier stated; a blockchain consists of three elements; Decentralization, Security and Scalability. Most layer 1 blockchains focus more on security than scalability but layer 2 on the other hand focuses on scalability more than security.

Layer 2 operates as an off-chain protocol; meaning that when transactions are carried from the main chain to the auxiliary chain, it is no longer insured by the security of the main chain. In other words, you may have to trust that the Layer 2 blockchain is secure enough to process your transaction and report back to the main chain safely.

In the world of crypto; “trust” is not something that is fancied by the majority.

Since there are 3 elements and only two can be provided by a blockchain; a user is left with two options. Either use a Layer 2 that is scalable and secure but not decentralized or use a Layer 2 that is scalable and decentralized but not the best in terms of security.

Types of Layer 2 Blockchains

Sidechains: These are separate chains linked to the main chain via a bridge. The sidechain allows for assets to be transferred to and fro the main chain (two–way peg).

Basically, if a user wanted to send eth on the Ethereum network but couldn’t because of the high gas fees; they could easily bridge their eth to a sidechain like Polygon and transact with cheaper gas fees.

State Channel: State Channels permit users to transact as many times as possible while only submitting two on-chain transactions to the main chain.

The transactions between the involved parties are kept private by the state channel smart contract and only the first and final transaction is being recorded on the public ledger (main chain). With State Channels, users rely on a smart contract which oversees the overall off-chain transaction.

State Channels give users the opportunity to send and receive crypto without depending on or waiting for miners to validate their transactions; this means cheaper fees and quicker transactions.

Examples of state channels are; Lightning Network which allows users to carry out little transactions within a specific time frame and Raiden Network which allows parties to create smart contracts via their channels

Nested Blockchains: These are blockchains that are built within or on top of the main chain. Basically, it is part of the main chain; only that it is delegated the duty of executing transactions and reporting back to the main chain.

The communication mechanism between the main chain and the nested chain is likened to that of a parent and a child. The parent (main chain) assigns duties to the child (nested), the child on the other hand carries out these duties and reports back to the parent.

An example of a nested blockchain is the OMG Plasma which is built on top of the Ethereum blockchain to facilitate faster and cheaper transactions.

Rollups: Rollups take multiple transactions on the main chain and rolls them up to a single data and then periodically submit it back to the main chain. Rollups make transactions cheaper and faster.

According to Vitalik Buterin, scaling solutions like rollups will continue to play important roles in the Ethereum blockchain even after the launch of Eth 2.0.

There are two kinds of Rollups:

Optimistic Rollups: This rollup optimistically suggests that all transactions in the rollup are valid. Meaning that there is no bad player trying to manipulate the blockchain by double-spending.

Validators however have a week to check up on the rollup and ensure that there is no wrong or fraudulent data sent to the main chain. Examples of optimistic rollups are; Optimism and Arbitrum.

Zero-Knowledge Rollups:

Zero-Knowledge Rollups or Zk-rollups like every other rollup takes transaction from the main chain and rolls it up to one data. But unlike optimistic rollups, zk-rollups adopt a different validating mechanism known as Merkle Trees, which are complex maths that ensures that data can’t be forged or manipulated. Examples of Zk-rollups are Loopring and Immutable X.

Learn about the 4 Layers of the Blockchain in 1 minute

Summary:

1.) The Blockchain comprises three elements: Decentralization, Security and Scalability. Ethereum is decentralized and secure but not scalable.

2.) Layer 2 provides a scaling solution to the blockchain. Thus, making transactions faster and cheaper.

3.) Layer 1 blockchains are more secure than a Layer 2

4.) Side chains are independent chains connected to the main chain via a bridge. You can bridge your token from the main chain with high fees to a side chain with cheaper fees.

5.) State Channels create a smart contract where participants can carry out private transactions off-chain, only the first and final transaction is sent to the main chain ledger.

6.) Nested blockchains are blockchains that are built on the main chain and connect with the main chain on a parent-child relationship. The main chain (parent) assigns transactions to the nested chain (child). After confirming those transactions, it reports back to the main chain.

7.) Rollups are scaling solutions that take multiple transactions from the main chain and rolls them to one data before submitting it back to the main chain.

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--