A beginner’s guide on blockchain layer-2 scaling solutions
Do layer-1 blockchains address blockchain network scalability issues?
When the concept of blockchain technology was introduced to the world back in 2009 with Bitcoin (BTC), the primary focus was on providing a decentralized and secure distributed database technology that can cater to transparent transaction ability.
It necessitated the creation of a native token for facilitating payment for transactions on the network, leading to popular cryptocurrencies such as BTC coming into existence. However, as the blockchain ecosystem kept growing at an exponential rate, it exposed the fundamental concern of low transaction speeds and the inherent lack of scalability provided by such layer-1 blockchains.
A layer-1 blockchain, such as Bitcoin and Ethereum, is the base protocol that is then used in conjunction with third-party layer-2 protocols and is also known as an L1 blockchain, mainnet or primary chain.
The major issue of blockchain network scalability is primarily due to the proof-of-work (PoW) consensus mechanism adopted by layer-1 blockchains that require excessive amounts of computational resources to build each block of transaction data on the network.
Moreover, the volume of transactions that a layer-1 blockchain can handle is inversely proportional to the time required to complete them, leading to an increase in transaction or gas fees on such networks.
Since such layer-1 blockchains process and finalize transactions on their own blockchain, any changes to the underlying protocol can potentially disrupt its functioning and makes the task of changing the consensus mechanism a risky proposition.
Ethereum, another layer-1 blockchain, plans to transition from its PoW consensus mechanism to a proof-of-stake (PoS) model in a bid to thwart this scalability concern. While this will reduce computational requirements and improve the blockchain’s energy efficiency, it does rely on layer-1 scaling solutions such as sharding to eventually scale to 100,000 transactions per second.
Sharding, the more popular of the two layer-1 scaling solutions, involves splitting up transactions into small data sets and then using a horizontally split processing algorithm to parallelly process them.
However, with validation power being given to the largest stakeholders in a PoS consensus model, it does result in the form of centralization that needs addressing, especially for financial applications.
What is a layer-2 blockchain network and why is it needed?
There is no doubt that despite the scalability and speed handicaps of layer-1 blockchains, their rising popularity and the ensuing ample liquidity have led to the birth of layer-2 blockchain solutions like Ethereum-based Polygon blockchain or the Bitcoin-based Lightning Network.
These layer-2, or L2 blockchain, solutions enable thousands of low-value transactions to be processed after validation on parallel blockchains, with records then being transferred to the main blockchain, or mainnet, to ensure that they are immutably recorded.
Originally coined as a collective term to describe a specific set of Ethereum scaling solutions, layer-2 solutions were intended to cater to demand exceeding the blockchain’s 1+ million transactions per day capacity.
Today, these secondary blockchains are expanding use cases to provide a more superlative end-user experience by virtue of higher transactions per second, lower gas fees and the assurance that all transactions, once completed, are irreversibly recorded on the mainnet.
By ensuring that the mainnet handles critical aspects of decentralization, data availability and security, L2 blockchain solutions are effectively diverting the transactional burden onto their parallel network and de-congesting the mainnet in the process.
This solves the scaling problem plaguing layer-1 blockchains like Bitcoin and Ethereum while ensuring robust decentralized security standards are accessible to a wide range of decentralized applications (DApps) that are getting pervasive today.
Ethereum Rollups as layer-2 scaling solutions
Rollups, termed because they “roll-up,” or packet multiple transactions into a single mainnet transaction, are layer-2 scaling solutions that ultimately inherit the security provided by Ethereum. They are further classified into two types depending on how the eventual transaction data is recorded on the layer-1 blockchain.
The first is Optimistic Rollups, which are blockchains that sit parallel to the main chain and avoid the computation that makes Ethereum expensive. Essentially assuming all posted transactions to be valid, they offer security by being able to run fault proofs in the event of an invalid transaction being suspected.
The second type is zero-knowledge Rollups, or zk-Rollups, that instead employ validity proofs to compute transactions off-chain and subsequently compress hundreds of transactions before posting cryptographic validity proofs on the Ethereum mainnet.
The key difference between the two types is that validating a block is much faster on zero-knowledge Rollups, as they only need the validity proof instead of all transaction data, as is the case with Optimistic Rollups.
Zk-rollups provide near-zero delays in cryptocurrency fund transfer from layer-2 to layer-1 chain and make them more suitable for financial transactions-related use cases, as seen with the popular layer-2 crypto network Polygon.
On the other hand, Optimistic Rollups ensure a higher degree of security and decentralization since transaction data is stored on the layer-1 blockchain and are more suitable for applications with minimum on-chain activity. They also enjoy complete Ethereum Virtual Machine (EVM) and Solidity compatibility, making it possible to do everything on an Optimistic Rollup that is possible on the Ethereum blockchain.
Demystifying other popular types of L2 scaling solutions
Sidechains are separate blockchains that operate independently with their own consensus mechanisms but also run in parallel to the Ethereum mainnet with a two-way bridge connecting both blockchains.
They offer developers the same feel of the Ethereum mainnet and the ability to deploy their DApps on these sidechains with relative ease. However, since they use a separate consensus mechanism, sidechains aren’t technically layer-2 blockchains because they have a lower degree of decentralization built into their protocol.
Another example of a bi-directional blockchain type is a State channel, also referred to as a payment channel, in which crypto funds are deposited in a smart contract on the layer-1 blockchain, and signed tickets are produced on the former. Available on both the Bitcoin and Ethereum mainnet, popular examples include the Lightning Network, which lets users transact speedily off-chain and records the final data back to the Bitcoin mainnet later. Raiden Network is another state channel that works with the Ethereum blockchain and also permits users to run smart contracts through them.
Plasma chains are anchored to the Ethereum mainnet and use fraud proofs, similar to Optimistic Rollups, to check for transaction validity in case of a dispute. They are more preferred in scenarios where transactions are done between arbitrary users at high speeds with lower gas fees.
However, withdrawals from these blockchains take several days to provide for arbitration claims and involve an additional capital cost in cases where liquidity is sought for fungible assets.
Nested blockchains are again similar to plasma chains but involve multiple interconnected secondary chains that run on top of the layer-1 blockchain. Forming a parent-child relationship, nested blockchains distribute work to these secondary or child chains and rely on the underlying mainnet to set parameters for the overall network web.
Validiums are eerily similar to zero-knowledge rollups in the sense that they are not vulnerable to cyber-attacks and enjoy no delays when withdrawing funds off these blockchains. They do, however, require high amounts of computational power and are not cost-effective for use cases with low throughput.
Layer-1 vs. layer-2 blockchains
Despite layer-1 scaling solutions like making consensus protocol changes and sharding attempting to make blockchains like Bitcoin and Ethereum more scalable, they are still a work in progress with multiple projects currently working on bringing to market user-friendly solutions.
Both methods, however, are trying to solve the “scalability trilemma,” a term coined by Ethereum founder Vitalik Buterin that alludes to the unsolved problem in distributed ledger technology based networks where every node that validates transactions cannot simultaneously achieve decentralization, security and scalability.
While the jury is still out on how successful these could be, layer-2 solutions are already facilitating transaction speeds and fees that are ideal for scaling the blockchain ecosystem so as to unleash the full potential of this path-breaking technology.
Numerous DApps are already employing these solutions to provide previously impossible experiences in the spheres of gaming, Decentralized Finance (DeFi) and the Metaverse, in addition to overhauling traditional sectors like finance, corporate governance, auditing and many more.
Despite the advantages, the way these blockchains validate transactions needs to be evaluated based on the use case, and the possibility of validators on the layer-2 blockchain committing fraud needs to be analyzed carefully. That said, new layer-2 scaling solutions are being developed constantly and this space will continue to attract a lot of attention, plaudits and criticism.
Future of L2 blockchains
As blockchain technology continues to witness rising real-world adoption, the focus on scalability, fast transaction speeds and low gas fees will drive developments across both L1 and L2 blockchains. With L1 blockchains like Ethereum promising to bring important updates like changes to the consensus mechanism and introducing methods like sharding, it will have a magnified impact on L2 blockchains that are linked to them.
L2 blockchains will inadvertently be able to offer even faster transaction times and bring down costs to a level hitherto seen before. These advantages, coupled with the proliferation of L2 blockchains, will undoubtedly power the rise of new applications, especially in the DeFi space.
Moreover, by virtue of more bridges being built between the various L2 blockchain platforms, users will be able to enjoy the benefits of higher blockchain interoperability and open up new avenues with respect to areas such as the trading of digital assets.
Thus, L2 scaling solutions will play a key role in promoting a multichain world and this will put the onus on developers to ensure that growth is sustained without any compromises on the tenets of security, decentralization and scalability that blockchains are known for.
The entire crypto industry at large will have to join forces, constantly innovate and collaborate with each other to bring to market L2 scaling solutions and DApps that will help the world transition to a decentralized economy.