Layer 1 vs Layer 2

Gwjm...N94y
30 Jan 2024
65

Layer 1 vs Layer 2 : What you need to know about different Blockchain Layer solutions



Scalability is the need of the hour. If you have been involved in the crypto/blockchain space in any way, then you must have heard of “layer-1” and “layer-2” solutions. In this article, we will demystify these terms and explain the pros and cons of both these solutions.


Layer-1 vs Layer-2

Layer-1 is the term that’s used to describe the underlying main blockchain architecture. Layer-2, on the other hand, is an overlaying network that lies on top of the underlying blockchain. Consider Bitcoin and Lightning Network. Bitcoin is the layer-1 network, while the lightning network is layer-2. Now that we know the core difference let’s look at the layer-1 and layer-2 solutions that companies are currently working on. We will start with layer-2 solutions.


Layer-2 Solutions

Let’s look into the following layer-2 solutions:

  • State channels.
  • Nested blockchains.



State Channels

A state channel is a two-way communication channel between participants, which enables them to conduct interactions, which would typically occur on the blockchain, off the blockchain. Doing this helps in cutting down the waiting time since you are no longer dependent on a third party like a miner. This is how a state channel works:

  • A portion of the blockchain is sealed off via multi-signature or some sort of smart contract, which is pre-agreed by the participants.
  • The participants can directly interact with each other without submitting anything to the miners.
  • When the entire transaction set is over, the final state of the channel is added to the blockchain.



Bitcoin’s Lightning Network and Ethereum’s Raiden Network are the two most popular state channel solutions. Both of these utilize Hashed Timelock Contracts (HTLCs) to execute state channels. While Lightning Network allows participants to conduct a large number of microtransactions in a limited time period, the Raiden will enable participants to run smart contracts through their channels as well.

Nested Blockchains



Currently, OmiseGO, an Ethereum-based dApp, is working on a nested blockchains solution called Plasma. The design principle of plasma is pretty straightforward:

  • The main, base blockchain is going lay down the ground rules of this entire system. It will not directly take part in any operations unless it needs to resolve some disputes.
  • There will be multiple levels of blockchains sitting on top of the main chain. These levels will be connected to each other to form a parent-child chain connection. The parent chain delegates work amongst its child chains. The child chains then execute these actions and send the result back to the parent chain.
  • Not only does this solution significantly reduce the load in the root chain, but, if executed properly, it will increase scalability exponentially.




Layer-2 Solution Pros

  • The biggest pro is that it doesn’t mess with the underlying blockchain protocol.
  • Layer-2 solutions like state channels, and particularly lightning network, to conduct multiple microtransactions without wasting time with miner verification and paying unnecessary transaction fees.




Layer-1 Solutions

Finally, we have the layer-1 solutions. What this essentially means is improving the base protocol itself to make the overall system more scalable. The two most common layer-1 solutions are:

  • Consensus protocol changes.
  • Sharding.


Consensus protocol changes

Many projects like Ethereum are moving on from older, clunkier consensus protocols like Proof-of-Work (PoW) to faster and less wasteful protocols like Proof-of-Stake (PoS). Bitcoin and Ethereum both use PoW, wherein miners solve cryptographically-hard equations by using their computational power. While PoW is pretty secure, the problem is that it can be very slow. Bitcoin only manages 7 transactions per second, while Ethereum can only manage 15–20 on a good day. This is why Ethereum is looking to change over from PoW to PoS (via the Casper protocol).


Sharding

Sharding is one of the most popular layer-1 scalability methods that multiple projects are currently working on. Instead of making a network sequentially work on each and every transaction, sharding will break these transaction sets into small data-sets called “shards.” These shards can then be parallelly processed by the network

Layer-1 Solution Pros

The biggest pro is that there is no need to add anything on top of the existing architecture. However, it’s still not without its problems, which leads us to the next section.

The Biggest Problem with both Layer-1 and Layer-2

There are two significant issues with Layer-1 and Layer-2 scalability solutions.
Firstly, there us a big problem with adding these solutions to already existing protocols. Ethereum and Bitcoin both have multi-billion dollar market caps. Millions of dollars are traded every single day using these two cryptocurrencies. This is why it doesn’t make sense to add unnecessary codes and complications to experiment with these protocols and play around with so much money.
Secondly, even if you create a protocol from scratch, which has these techniques built-in, they can still fail to solve the scalability trilemma.


The term “scalability trilemma” was coined by Ethereum founder Vitalik Buterin. It is a trade-off that blockchain projects must make when deciding on how to optimize their architecture, by balancing between three of the following properties — decentralization, security, and scalability. Eg. Bitcoin wants to optimize security and decentralization, which is why they end up compromising on scalability.

So, What’s the Solution?

The solution is to build a protocol from scratch with these solutions built-in. Plus, it should also be able to solve the scalability trilemma. Turing award winner Silvio Micali is building a project called “Algorand,” which is trying to do precisely that. Algorand uses a consensus protocol called Pure Proof of Stake (PPoS).


During PPoS:

  • The leader and selected verifiers (SV) are chosen from each step of the Byzantine Agreement.
  • The computation cost a single user faces only involves generating and verifying signatures and simple counting operations.
  • The cost is not dependent on the number of selected users for each block. This number is constant and unaffected by the size of the whole network.
  • Increasing computational power directly improves performance, which makes Algorand perfectly scalable. This means that as the network increases in size, it sustains a high transaction rate without incurring extra costs.



Conclusion

Scalability is the biggest reason inhibiting the mainstream adoption of cryptocurrencies. To make sure that cryptocurrencies are scalable and fast enough for day-to-day transactions, we need protocols that have been built specifically to solve this problem. This is why projects like Algorand are critical, and we can only hope that other projects follow suit and provide a viable solution.



Get fast shipping, movies & more with Amazon Prime

Start free trial

Enjoy this blog? Subscribe to ilhanhurdogan

6 Comments