How can blockchains scale? A deep dive into layer 1 and layer 2 solutions

Share this article

Latest News

Blockchain, in simple terms, is a few blocks of information chained together. However, what makes it special is that each block of data is connected to the previous block of data with a hash. The hash is a fixed-size, unique string of characters that is generated for each block. Each block will have its unique hash, and every block will have the hash of the previous. Since each hashing is unique and is generated based on the information within a block, changing the details of a transaction inside the block will produce a new hash; however, this new hash will break the chain, as the next block would not accept it.

Once data is inserted into the network, it cannot be tampered with. However, in the event, there is something that needs to be changed in a block, then there is some work that needs to be done called mining. 

Once the mining is completed, it needs to be submitted to the network, and if more than 50% of the users on the network agree to change, then the block will be altered. This decentralized nature of blockchain ensures that no single authority can alter data according to its whims and fancies. Since you know how blockchain technology works, you’ll understand when I say that blockchain is secure, decentralized, and scalable. May not be scalable as of yet? However, in this article, we’ll be discussing scalability. 

So let’s start by understanding what scalability is

Scalability is the ability of a blockchain to process transactions, store data, and reach consensus when more users are added to the network. When you think about blockchain, there are layers that are built on top the each other. 

Join our newsletter
Get Altcoin insights, Degen news and Explainers!

Layer 1 (on-chain solutions)

Layer 1 of the blockchain is the base protocol layer of the network, it is the whole architecture that supports other layers. Layer 1 consists of the consensus mechanism, security, transaction finality, and smart contract execution. Examples of layer 1 are Bitcoin and Ethereum. The common problem with layer 1 is that it gets clogged when there are many transactions happening on the network. BTC has a rate of 7 transactions per second (tps). To improve this rate of rate of transactions, layer 1 projects do some alterations to the base protocol on-chain.  

Sharding: 

Sharding is a process where the blockchain is broken into smaller fragments, and each part of the chain carries out a different task of the transaction or the smart contract. For instance, let’s say some children in a class group are trying to find an answer to a difficult question. Instead of the whole class going through the whole book, it would be sensible for each student to go through a different topic, wouldn’t it? Then they can find the answer faster. Sharding is pretty much the same. 

Consensus mechanism: 

Layer 1s can improve their scalability by transferring their consensus mechanism on which the nodes rely. For instance, Ethereum migrated from a proof-of-work consensus to a proof-of-stake consensus, which is energy-efficient and faster. Additionally, there are other consensus mechanisms like Delegated Proof of Stake (DPOS) and Byzantine Fault Tolerant (BFT) Algorithms, which are faster. 

Block Size and Frequency Adjustments:

Increasing the block size allows a block to hold more transactions or data in bytes. More transactions per block mean a higher throughput rate, and therefore, the scalability increases. Bitcoin had a block size of 1MB, with a TPS rate of 7, however, the platform expanded its block size to 32 MB with a hard fork, and now Bitcoin Cash can handle more than 100 TPS. 

Stateless clients: 

Blockchain usually has two types of storage: historical and global state storage. In the historical storage type, full nodes need access to historical data to process transactions. The global state is a snapshot of all the data that could be read by smart contracts. However, with increasing storage requirements blockchains often experience state bloat—a situation in which it becomes harder for full nodes to stay synced to the current version of the ledger without hardware upgrades. So, stateless client storage is used. In this type of storage, only the latest account balances, contract code, etc, are stored. This improves scalability. 

Pruning and compression 

Pruning is the act of removing unwanted or old data that is not needed by the current node, while compression is minimizing the size of the data. 

Layer 2 (off-chain solutions)

Layer 2 blockchains are built on top of the base protocol to increase transaction throughput, reduce fees, and maintain security by offloading work from the base layer.

Rollups

Layer 2s use something called a Rollup. The rollup takes many transactions and processes them off-chain, and thereafter bundles them together/rolls up, and then sends a summary back to the main chain. This alleviates the load on the main chain, improving speed. There are two types of rollups:  Optimistic Rollups and ZK-Rollups (Zero-Knowledge Rollups). Optimistic rollups assume that all transactions are valid until proven otherwise. ZK rollups prove the transaction authenticity without revealing details. 

State Channels

State channels allow two or more users to make a transaction off-chain, and thereafter, it will settle the final result on the main chain. This offloads the weight of computing and processing on the main chain and improves the speed. 

Sidechains

A sidechain is an independent blockchain that runs parallel to the main chain blockchain and is connected by a bridge. When users lock tokens on the main chain, there will be an equivalent amount of tokens minted on the side chain. The sidechain has its own consensus mechanism that validates the transaction. Users can withdraw their tokens once they burn the tokens on the side chains. 

Related Articles

Share this article