Understanding Layer 1 and Layer 2 Blockchain Solutions

Mieray Arotine
Geek Culture
Published in
4 min readJan 12, 2022

Blockchain technology has provided a solution for storing data securely and maintaining records without the need for intermediaries.

In order for blockchain technology to become a global solution, it must achieve the following fundamentals — decentralisation, security and scalability. This is where the blockchain trilemma comes in.

The blockchain trilemma is a balancing act between achieving the three fundamentals through the usage of various scaling solutions. The term scaling in blockchain refers to the number of transactions executed per second.

Currently, the blockchain trilemma is addressed through layer 1 and layer 2 solutions.

The difference in layer 1 and layer 2 scaling solutions depends on how the solution is applied. With layer 1, the solution is directly on the main blockchain as opposed to layer 2 solutions, which can be considered a blockchain ‘add-on’ or extension that facilitates the main blockchain’s growth.

Layer 1

The ability to enhance a blockchain’s performance directly comes mainly in two solutions, consensus protocol and sharding.

Consensus Protocol

Consensus protocol or consensus mechanism refers to how the blockchain approves and adds new blocks to the chain. There are two types of consensus protocols, proof-of-work and proof-of-stake.

Proof-of-work requires heavy computational power to effectively add new blocks of data on the blockchain. The Bitcoin blockchain runs on the proof-of-work consensus protocol; however, it has contributed to a massive energy crisis, resulting in Bitcoin mining bans in countries like China, Kosovo and Kazakhstan.

Proof-of-stake relies on validators who ‘lock up’ or stake their coins and are chosen at random to validate the new block before it gets minted or forged on the blockchain. Unlike proof-of-work that requires all miners to participate, proof-of-stake chooses their validators at random which helps this consensus protocol be much more energy and cost-efficient.

Sharding

Sharding is another layer 1 scaling solution; it is currently experimental, yet a popular layer 1 scaling solution. Sharding is a distributed database concept adapted for the blockchain in which the blockchain network is broken off into distinct datasets, known as shards.

This makes the blockchain more manageable as the nodes only have to manage their assigned shards. Shards can be processed simultaneously, allowing for numerous transactions and ultimately a greater processing capacity.

Layer 2

Layer 2 solutions work on top of a blockchain protocol to enhance its scalability and/or efficiency. The layer 2 solution takes on most of the processing burden, leaving layer 1 less congested and available for finalizing transactions. The various layer 2 solutions are described below.

Plasma

Plasma, also known as a nested blockchain, is a solution that provides additional blockchain layers to the main blockchain. Multiple layers can be added to the main blockchain.

Plasma allows the main blockchain to define the roles of the nested blockchains, relieving the operational burden making the main blockchain more efficient and scalable.

Once the parameters of the nested blockchains are defined by the main blockchain, each nested blockchain then gets linked to the main blockchain through a parent-child relationship. The main blockchain gets involved in the last stage of finalizing the transaction.

Rollups

Rollups are layer 2 blockchain scaling solutions that execute transactions off-chain; meaning, outside the main blockchain. The data still remains on the main layer 1 blockchain which makes rollups a secure layer 2 scaling solution.

There are two types of scaling solutions that are considered rollups, known as optimistic rollups and zero-knowledge rollups.

Optimistic rollups assume transaction validity by default, only processing validity should there be a challenge to detect fraud. Optimistic rollups can process more smart contracts without causing the main blockchain any additional strain while benefiting from the main blockchain’s security. Optimistic rollups increase transaction speed, but not as must as zero-knowledge rollups.

Zero-knowledge rollups run computations off-chain. The data is linked and collateralized by a smart contract on the main blockchain while the processing and computing happen off-chain. Then, the validity proof is submitted to the main blockchain. The term zero-knowledge comes from the data not being available to the verifiers. They know that the data is the same, however, the data itself is not disclosed.

Parachains

Parachains (short for parallel chains) are blockchains that run in parallel to each other with similar attributes and security and are connected to each other with a centralised relay chain.

The parachains can be used to address and execute different applications as they can run independently, resulting in a significant increase in scalability for the layer 1 blockchain.

State Channels

A state channel improves overall transaction capacity and scalability on the main blockchain by facilitating bilateral communication between off-chain transactional channels and the mainchain.

State channels are network-adjacent and are powered by multi-signature smart contracts. State channels sacrifice a degree of decentralization to achieve better scalability.

Once a batch of transactions is completed, the final state is then recorded on the main blockchain.

Sidechains

Similar to a state channel, a sidechain is a blockchain-adjacent solution.

Sidechains are usually used with large batch transactions as the consensus mechanism is independent of that on the main blockchain. Causing an improvement in processing speed and scalability and leaving the mainchain to confirm transactional records and maintain security.

Unlike state channels, sidechains maintain a public record of transactions. Should a sidechain be breached, this would not affect the other sidechains or the mainchain as sidechains are built from the ground up, requiring substantial effort to establish.

The layer 1 and layer 2 solutions described above are not mutually exclusive solutions. Oftentimes, a blockchain will utilise numerous scaling solutions to address the blockchain trilemma and aim to achieve true security, decentralisation and scalability.

If you liked this article, please consider clapping, following, and sharing. I appreciate you ❤

--

--

Mieray Arotine
Mieray Arotine

Written by Mieray Arotine

Passionate about all things blockchain and crypto. Giving you the tools you need to get ahead, get inspired and work towards financial freedom.