Join ACCESS EU, the first-of-its-kind digital assets security and DLT summit
JUNE 7TH, 2024 @ EURONEXT AMSTERDAM ⟶
Halborn Logo

// Blog

Blockchain Explained

Layer-2 Protocols: Bitcoin's Solution for Scalability and Speed


profile

Rob Behnke

April 8th, 2024


The creation of Bitcoin revolutionized the world of finance. It created a global network that enabled users to make payments and transfer value without relying on a centralized organization.

However, the Bitcoin blockchain has its limitations. Bitcoin adds transactions to the distributed ledger in fixed-size blocks that are created at ten-minute intervals. By creating a maximum capacity, this can limit the number of transactions that the network can process, increase transaction fees, and limit the speed at which transactions can be added to the ledger.

Bitcoin Layer-2 protocols are designed to address these limitations. They build on the Bitcoin protocol, taking advantage of its security and reputation while enhancing its operations.

What is a Layer-2 Protocol?

Bitcoin, Ethereum, and similar blockchains are considered to be Layer-1 blockchain protocols. They collect transactions into blocks, implement a consensus algorithm, and use a peer-to-peer network to distribute updates to their ledgers.

However, these blockchains often face issues in terms of scalability, throughput, and transaction speed. For example, Bitcoin creates a 1MB block every ten minutes on average. This means that Bitcoin can process up to 7 transactions per second. Additionally, the wait for a transaction to be fully confirmed — three blocks deep — is half an hour at the minimum.

Layer-2 protocols are designed to address the limitations of Layer-1 protocols. Their goals may be to improve scalability, speed up transaction confirmation, or add new features that a more established blockchain lacks.

Types of Bitcoin Layer-2 Protocols

Bitcoin Layer-2s are Layer-2 protocols that are built on top of the Bitcoin network. In general, they come in two different forms: state channels and sidechains.

State Channels

Bitcoin’s Lightning Network is the most famous example of a Bitcoin Layer-2 protocol. It is also a prime example of a state channel protocol.

State channels work by establishing bidirectional payment channels between two parties for off-chain transactions. They’re created by performing a transaction on the Layer-1 blockchain that establishes and funds the state channel.

Once that channel is established, the participants can transfer value between themselves off-chain by reallocating the balance stored in the channel. For example, if Alice and Bob both initially contribute 1 BTC to a state channel, Bob can send Alice 0.1 BTC by digitally signing a statement that the new balance of the channel is 1.1 BTC Alice/0.9 BTC Bob. Once Alice accepts this state update by signing the statement as well, the pair can perform additional transfers between them by making further updates.

Two parties without a direct channel between them can perform transfers using a path through existing channels between them. For example if Alice wants to pay Charlie, and Bob has a channel with Charlie, Alice can send the payment through her channel with Bob, who then passes it on to Charlie via their shared channel. When doing so, Alice may also pay Bob a small fee for proxying the payment.

When either party is done using their state channel, they can unilaterally close it by submitting a transaction on the Layer-1 blockchain containing the latest state of the channel. If the other party doesn’t challenge this — by submitting a more recent, mutually signed version — then the Bitcoin stored in the channel is reallocated based on the submitted state.

Sidechains

State channels are a Layer-2 built on top of a Layer-1. Sidechains are more parallel to a Layer-1 while taking advantage of some benefit of the other chain.

A sidechain is an independent Layer-1 blockchain that is connected to another blockchain (the mainchain) via a peg. This peg allows transfers of tokens between the sidechain and the mainchain at a particular rate. Users of one can send their tokens to a particular address, and a corresponding amount will be unlocked on the other chain.

The sidechain and the mainchain typically have a mutually-beneficial relationship. The sidechain may offer improved scalability, transaction speed, transaction fees, or capabilities to the mainchain’s users. On the other hand, connecting to the mainchain provides a higher level of security than if the sidechain was completely independent.

Some examples of Bitcoin sidechains include Rootstock, Stacks, and the Liquid Network. While these protocols work differently, they all have the same goals of improving scalability and transaction speeds. All of them lean on the Bitcoin blockchain for improved security via a bidirectional peg, recording their blocks as Bitcoin transactions, or through novel consensus protocols.

Benefits of Bitcoin Layer-2s

Bitcoin Layer-2s provide benefits to both the Bitcoin blockchain and the Layer-2 protocol. Some of the most significant benefits of Layer-2s include:

  • Scalability: Scalability is one of the biggest benefits of Bitcoin Layer-2s. Every transaction that is performed off-chain — either via a state channel or sidechain — is one fewer that needs to be included in Bitcoin’s blocks and digital ledger.

  • Confirmation Speeds: Bitcoin blocks are created at ten-minute intervals, and full confirmation takes over half an hour. With Layer-2 protocols, transactions can be performed much more quickly — instantly with state channels — without compromising security.

  • Transaction Fees: Bitcoin’s limited throughput means that transaction fees can grow significantly during periods of high usage. Sidechains and state channels can offer significantly lower transaction fees 

  • Smart Contract Functionality: Bitcoin has some built-in scripting functionality, but it isn’t Turing-complete like Ethereum and other smart contract platforms. Bitcoin Layer-2s offer the ability to connect the Bitcoin blockchain to other chains that offer this functionality.

  • Layer-2 Security: Layer-2 protocols also benefit the Layer-2 protocol. By building state channels on top of Bitcoin or linking a sidechannel to the Bitcoin blockchain, the Layer-2 protocol benefits from the security of the Bitcoin blockchain.

Conclusion

Bitcoin Layer-2s are designed to address limitations of the Bitcoin protocol. Layer-2s can increase the scalability of Bitcoin, enable faster transactions, drive down fees, and unlock more sophisticated smart contract functionality than is available on-chain. 

Bitcoin Layer-2s derive their security from Bitcoin, building on top of it or linking to it via a bidirectional peg. Any information or crypto that is stored or recorded on the Bitcoin blockchain is protected by Bitcoin’s Proof of Work and large pool of miners, making 51% attacks much more difficult than on a smaller blockchain.