This article is part of IOV Labs research series that aims to help newcomers to the Web3 world navigate blockchain technology, explore its benefits, and understand its risks.
Read on to learn what Layer 2 solutions are, their different types, how they solve scalability issues, and what the future holds for this technology.
The Bitcoin blockchain was designed to enable peer-to-peer transactions while guaranteeing security and decentralization. This requires a significant trade-off that means heavily restricting the number of transactions the network could process, aka the network’s scalability.
Currently, the Bitcoin network is able to handle a maximum of seven transactions per second. In comparison, traditional payment provider, Visa, processes an average of 1,700 transactions per second, with a theoretical max of 65,000.
Such limitations have resulted in high fees, long wait times, and reduced network efficiency — which has ultimately hindered Bitcoin's widespread adoption as a payment solution.
Layer 2s looks to solve Bitcoin's scalability problems. They provide additional capacity and processing power by building on top of the Bitcoin blockchain, enabling a higher volume of transactions. In this article, we will explore how Bitcoin Layer 2 solutions work, the different types of Layer 2s available, and the future of Layer 2 technology.
A Layer 2 solution is a secondary protocol built on top of an existing blockchain network. They operate separately from the main blockchain, leveraging its security and decentralization while providing additional functionality in order to handle a higher volume of transactions.
They achieve this by moving transactions off the original chain but keeping them on the L2 chain. For example, transactions that happen on Rootstock, a Bitcoin L2 solution, are on the Rootstock chain, but off the Bitcoin chain. This allows multiple transactions to be processed on the Layer 2 network that are then presented as one transaction to be recorded on the main chain.
You can think of it like a group of friends buying rounds of beers at a bar. Each person could go up to the bar and buy one beer at a time — each being charged through a separate transaction. Alternatively, one person could take an order for the table and purchase multiple beers for the whole group with one transaction, speeding up the process significantly.
But as with all things blockchain-related, implementing such solutions isn’t as simple as ordering drinks. There are multiple types of Layer 2 scalability solutions that exist which take transactions off-chain.
The three main types include:
1. State Channels
State channels are the most well-known Bitcoin Layer 2 solution — primarily due to the Lightning Network being a state channel solution. They are designed specifically for handling micropayments and other transactions that require a high level of speed and efficiency.
They work by establishing an off-chain communication channel between two or more parties. The parties (and these parties only) can then transact freely within the channel as many times as they like, with the final balance of the channel recorded on the main chain when the channel is closed. This allows for instant and cheap transactions and is perfect for small businesses that receive multiple payments from the same clients.
How State Channels Layer 2 Solutions Work
2. Rollup Chains
Rollups work by bundling multiple off-chain transactions together into a single transaction, which is then recorded on the main chain. They work by relying on a certain type of “proof” for transactions that allows the main chain to verify their correctness.
These proofs can be implemented in two ways:
Optimistic (fraud proofs): Optimistic rollups rely on fraud proofs. A fraud proof demonstrates that a transaction has been processed incorrectly or maliciously and is submitted to the main chain as evidence of fraud. If a fraud proof is validated by the main chain, the transaction is reverted, and the fraudulent party is penalized. Optimistic rollups assume all transactions are correct and only need to interact with the main chain when there is a problem. Examples include Optimism and Arbitrum.
Zero Knowledge (validity proofs): Zero Knowledge rollups (ZK-rollups) use cryptographic proofs (validity proofs) to ensure the correctness of off-chain transactions. These proofs are generated by performing complex computations that verify the validity of transactions without exposing the transaction details. This makes ZK-rollups one of the more secure and private Layer 2 solutions. Examples include zkSync and RIF Aggregation.
How Zero Knowledge and Optimistic Rollup Layer 2 Solutions Work
Sidechain solutions work by using a 2-way-peg (or bridge) to transfer assets from the main chain to an alternative “side” chain, where they can be transacted freely within the network. This allows Sidechains to be used for a wide range of use cases, including smart contracts and building DeFi applications. Sidechains can even have other Layer 2 solutions, such as Rollups, built onto them.
Unlike other solutions, Sidechains act as their own independent blockchain network and rely on their own set of validators to secure their network. The only thing (generally) tying them to the main blockchain is the 2-way-peg. This has led the industry to disassociate Sidechains with Layer 2 solutions, referring to them as simply ‘Sidechains’ rather than Layer 2. However, Sidechain developers can implement other measures, such as utilizing merged mining with Bitcoin, to closer tie the Sidechain to the main chain. Some examples of Sidechains include Rootstock and Polygon.
Layer 2 solutions are an answer to the Bitcoin network's limitations. They can improve scalability, reduce transaction costs, improve privacy, and are proving to be essential for Bitcoin’s continued growth and adoption.
Layer 2 solutions are primarily about scalability — providing faster and cheaper transactions without tampering with the integrity of the main blockchain. By enabling off-chain transactions, they also free up space on the main Bitcoin blockchain, allowing for more transactions to be processed and enabling a healthier, less congested network overall.
Transactions on the Bitcoin network are processed by a decentralized network of validators (or “Miners”). As the Bitcoin network becomes more congested, the Miners on the network prioritize confirming transactions that pay higher fees. In 2021, the Bitcoin transaction fees peaked at $62 per transaction, cementing the need for alternative scaling solutions. Since Layer 2 transactions occur off-chain, they allow more transactions to be processed with fewer computational resources, significantly reducing transaction costs.
Bitcoin transactions are recorded on a public blockchain, which means that transaction details can be accessed by anyone with an internet connection. While the blockchain itself is secure and anonymous, it is possible to link a person's identity to their wallet address by analyzing transaction patterns. Certain Bitcoin Layer 2 solutions can implement privacy features to make tracing transactions back to their origin more difficult.
Improved user experience
All the above features combined make for a far better user experience when interacting with Bitcoin. Given the proper implementation, Layer 2 protocols such as State chains make it possible to use Bitcoin for fast, day-to-day payments. And through Sidechains, Bitcoin users can discover decentralized applications and use cases unavailable on the main network. These improvements will be crucial for the continued growth and adoption of Bitcoin.
Despite the abundance of benefits Layer 2 solutions offer, there are several challenges associated with these solutions that are yet to be addressed:
As Layer 2 solutions grow in popularity, users may rely heavily on a few large, centralized nodes to process their transactions. This concentration of power could pose a security risk, as a small number of validators would control all the transactions on the Layer 2 network.
Limited smart contract functionality
Bitcoin itself is not a smart contract platform, meaning particular Layer 2 solutions (such as Rollups), which are designed specifically for smart contract-enabled platforms, are less readily available for Bitcoin.
Layer 2 solutions are hailed as the answer to improving Bitcoin usability. But in their current state, they are far more complex to interact with than the main Bitcoin network. To get to layer 2 in a decentralized manner, assets from Bitcoin need to be bridged to the Layer 2 network. A process that adds an extra barrier of complexity that even experienced crypto users can struggle with.
As more users enter the crypto space, the demand for faster, cheaper, and more user-friendly transactions will increase. Layer 2 solutions are poised to play a critical role in addressing these needs. Coinbase, one of the world's biggest crypto exchanges, recently announced its plans to launch its own Optimistic rollup chain — Base. Sighting the solution as the ideal way to onboard new users and achieve widespread crypto adoption.
As for Bitcoin, its more interoperable Sidechains will likely continue to play a crucial role in enabling the network's continued success. Sidechains such as Rootstock will grant Bitcoin access to the expanding universe of decentralized applications, and ZK-rollup layers like RIF Aggregation built on top of Rootstock will enable the intuitive user experience that will keep Bitcoin front and center during the next wave of crypto adoption.
🎧 “Why build on #Rootstock:— Rootstock (@rootstock_io) March 3, 2023
1. Secured by Bitcoin
2. #Bitcoin is used as the primary asset
3. Turing complete - fully permissionless
4. True scalability”@SovrynBTC Contributor @EdanYago at the Rootstock x Twitter space pic.twitter.com/18OEIATTYo
If you believe your business will benefit from a Bitcoin Layer 2 scaling solution that enables a secure smart contract network, Rootstock, Bitcoin’s most secure L2 scaling solution.
If instead, you are looking to build on top of a Bitcoin L2 solution to leverage Bitcoin’s security and decentralized capabilities, explore the RIF Product Suite, the toolkit of protocols that make it easy to build fast, scalable, and secure products and services on the blockchain.