Bitcoin Layer 2s: The Future of the Bitcoin Ecosystem

The Bitcoin protocol is simple. That has been a key advantage in its adoption. Bitcoin’s design, with an emphasis on security and decentralization, has made it a great option as a decentralized currency. But that design also has limits.

Type
Deep dive
Topic(s)
Bitcoin
Published
August 1, 2023
Author(s)
Lead Content Manager
But why do we even need Bitcoin layers in the first place?
Contents

Bitcoin has limited block space, and it can only handle so many transactions before the network becomes congested, driving up transaction fees and increasing transaction times, both of which create poor UX. Bitcoin also lacks programmability and can’t perform more sophisticated operations that other blockchains can.

In order to grow and reach an even wider audience, at some point, the Bitcoin ecosystem will need to grow beyond the Bitcoin blockchain itself. You need Bitcoin Layer 2s.

The Genesis of Bitcoin Layer 2s

Smart Contracts, NFTs, DeFi, Altcoins, high-frequency trading–Bitcoin was built for none of these. It’s even in the title of the original paper: Bitcoin: A Peer-to-Peer Electronic Cash System.

Bitcoin was designed for secure, trustless, peer-to-peer payments. Nothing more. But its incredible success, and the success of subsequent platforms such as Ethereum, has meant users have always wanted functionality that Bitcoin wasn’t designed to provide as well as faster, cheaper transactions than are possible on the network.

This led early adopters to start building their own solutions. As early as 2013, developers working on Bitcoin were discussing how to incorporate “decentralized high-frequency trading” into the blockchain. But it was really in the latter half of the 2010s that the idea of Bitcoin scaling and Layer 2 solutions took off.

The Rootstock white paper was published in 2015, then in 2016 Joseph Poon and Thaddeus Dryja wrote “The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments,” which explained their technique for:

"A decentralized system is proposed whereby transactions are sent over a network of micropayment channels (a.k.a. payment channels or transaction channels) whose transfer of value occurs off-blockchain."

Thus, the first Layer 2 solutions for Bitcoin were born. More followed: Stacks was conceived in 2017, and Liquid launched in 2018. Each of these solutions has a different take on how to scale Bitcoin, either in terms of more transactions or more functionality.

The Scalability Problem With Bitcoin

The Bitcoin blockchain (the base layer of the Bitcoin ecosystem) can’t scale. There’s a limit on how many transactions the network can process. Each block in the Bitcoin blockchain has a maximum size limit of ~2MB, and the network adds new blocks about every 10 minutes. This setup results in a maximum transaction capacity of around seven transactions per second (TPS).

As Bitcoin's popularity increases, more transactions are conducted, pushing the network beyond its processing capacity. This in turn pushes transaction fees higher, making smaller transactions unfeasible on the network.

Solving that scaling issue isn’t simply a matter of increasing block size or decreasing block time. Every Bitcoin node must process every transaction, and increasing the block size or decreasing block time can lead to centralization risk and security vulnerabilities.

Today, you can actually run a Bitcoin node on a Raspberry Pi, and the Bitcoin network is the most decentralized in Web3. If you increase block size or require nodes to process blocks faster, you increase hardware requirements to run a node too, and that will ultimately result in fewer running nodes.

As opposed to changing the Bitcoin blockchain, layers are the solution to increase throughput in the Bitcoin ecosystem: move transactions off the Bitcoin blockchain and have them periodically settle on the Bitcoin blockchain in batches.

As opposed to changing the Bitcoin blockchain, layers are the solution to increase throughput in the Bitcoin ecosystem.

Layers also solve the problem of Bitcoin programmability. Bitcoin was designed as a digital currency with a focus on security. Its scripting language, Bitcoin Script, is purposefully simple so that any computation on the network can’t take up too many resources, enabling the currency to be maximally decentralized and maximally secure (the language has a smaller attack surface).

While Bitcoin does support simple, smart contract-like functionalities such as multi-signature wallets, its scripting language is not designed for the complex, self-executing smart contracts needed for sophisticated apps and decentralized financial systems. You need that functionality somewhere else, say, on a Bitcoin layer.

