Bitcoin-focused layer 2 blockchains play a crucial role in expanding the utility of the world’s largest and most valuable cryptocurrency. Demand for more Bitcoin features and functionalities is on the rise, and L2s are propelling the first-generation network toward mainstream adoption.
L2 blockchains let the Bitcoin network focus on what it’s good at — security and decentralization — while they help improve the network’s efficiency by carrying the load. Some L2s, like Stacks, add the functionality of smart contracts, enabling the creation of a decentralized finance (DeFi) ecosystem. Others, like the Lightning Network, are designed to help you buy anything from groceries to coffee with Bitcoin. The increased functionality that Bitcoin L2s provide has led to improvements in everything from Bitcoin wallets like Leather and protocols like LNSwap.
Despite Bitcoin’s decentralized ecosystem being in its early stages, as a developer, you still have a handful of Bitcoin layer 2 networks to choose from.
In this article, we'll provide some guidance on what L2s are best for your project depending on what you'd like to accomplish, and what you'll need to consider.
Why a Bitcoin Layer 2?
Before we dive deep into the question of how to choose a Bitcoin L2 to build your project on, let’s look at why you should choose L2s.
Faster and cheaper transactions
Speed and efficiency have never been the Bitcoin network’s strong suit. Its capacity is limited to processing about 7 transactions per second (TPS). Each transaction takes between 10-20 minutes to be confirmed (added to a block), on average. But the wait time can exceed an hour during periods of high congestion.
Bitcoin fees can also spike during high demand, making the network unaffordable for some. For instance, Bitcoin transaction fees fluctuated between $1.1 and $4.8 in October 2023. But it went up past $38 in December 2023.
Bitcoin scaling solutions are designed to help the network process transactions faster and make them more affordable. For example, the Lightning network is theoretically capable of processing millions of transactions per second, which are settled almost instantly. It is also cheap — in April 2023, it took about $0.84 to send one BTC, which was valued at around $28,800 at the time. That’s between 60,000% to 140,000% cheaper than even VISA and Mastercard transactions.
Bitcoin’s unbeatable security
Layer 2 scaling solutions rely on and leverage Bitcoin’s robust security while improving efficiency. In other words, with L2 networks, you get efficiency without ever compromising on security.
Security is of the utmost importance to not only all users but also developers like you. Any project you build on a Bitcoin L2 will inherit the security of the Bitcoin network.
Unlocking Bitcoin’s true value with smart contracts
Bitcoin may be a currency and a store of value, but it has the potential to be much more. Bitcoin’s potential applications can extend beyond finance, reaching into areas such as supply chain management, identity verification, intellectual property management, and more.
These applications are possible thanks to smart contract functionalities added by L2 scaling solutions. Therefore, L2 networks are helping Bitcoin reach its potential.
4 Things to Consider When Choosing a Bitcoin L2
Now that you know why you should build on Bitcoin L2 networks, let’s get down to understanding which one is right for your project. The key thing to remember is that different Bitcoin L2s serve different purposes, and you have to find the one that aligns with your project’s goals.
If your project requires smaller, faster payments at A low cost, you need an L2 that focuses on increasing the Bitcoin network’s throughput.
The most obvious choice in that case would be the Lightning Network, which is optimized to facilitate Bitcoin micropayments. Building on Lightning be beneficial for an array of projects. This includes point-of-sale systems for small businesses, Bitcoin rewards programs, donations and tipping platforms, games that involve in-game purchases and repeated microtransactions, and more.
The Lightning Network is built on top of the Bitcoin blockchain. It utilizes the Bitcoin scripting language, which is ‘Turing incomplete,’ which means it cannot handle complex computations.
In other words, Bitcoin’s scripting language is intentionally designed to be simple and secure — it was built to handle simple financial transactions.
The Lightning network does employ a type of smart contract called a Hashed Timelock Contract (HTLC). However, this type of smart contract is not equipped to deal with complex computations that are required to build and support a broad range of DeFi applications like a decentralized exchange (DEX) or a liquidity pool.
Additionally, if you’re thinking of building an application that is interoperable with blockchains other than Bitcoin, building on the Lightning Network will pose a significant challenge. This is because the Lightning Network’s Bitcoin scripting language ensures compatibility with only Bitcoin, making it less versatile.
Therefore, if you’re looking to build a complex decentralized application (dApp), Stacks or Rootstock will be better alternatives. Stacks acts as a complete blockchain with its own miners and native token (STX). It enables the creation of a range of dApps by bringing dynamic smart contract capability to Bitcoin. Rootstock is another Bitcoin scaling solution that enables you to build dApps by supporting Turing-complete smart contracts.
These solutions offer developers a wider range of functionality to play with their support of versatile smart contracts. So, whether you’re looking to build a DEX or a complex blockchain game, Stacks and Rootstock could be good options to consider.
The next factor to consider while choosing a Bitcoin L2 to build on is the programming language.
The Lightning Network, as mentioned above, uses the Bitcoin scripting language, which comes with constraints. It will give you direct integration with the Bitcoin network and the security and stability of Bitcoin. However, if you’re looking to build a complex application, you won’t have a lot of flexibility. It is worth noting that as a developer, you will be using the programming language Go to build on the Lightning Network.
Stacks, on the other hand, uses Clarity as its programming language, which prioritizes safety and predictability. It will also give you direct integration with Bitcoin through Bitcoin-native smart contracts. So, if privacy and security are your priority, Clarity will help you achieve that. Clarity’s syntax is also relatively simple as it aims to make smart contracts behavior easier to understand.
Rootstock uses Solidity, the same programming language as Ethereum. Solidity is a versatile and expressive language which will allow you to build any application, no matter how complex. Solidity supports a wide range of functionalities since it's designed to build feature-rich applications. However, that also makes the language a bit more complicated.
Choose a language that meets your project’s interoperability goals. Figure out your priorities — do you want to build a super complex application or a simple one with robust security? The answer will help you decide which programming language will better suit your needs. You should also consider the skill set of the developer team. If your team has experience with a certain language, experimenting with a new language may not be the best idea.
Tools and libraries
L2 networks offer developer tools and libraries that are designed to make it easier for you to build your applications. For instance, the Lightning Network Daemon (LND) is an implementation of the Lightning Network protocol that operates in the background. LND handles tasks like creating and managing payment channels. The LND helps you set up a Lightning Network node and enables you to build applications like wallets and payment gateways on top of the Lightning Network.
Stacks offers developers Hiro, which enables them to choose from example smart contracts. This means you don’t necessarily have to write your code from scratch. Hiro is marketed as a Web3 developer that helps you do everything from coding to deploying smart contracts to testnet and mainnet from your browser.
Review the developer resources offered by different L2s before making your final decision. Consider which network offers more tools or makes it easier for you to launch your project.
Building on Bitcoin L2s in 2024
With the anticipation around the Bitcoin halving, the demand for the Bitcoin network is increasing. Lightning Network transactions have grown by over 1,200% in two years. Stacks has enabled the creation of NFT-like assets with Ordinals, which has spurred interest in the Bitcoin ecosystem.
All this makes a case for building on Bitcoin L2s to tap the large market that seems hungry to do more with their Bitcoin or find newer ways to use it.