Have you ever wondered how Ethereum can only process 30 transactions per second, while some other projects connected to the Ethereum platform can perform way more than that? This article will take a detailed look at the different layers in blockchain and how they add up to increase speed and efficiency.
Blockchain will undoubtedly continue in its quest to change the way we do things, but it is still faced with one problem with three major branches. It is what we call the blockchain trilemma, a word used to explain the problem regarding balancing decentralization, security, and scalability. None of it is irrelevant, and sacrificing one for the other two would not do much good. While the first two have been improved to an extent, let's look at scalability and how it affects the efficiency of the blockchain.
Scalability is a major issue when not done right. New projects are recognizing the need to be able to perform more transactions without traffic issues. Ethereum and its huge gas fees have also taught new protocols the need to build from scratch with the mindset of having many users at a time, and one of the ways of accomplishing this is via different scaling solutions. There are different scaling layers, but we will be looking at the predominant layer-1 and layer-2 solutions in this article.
Layer-1 Scaling Solutions
A layer-1 network is used to refer to any blockchain that can house a third-party integration. Popular examples of layer-1 blockchains include Bitcoin, Litecoin, and Ethereum. Here's the hack to it. Layer-1 solutions tweak the rules of the protocol directly in a bid to increase transaction capacity and speed for current and prospective users and data. Layer-1 scaling solutions are as easy as adding or changing a few things to improve the overall network output. The popular ones include consensus protocol improvements and sharding. For example, accelerating the rate at which blocks are confirmed will improve the network.
Let's look at these in detail.
Consensus Protocol Improvements
Consensus protocols refer to the way a blockchain protocol verifies transactions. There are different consensus protocols, and they differ in mode of operation and efficiency. Early blockchain networks like Bitcoin, Litecoin, and Ethereum, for instance, use the Proof-of-Work (PoW) protocol. Although PoW is secure and permissionless, issues such as its use of energy and its speed are major limiting factors. Because of these, many networks use alternative consensus mechanisms such as the Proof-of-Stake, Proof-of-History, Proof-of-Space, and Proof-of-Elapsed-Time. All these have their merits and demerits, but the goal is to improve the speed and efficiency of their networks.
Ethereum, for instance, is planning to transition to Ethereum 2.0, which uses a Proof-of-Stake consensus algorithm against the Proof-of-Work currently in use on Ethereum 1.0. This positively affects the network by dramatically increasing the Ethereum network's capacity without compromising decentralization and network security.
Sharding, as a mechanism, has turned out to be one of the most popular layer-1 scaling solutions, even though most of its abilities are not yet experiential. Sharding is a process of breaking the entire blockchain network into individual datasets called "shards" — a more manageable task than requiring all nodes to maintain the entire network. These network shards are simultaneously processed by the network, thereby removing the nodes' validation pressure. With sharding, numerous transactions can be worked on sequentially. Alongside Tezos, Ethereum 2.0 is a popular blockchain protocol that explores shards.
Layer-2 Scaling Solutions
Layer-2 refers to a network operating on top of an already existing blockchain protocol to create better scalability and efficiency for its platform. It involves shifting a part of a blockchain protocol's transactional burden to a side architecture that can handle the major part of the network's processing. Removing most of the data processing from the base layer blockchain makes it more scalable and less congested. For Example, Binance Smart Chain is a layer-1 network, while Safemoon is a layer-2 solution built on it to improve its transaction speeds by leveraging Binance Smart Chain's existing infrastructure.
Major known ways of improving scalability using layer-2 scaling solutions include:
A nested blockchain is just a blockchain within another blockchain. The architecture is built such that the main blockchain sets the parameters needed for a broader network while the executions are undertaken on the connected network. Many blockchain levels can be built upon the main chain, but it is connected with a parent-child link. The parent chain delegates work where the child chain processes and returns it to the parent after execution. The only role of the parent chain in the network is for dispute resolution in the few times it happens.
An example of this is the OMG Plasma project built on the layer-1 Ethereum protocol to make transactions faster and cheaper.
Unlike the Nested Blockchain, the state channel does not rely on the Layer-1 network for validation. Rather, it uses a smart contract mechanism to seal transactions and only records them on the main blockchain when a transaction or a batch of transactions has been completed.
Examples of this include Celer Network, Bitcoin Lightning, and Ethereum's Raiden Network. These state channels forfeit some level of decentralization to allow for greater scalability.
If you want to validate a large batch of transactions, a sidechain is your best bet. Sidechain uses a consensus mechanism distinct from the original chain to optimize the platform for speed and scalability. The main chain is only responsible for overall security, confirming bulk transaction history, and resolving disputes using a sidechain architecture. Unlike statechains, sidechain transactions are publicly recorded to the ledger, and security breaches to the sidechain do not affect the main chain or other.
Of the three, the infrastructure for the sidechain is the most difficult and most expensive to build.
The major constraint for every blockchain’s mass adoption is scalability. The more demand is placed for cryptocurrency, the more the pressure to scale blockchain protocols. To tackle the scalability part of the trilemma, developers are left with two options.
Mitigate the problem, or,
Look for long-lasting alternatives.
The important question we need to ask ourselves now is: What potential solution can permanently eradicate this scaling problem? With the ever-growing innovation in this space, that day shouldn’t be far. Cheers!