We’ve touched on the why behind Bitcoin layers, but what are they exactly?

What Are Bitcoin Layers?

Here is a concise definition of blockchain layers 1 and 2 from Stacks co-creator (and Hiro Chairman) Muneeb Ali:

“Generally speaking L1 chains are sovereign meaning that (a) they have their own security budget, and (b) they can survive without the need for any other L1 chain. L2 chains typically do not have their own security budget and share the security of the underlying L1 chain, and they cannot live without the underlying L1 chain.”

Let's break this down a bit.

Traits of an L1

L1 chains are sovereign. L1 blockchains like Bitcoin are self-contained systems with their own rules and security measures. They operate independently and do not rely on another blockchain to function.

They have their own security budget. L1s maintain their security through mechanisms such as proof-of-work or proof-of-stake. These security mechanisms require network validators to spend resources (like computational power or staked funds). In order to attack the network, an attacker has to outspend the majority of honest participants with those same resources (that threshold is the ecosystem’s “security budget”—how much an attacker would have to spend to successfully attack the network). Generally, the more popular and valuable a blockchain ecosystem, the higher the security budget.

Traits of an L2

L2 chains are not sovereign. They are dependent on L1s for their operation and security. Without the L1, the L2 cannot function. This dependence is what allows layer 2 solutions to offer faster and cheaper transactions while still maintaining a high level of security.

L2 chains typically do not have their own security budget. Instead, they settle periodically on the L1 chain and rely on that L1 for security (e.g. to change the history of the L2, you have to change the history of the L1). That inherited security allows L2s to be more experimental and push innovation further.

Coming Full Circle

This vision of layers for Bitcoin is actually something that Satoshi Nakamoto, Bitcoin’s creator, talked about. In a forum post from 2010 discussing Bitcoin domain names, Satoshi described an approach which involved a

“…completely separate network and separate block chain, yet share CPU power with Bitcoin.”

And in the past few years, this vision has evolved in a few different ways.

Types of Layer 2 Solutions

Layer 2 solutions can be broadly categorized into a few types, each with a unique approach to scaling and enhancing the capabilities of Bitcoin.

  1. State Channels: State channels allow multiple parties to open private channels where they can make transactions amongst themselves off-chain. Only the opening and closing balances of the channel are recorded on the blockchain (as users enter and exit a channel), saving considerable resources and block space. This approach significantly speeds up payments and reduces fees, but it offers limited functionality (there are no smart contracts on a state channel, and no contracts means no apps).
  2. Sidechains: Sidechains are independent blockchains that run in parallel to the L1 chain. Assets can be transferred from the main chain to the sidechain (and vice versa), allowing the sidechain to operate under its own rules and protocols. These chains often don’t have their own gas asset and instead rely on the pegged L1 asset (in this case, a synthetic Bitcoin) as the native currency. This approach can enable faster transactions, experimentation with unique consensus and protocol designs, and the implementation of features like smart contracts.
  3. Rollups: Rollups are a solution that allows execution of smart contracts to happen off-chain while storing only the data on-chain. Unlike sidechains, rollups often have their own token for transaction fees. There are two main types of rollup: Optimistic Rollups and ZK-Rollups. Both types essentially bundle or "roll up" many transactions into a single proof, which is then posted to the main chain. The main difference between the two types is the method of generating and verifying the proof.

Examples of Bitcoin Layer 2s

There are a number of Bitcoin projects that are live in production today, some of the most popular of which include:

Lightning Network

Lightning Network is a layer 2 payment protocol for Bitcoin that enables fast, low-fee transactions through off-chain channels. Its strength lies in its ability to conduct an almost unlimited number of transactions between parties, with only the final state of the transactions being recorded on the Bitcoin blockchain. This reduces transaction fees and increases speed significantly. However, Lightning is not a blockchain: it can’t support smart contracts and more complicated applications.

Liquid Network

Liquid Network is a Bitcoin sidechain developed by Blockstream. It offers faster transaction times and increased privacy through confidential transactions, enabling users to hide transaction amounts. Liquid offers a pegged Bitcoin asset (L-BTC) as well as the ability to issue new digital assets, including tokenized fiat, crypto assets, and even tokenized securities. 

