If you are into crypto & web3, you might have heard of these terms called L1, L0, and L2.
And there is sharding, plasma, rollups, and all that Layer 2 stuff being built on Layer 1 Ethereum. And then L2 protocols like Optimism and Arbitrum.
Then we have L0 tech like Polkadot. And then there are Layer 3 protocols also called Application Layers.
And then there are these scalability methods that are also being implemented like Sharding and Hard Forking to blockchains.
Now, the big question is: Why do we need these many layers aka Blockchain solutions? And what do each of these layers and scalability methods mean in the world of Blockchains?
We have a lot to cover. Grab a coffee and continue reading…
To understand why we need these solutions in the first place, we need to know what problems the current blockchains are facing. After all, these blockchains solutions are the solutions to these problems.
Vitilak Buterin, the creator of Ethereum coined this term called Scalability Trilemma (also called ‘Blockchain Trilemma’).
The concept behind it is that blockchains can achieve any two of these 3 qualities needed, thereby sacrificing any one of them to excel in the other two.
- Decentralization: Blockchains distribute control to all the participants, equally. No single entity or person will have the ability to manage or manipulate the chain.
- Security: Strong & sound technology to make it impossible for the chance of malicious attacks and hacks.
- Scalability: Blockchains should be usable by everyone in the world. And that means the transactions shouldn’t take much time and at the same time should cost a very less fee.
You can only pick vertex/two sides at a time. And that means you have to compromise on the other side:
If we map the scalability trilemma with the current blockchains:
- Bitcoin & Ethereum have true decentralization and high security. And that means no scalability (Which is why Ethereum is way too costly to use).
- Blockchains like Solana, Ripple, EOS, Binance Smart Chain, and other high TPS (Transactions Per Second) chains compromised on the decentralization part.
- On the other hand, IOTA, Veechain, and multichain ecosystems are examples of blockchains that compromised security to achieve decentralization and scalability.
As of now, only Algorand solved the blockchain trilemma.
Scalability is measured via throughput rate which equates to the number of transactions performed per second (TPS).
Just to put things in perspective, as of May 2022, Ethereum’s throughput rate is very low (15 TPS) and Solana’s throughput rate is very high (65,000 TPS).
Final Statement: Blockchains need to be decentralized, have high security, and allow more people to use them with low gas fees & low transaction times.
Blockchain Interoperability Problem
We have all these blockchains like Ethereum, Ripple, Solana, Avalanche, etc. Now, to enjoy the full benefits of these blockchain technologies, they need to interact with each other.
What does that mean? That means these blockchains should be able to talk to each other.
We have different blockchains that are built for different purposes.
Each blockchain process the transactions in a different way and different blockchains store data differently which makes it hard for these blockchains to communicate with each other.
And that is why we have cross-chain technology. This technology will enable the user to share data and trade tokens without using any intermediary, like bridges which are more prone to attacks.
Final Statement: Blockchains need to interact with each other.
Blockchain Composability Challenge
Defi is a good example to explain what composability is. If you look at all the Defi protocols and wallets that are built on Ethereum, each of these applications uses the core functions of Ethereum along with their own features for which they are built in the first place.
“Lego pieces” is the most used metaphor when it comes to describing composability. You can use lego pieces from other people’s work and use them to build your product.
If all the work that goes into building a system or application will only benefit that system, and can’t be reused by others, then it’s not ‘composable’.
In the case of Ethereum, if I am building a DApp on Ethereum and I want to manage token exchanges (something that decentralized exchanges do), I can take Uniswap‘s smart contracts and use them. It’s fully ‘Open Source’ and ‘Permissionless’.
And that’s what composability does to the whole ecosystem: It compounds the value. As Chris Dixon said: “Composability is to software as compounding interest is to finance”.
In the case of the web2 world, I can’t use the feature or part of a code of Uber or Airbnb and use it for an app that I am building.
The two quick advantages for builders (with composable infrastructure) I can think of are:
- They can reuse the contracts instead of building them from the scratch.
- They can use multiple contracts to build something new. In other words, “Innovation”.
Ok, I get it that Blockchains need to support composability. But what’s the challenge here?
The challenge here is Blockchains need to be scalable in such a way that they don’t lose the ability to be composable because of the scaling solutions they have adopted to.
In other words, you don’t want to lose the composability to achieve scalability.
But you understand the challenge here right? Solve the problems (Scalability, Interoperability) and find solutions in such a way that you don’t destroy the feature (Composability).
Uff! Scaling a blockchain ain’t easy, right?
Blockchain Scaling Solutions
Ok, you got an idea of the main problems and challenges the current blockchains are facing. To solve these problems, some of the smartest minds of our time came up with a few solutions.
Note: Just to add more context and make the explanation a bit simpler, all the scalability methods and blockchain layers will be explained mostly from Ethereum’s perspective.
Layer 1 Scaling Solutions
The Layer 1 solutions focus directly on making changes to the Blockchain. The purpose is to make the base protocol better.
In other words, these solutions will not attempt to move transactions off of the blockchain (like layer 2 solutions, which we’ll cover soon).
These solutions aim to solve the scalability via technical changes like:
- Improving the speed of block confirmation (Block Confirmation Time = Time taken to add the transaction into a block).
- Augmenting how much data block contains
Let’s have a look at some L1 solutions:
1. Consensus Protocol Changes:
Ethereum is moving to Proof Of Stake (POS) from the Proof Of Work consensus mechanism.
Currently, when the Ethereum network gets clogged up with more transactions, those transactions will stay in the memory pool and miners will only prioritize transactions of users who are willing to pay higher gas prices.
These are called gas wars, and we have seen some insane wars during some popular NFT mint days. An Ethereum user spent $44,000 in gas fees to mint Bored Ape ‘Otherside’ NFTs.
In the case of POS, instead of miners competing to validate transactions, there will be validators that validate the transactions and these validators are selected randomly.
A user has to stake a specific amount of coins to become a validator. In the case of ETH, a user has to stake 32 ETH to become a validator.
This reduces the high power consumption and reliance on specialist hardware, but how does it solve the high gas fee issue?
This is just a half move towards scalability without compromising on security and decentralization. In fact, POS makes both these two characteristics better, as Vitalik says.
PoS isn’t the solution to the gas fee problem. The gas fee will be reduced via Shard Chains.
Ethereum chose Sharding to reduce the amount of data that each node must process and store.
What this solution does is, it splits the entire network into multiple portions called ‘Shards’. These shards will reduce network congestion and increase transactions per second. How?
What happens when sharding will be implemented is, that the network’s workload of validating and authenticating transactions is distributed into small bits and this happens parallelly. Hence, more transactions at the same time.
A validator (not a miner – that’s why PoS) will verify the transactions and add them to a shard block. Note that two-thirds of the validators must agree that the transaction is valid and only then the block is closed.
These sharded chains will enable layer 2 solutions to offer low transaction fees while leveraging the security of Ethereum. You can read more about that here.
Finally, ETH2 (Also called “Ethereum 2.0” & “Serenity”): is more secure (via PoS Mechanism and punishing bad actors with Slashing) + More sustainable (No GPU mining = Better for the environment) + More Scalability (via Sharding).
The current Ethereum chain will also become one of the shards and will be the only chain that will be able to handle transactions and smart contracts.
All the other sharded chains provide extra data to the network. But they won’t handle transactions or smart contracts.
I mean they can, if the developers give them the power to. But there has been a lot of debate going on whether to do that or not.
Anyways, the point is these shards will only provide data to the network.
Ok, then how will we see high TPS because we didn’t do anything to the transactions execution part in this solution?
Sharding needs to be combined with ‘rollups’.
Rollups? Yes, Layer 2!
Layer 2 Scaling Solutions
Layer 2 solutions are built on top of Layer 1 networks. These methods involve enabling transactions off the chain to achieve scalability.
Bitcoin’s Lightning Network (LN) is a great example of this. In the Bitcoin network (Proof Of Work consensus) every transaction will be validated by all the nodes aka miners and this results in slow processing of transactions and high transaction fee.
So, a layer 2 solution was created.
Lightning Network is a second layer added on top of Bitcoin’s network to enable transactions to be done off of the blockchain. That’s how scalability was achieved, although it comes with some problems too.
This is how it works with Layer 2: Layer 1 only handles the creation and addition of blocks to the blockchain and Layer 2 continuously communicates with the L1.
Rollups are considered the holy grail for scaling Ethereum.
Anyways, how rollups work is, that they perform transactions outside of the layer one network and then put the data from the transactions to the layer 1 blockchain.
The rollup transactions are executed on a separate chain and these transactions once executed will batch them together and will be posted on the Ethereum mainchain.
In other words, ‘Rollup’ the transactions and puts them on L1.
Ok, that’s cool, but how does Ethereum know that the data that is being posted on the chain is valid data and not by some hacker or me or you trying to game the system?
There are two methods to verify that. And that’s how we ended up with ‘Zero-Knowledge Rollups’ and ‘Optimistic Rollups’.
Sidechain (Layer 1.5?)
There is another way to scale a blockchain and it’s by building a sidechain. Adam Back, the CEO of Block Stream proposed the concept of Sidechain in 2014 with the goal of enabling assets to be transferred between multiple blockchains.
Rootstock (Sidechain to Bitcoin) and Polygon (Sidechain to Ethereum) are great examples of this. Now, what’s a sidechain in the first place?
A sidechain is a blockchain that will be connected to the mainchain (or to another sidechain) via a ‘two-way peg’.
But the only issue is the security. Ethereum is highly secure. We all know that. But Polygon has its own consensus mechanism and only partially relies on Ethereum for security and there are some centralization trade-offs in the design (as some blockchain experts say).
A side chain is just part of Polygon. They are betting on ‘Zero-Knowledge Cryptography’ and developing many solutions parallelly to achieve scalability and many hope that this will only get better and help a lot when it comes to Ethereum scaling.
Simply put, they are planning for a multi-world chain on top of Ethereum.
If you look at the Ethereum scaling solution, what it is trying to do is go for a modular approach. Instead of doing everything on a single layer (also called the Monolithic approach) like Solana, Ethereum choose a module approach.
Layer 0 technologies provide the underlying infrastructure to create chains. And moreover, they help solve the cross-chain interoperability which means the chains created on top of it can communicate with each other.
PolkaDOT and Cosmos are Layer 0 Protocols.
PolkaDOT ($DOT) provides the underlying cross-chain architecture and on top of which one can build multiple chains like Ethereum and Bitcoin. They are called Parachains (which are assigned by an on-chain auction) and they come under the L1 network.
Only this time, these L1s can talk to each other. Unlike Bitcoin and Ethereum.
These Parachains, use the relay chain’s computing resources to confirm that transactions are secure and accurate. And the relay chain is responsible for the network’s shared security, consensus, and cross-chain interoperability.
Digital assets like Binance Coin (BNB), Crypto.com Coin (CRO), Terra (LUNA), and Cosmos Hub (ATOM) are part of the Cosmos ecosystem making them talk to each other.
Simply put, L0s are here to promote cross-chain technology and solve the interoperability problem.
Layer 3 | Application Layer
Layer 3, which is also called Application Layer only deals with Smart Contracts and DApps (Decentralized Applications).
The user always interacts with Layer 3. Every time you buy an NFT on OpenSea, you are interacting with a smart contract, and that means you are interacting with Layer 3.
We need multiple solutions for multiple purposes. And scaling a blockchain comes with a lot of turns and twists.
And developers of the blockchain ecosystem doing their best to make the Blockchain world a better place to do business.
I hope this article helped you in getting an idea of the blockchain scalability issues and scaling solutions.