Rootstock

Rootstock is another sidechain that brings smart contract functionality to Bitcoin. Rootstock operates is an Ethereum Virtual Machine (EVM) sidechain, which means it's compatible with most existing Ethereum tooling and languages, including Solidity, Ethereum's smart contract programming language. This makes it easier to port existing Ethereum apps into the Bitcoin ecosystem and lets developers leverage the extensive educational resources for Solidity to help them start building faster. 

Stacks

Stacks is a unique layer 2 blockchain that extends the functionality of Bitcoin. Unlike most Bitcoin L2 solutions, Stacks has its own native token (STX), consensus protocol, and programming language (Clarity). Stacks allows developers to write fully expressive smart contracts, and the blockchain periodically settles on Bitcoin, which means these smart contracts gain the security and robustness of the Bitcoin network.

Should You Build on a Bitcoin Layer 2?

Building with Bitcoin layer 2 solutions gives you a huge opportunity. You’re no longer limited to simple transactions on the Bitcoin blockchain—you have access to scalability and programmability, enabling you to build all kinds of apps that tap into Bitcoin’s $580B of latent capital.

However, you will need to do your research. The choice of L2 largely depends on your project's specific needs. For instance, if your application requires small, frequent payments, the Lightning Network is a great option. On the other hand, if you're looking to leverage smart contracts, then Stacks or Rootstock is a better fit. Not only do you have the layers described above, but you also have many projects in R&D such as Drivechains that may offer better optimization for what you’re trying to build.

Additionally, some concepts, like multi-signature wallets, are shared among layer 2 solutions. Others are only available on certain layers (such as Hashed Timelock Contracts on Lightning). You will also need to consider the unique tech stack of various L2s. Different L2s also work with different programming languages, so depending on your expertise, you may find it easier to start building on one L2 over another.

In parallel to that research, you can start playing around with the tools and libraries that support each layer 2. At Hiro, we build devtools for Stacks, including:

Other L2s offer a variety of tools to help you build too. The Lightning Network has tools such as LND (Lightning Network Daemon), Lightning Terminal, and Faraday. Liquid has the Liquid Development Kit (LDK) and liquidjs. RSK leans on Ethereum and Solidity devtools such as Truffle Suite.

Impact of Bitcoin Layer 2s on Bitcoin's Evolution

Bitcoin layers are the future of the Bitcoin ecosystem and are critical to:

  • Scaling the network: Bitcoin can only handle so many active users, and moving transactions off the main blockchain is the only way to scale to a mainstream audience.
  • Creating app ecosystems: Layers can offer new smart contract functionality for the Bitcoin ecosystem, opening the door to DeFi, gaming, apps, and more.
  • Enhancing privacy: Layers can provide enhanced privacy compared to the Bitcoin L1 via confidential interactions, rollups, ZKproofs and more. 
  • Broadening accessibility and adoption: By reducing transaction costs and increasing speed, layer 2 solutions make Bitcoin more accessible for daily use and microtransactions, which can spur adoption and new use cases.
  • Maintaining decentralization and security: Layers allow Bitcoin to scale while preserving the decentralization and security of the overall ecosystem. This layered approach allows for a balance between scalability and the principles of Web3.

Conclusion

Bitcoin's layer 2 solutions will continue to play a pivotal role in Bitcoin's evolution, enabling it to scale and support new use-cases. These technologies offer a path to address Bitcoin's current challenges, ensuring its continued relevance in an ever-evolving cryptocurrency landscape.

As developers and the wider community continue to innovate and adopt these solutions, Bitcoin layer 2 solutions will undoubtedly play a pivotal role in shaping the network's future. Learn more about how Bitcoin evolved into a robust ecosystem for apps in our free ebook:

Product updates & dev resources straight to your inbox
Your Email is in an invalid format
Checkbox is required.
Thanks for
subscribing.
Oops! Something went wrong while submitting the form.
Download Bitcoin’s Evolution
Copy link
Mailbox
Hiro news & product updates straight to your inbox
Only relevant communications. We promise we won’t spam.

Related stories