BTC Layer 2 Protocol Research

BeginnerDec 08, 2023
In May 2024, the Bitcoin (BTC) halving will be one of the hottest events in the market. As the halving approaches, more funds will focus on Bitcoin, drawing investor attention to the Bitcoin-derived ecosystem. Layer 2, with its compelling narrative, is likely to become a preferred target for alpha-seeking capital. This article provides an overview of the current BTC Layer 2 concept race and introduces representative projects, including Stacks, RSK, and the Lightning Network.
BTC Layer 2 Protocol Research

History

For a long time, BTC has been coveted for its high security. However, as the number of cryptocurrency users grows, the Turing-incomplete BTC network can no longer meet users’ demands for low fees, convenience, immediacy, privacy protection, and asset diversification in the cryptocurrency system. Although BTC currently has the largest cryptocurrency market cap, the ecosystem derived from BTC is not very competitive in the market.

BTC has undergone several upgrades, including:

  1. In 2012, the concept of Pegged Sidechains was proposed, originating from Two-way Peg, allowing seamless asset transfer between two chains. This proposal laid the foundation for subsequent sidechain technology.
  2. In 2014, Blockstream was established to develop sidechain technology to enhance Bitcoin’s scalability.
  3. In 2015, the Lightning Network whitepaper was released, offering a solution for decoupling small transactions from the main chain. By creating bidirectional payment channels, intermediate transactions don’t need to be recorded on the blockchain, only the final state on BTC.
  4. In 2017, the SegWit (Segregated Witness) upgrade was activated, addressing transaction malleability issues in the Bitcoin blockchain and enabling the development of Layer 2 technology.
  5. Since 2018, developers have been deploying Lightning Network nodes, gaining a certain user base and support. As of October 2023, the Lightning Network had over 16,000 nodes, accommodating more than 60,000 payment channels, with a network capacity exceeding 5,000 BTC, valued at over $100 million.

The recent emergence of the BRC-20 token standard has further enriched the Bitcoin ecosystem, bringing BTC Layer 2 back into public view. Layer 2 is not a direct modification to the original chain’s expansion plan. In the history of upgrades, directly improving BTC’s underlying protocol is complex, faces strong community resistance, and increases the risk to the BTC system, even leading to several hard forks and community splits (such as BSV, BCH).

Therefore, making sudden and substantial changes to Bitcoin can harm the core rules of the protocol. While upgrades to Bitcoin will certainly continue, any transformative solutions will not happen overnight. Currently, since Ethereum has successfully implemented a Layer 2 scaling solution, the Bitcoin network may also consider adopting a similar architecture to help improve network performance and accommodate billions of users.

Concept of Layer 2

The Layer 2 concept derives from Ethereum’s scalability design, where transactions are bundled in a Rollup manner, and network security relies on Ethereum’s (L1) network consensus. Layer 2 can focus on performance enhancement and fee optimization, providing users with an efficient experience while core data is promptly transmitted to Ethereum and stored in blocks. In case of network attacks or node misconduct, Ethereum data can be used for rollback, ensuring network security.

Layer 2 exists relative to Layer 1. Initially, scalability involved Layer 1, such as adjusting Bitcoin’s block size, introducing SegWit, and implementing Ethereum 2.0’s PoS and sharding mechanisms.

However, Layer 1 cannot simultaneously improve performance, security, and decentralization due to the “blockchain trilemma.” Layer 2, a compromise solution, relies on the security of the underlying Layer 1, while its network maximizes efficiency and reduces GAS fees to accommodate a larger user base and meet the diverse functional demands of growing cryptocurrency users.

Layer 2 does not alter the blockchain protocol itself. It does not tamper with any decentralization or security features of Layer 1. Through the interaction of on-chain smart contracts and off-chain data, it offers new functionalities and performances, making it a suitable scaling approach for the BTC network.

It enables Bitcoin (and other assets) to be transferred without directly using the blockchain. While each Bitcoin layer has its unique consensus mechanism to connect Bitcoins, the goal is the same: to move transactions off-chain, making them faster, cheaper, more programmable, and scalable.

Assuming Bitcoin serves as the final settlement layer for transactions, the upgrades and developments based on Layer 2 will not affect the security of BTC. At the same time, Layer 2 provides multiple advantages: faster transaction speeds, lower fees, and better suitability for Bitcoin users who require quicker confirmations. It also adds smart contract functionality, allowing the development of decentralized applications with a complete execution environment. This greatly expands the use cases of Bitcoin, including decentralized finance (DeFi), non-fungible tokens (NFTs), and decentralized autonomous organizations (DAOs).

Therefore, BTC Layer 2 may be a more suitable scaling solution. It involves building a new layer on top of BTC without altering BTC itself, while meeting the users’ demand for scalability. This article mainly introduces the current mainstream BTC Layer 2 protocols and provides a future outlook.

BTC Layer 2

Currently, there are many Layer 2 solutions based on the BTC network, each with its technical architecture and design due to BTC’s inherent limitations, unlike Ethereum’s Layer 2, which directly employs Rollup for deployment. These include sidechains, state channels, etc.

Image source:@Janenico"">https://medium.com/@Janenico

From a technical perspective, different forms of architecture implementation have different characteristics:

Rollup: Currently the mainstream Layer 2 scaling solution for Ethereum, it essentially transfers the computation process from the main chain’s transactions to the “Rollup chain.” After the transactions are executed on the Rollup chain, the data is aggregated and summarized, transmitted to the main chain for verification, and stored to obtain consensus security provided by the main chain.

State Channels: A typical example is the Lightning Network, which creates a “green channel” outside the Bitcoin network to process a large number of high-frequency and small-value transactions off-chain. The final settlement data is then recorded on the chain. Issues such as confirmation of off-chain transactions and payment channels are resolved using technologies such as RSMC and HTLC. Unlike Rollup and other solutions, state channels do not have an independent chain, but only a single channel.

Sidechains: A separate chain created based on the Bitcoin network. More smart contracts or other computations are executed on this chain. The interaction between the sidechain and Bitcoin mainly involves the sidechain verifying information on the Bitcoin main chain and performing subsequent executions. Sidechains are generally managed in the form of consortium sidechains with a higher degree of centralization.

Client Verification: Similar to state channels, but client verification does not require all state transitions to be verified by all nodes/miners on the main chain through repeated calculations. It only requires the main chain to ensure the security of commitments. Main projects include RGB, Taro, etc.

Mainstream Representative Projects

Some well-known BTC Layer 2 concept projects include Liquid Network, Lightning Network, Rootstock, and Stacks.

Liquid Network

Developed by the Blockstream team, Liquid Network is a Bitcoin sidechain aimed at facilitating rapid settlement of Bitcoin transactions. The network has a consensus mechanism similar to Bitcoin but is more centralized in its governance structure.

In terms of the team, Blockstream is a company that aims to enhance the functionality of the Bitcoin protocol by leading the development of sidechain expansion mechanisms. Their team includes Bitcoin core developers Gregory Maxwell and Jonathan Wilkins, among others. In November 2014, the company raised $21 million in seed funding with lead investors such as the co-founder of LinkedIn and a board member of Airbnb, Reid Hoffman, and venture capital firm Khosla Ventures.

Features of Liquid Network include:

Fast Settlement: With a block time of just 60 seconds, compared to Bitcoin’s 10 minutes, transactions on Liquid Network are confirmed and settled much faster.

Low Transaction Fees: Average fees are about a tenth of those on Bitcoin, making small payments and daily transactions more cost-effective.

Centralized Structure: Unlike Bitcoin’s decentralized structure, Liquid Network is more centralized to enhance performance, allowing faster transaction confirmations and higher throughput.

The main purpose of the Liquid Network is to provide a solution that is more suitable for the fast and high-frequency trading needs of Bitcoin. It can be widely used in cryptocurrency exchanges, payment services, and other financial applications, making these transactions more efficient and convenient.

Image source: https://docs.liquid.net/docs/technical-overview

Liquid is currently operated by a global consortium of members. The Liquid network has over 35 members, including exchanges, trading firms, and financial institutions, who collectively manage the network and guide its development.

Since its launch at the end of 2018, the Liquid Network has experienced significant growth. Network capacity is a key metric to measure its adoption. During the period from 2022 to 2023, the network capacity has consistently remained around 3,500 BTC, indicating that more and more users and entities are choosing to lock their Bitcoin on the Liquid Network.

Lightning Network

The Lightning Network was first introduced in February 2015 in a whitepaper titled The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments by Thaddeus Dryja and Joseph Poon.

In 2016, Dryja and Poon founded Lightning Labs to develop the technology. In 2018, Lightning Labs launched a test version of the LN on the Bitcoin mainnet, enhancing Bitcoin’s transaction efficiency by confirming final outcomes on-chain, allowing users to complete payments more quickly and at lower cost.

The Lightning Network has continued to develop and iterate since its inception. After El Salvador adopted Bitcoin as legal tender in 2021, the number and value of payments on the Lightning Network have rapidly increased. As of October 8, 2023, there are a total of 16,000 nodes and nearly 77,000 payment channels on the Lightning Network. The channel funds amount to approximately 5,356 bitcoins (equivalent to around $124 million).

The basic principle of the Lightning Network is to build a peer-to-peer transaction channel between users. It opens a payment channel network through smart contracts, which is essentially a ledger between the two parties, storing their transaction records.

Both parties in the transaction first deposit a certain amount of Bitcoin into the Lightning Network. The role of the Lightning Network is to complete the transaction records and broadcast the final transaction result to the BTC network. In other words, the transaction is completed off-chain, while the transaction result is saved on-chain, and the Lightning Network is responsible for updating the account balances of both parties.

Of course, the Lightning Network is not simply a connection between two trading parties, but rather a payment network that can accommodate multiple users and multiple channels, all interconnected. For the Lightning Network, in addition to transaction speed and fees, it is crucial to ensure that there is no cheating behavior among traders. To prevent traders from attempting to steal Bitcoin through false settlement claims, the Lightning Network has a penalty protocol. If Alice sends incorrect information and Bob proves that the information is false, then all funds in the channel will be transferred to Bob.

The key technology behind this is the Hashed TimeLock Contract (HTLC), which allows transactions to be sent through payment channel paths while eliminating the possibility of interception and withholding of payments. In simple terms, during the final settlement, HTLCs require the recipient to confirm that they have received the payment. If the recipient fails to confirm receipt within a certain timeframe, the payment will be returned to the sender.

LN’s use cases include social platform rewards, cross-border remittances, merchant payments, and transfer transactions. In 2022, the LN sector saw significant funding, including investments from top institutions like a16z and Paradigm.

Currently, Lightning Labs defines Lightning Service Providers (LSPs) as “entities that provide liquidity services on the Lightning Network on behalf of others.” LSPs are categorized into three types: liquidity providers, infrastructure providers, and joint liquidity and infrastructure providers.

The current representative LSP projects are as follows:

Voltage: Provides lightning network services for enterprises without the need for lightning engineers to deploy the lightning network.

Lightspark: Lightning network payment solution provider, enabling open payment protocols for the internet through the lightning network.

LightningLoop: A non-custodial service provided by Lightning Labs that allows for easy movement of Bitcoin in and out of the lightning network.

Boltz: Focuses on privacy and accountless Bitcoin exchange and lightning network service provider, dedicated to lightning network integration and Lapp development.

AMBOSS: Lightning network data analysis platform, providing data, insights, and coordination tools.

BTCPay Server: Self-hosted open-source cryptocurrency payment processor.

On July 6 this year, Lightning Labs introduced a new developer tool that enables the lightning network and artificial intelligence developer community to build inclusive, plug-and-play, and cost-effective LLM (Large Language Model) tools. These tools facilitate better integration of the Bitcoin ecosystem with artificial intelligence, expanding the prospects of Bitcoin network computing power applications.

Rootstock

Founded in 2016, Rootstock is a smart contract platform protected by the Bitcoin network. It operates a bidirectionally pegged sidechain, allowing Bitcoin miners to earn rewards through merged mining and supporting smart contracts with higher performance.

The RSK team has extensive experience in blockchain and software development. Their Chief Scientist, Sergio, has previously founded Coinspect, a company focused on cryptographic computing security, and CoinFabrik, a cryptocurrency software development factory. Then, Diego, who has a wealth of experience in developing fintech products, founded a financial lending company called Koibanx. RSK has successfully raised two rounds of funding, totaling $4.5 million, from investors such as Bitmain.

RSK Network features an RVM virtual machine that allows developers to build smart contracts using Ethereum’s language, including compatibility with the Ethereum ecosystem toolkit. Additionally, RSK Network uses RBTC as the currency for processing transactions and contract fees, which is issued 1:1 with BTC from the mainnet through a cross-chain bridge and can be converted back to Bitcoin at any time. The cost incurred by developers when deploying smart contracts on RSK Network is settled using the RBTC token. RBTC is primarily used to pay for the execution fees of smart contracts, similar to ETH being used to pay for Ethereum gas fees. The RBTC consumed by the network is distributed as rewards to miners who provide computational power to run smart contracts.

Compared to other Bitcoin layer solutions, RSK Network’s distinctive feature is merged mining. RSK utilizes the same Proof-of-Work (PoW) consensus algorithm as Bitcoin but allows miners to generate blocks faster than the Bitcoin base layer. These RSK blocks are mined through a process called merged mining. Since both blockchains use the same consensus, miners can simultaneously mine Bitcoin and RSK blocks, allocating equal mining power to both Bitcoin and RSK. This allows for significantly increased profitability for miners through merged mining without requiring additional resources.

Image source: https://dev.rootstock.io/rsk/architecture/

RSK’s network architecture, as shown in the above diagram. At its core, RSK allows for the validation of transactions, block generation, and sending them to Bitcoin through merged mining. This mining process enables RSK’s smart contracts to benefit from the security of the Bitcoin blockchain.

Building on the consensus protection of Bitcoin, RSK has developed its own smart contract layer. Below this layer, the network is EVM-compatible, allowing developers to quickly deploy applications and meet various transaction needs of users. RSK can create a new block approximately every 33 seconds and process about 10-20 transactions per second, making it more efficient than Bitcoin’s approximately 5 transactions per second.

Currently, RSK has achieved a certain level of ecosystem development with 47 protocols in the network and around 70,000 monthly network transactions. The ecosystem development is considered above average in the BTC Layer 2 space.

Stacks

Stacks is a smart contract network with a native development language, and its network security is also protected by Bitcoin. The initial version of Stacks was launched in early 2021, introducing Bitcoin transaction settlement, using the Clarity language for smart contract design, and supporting atomic swaps of assets with BTC.

Stacks integrates with the Bitcoin main chain by submitting anchor transactions on the Bitcoin main chain. These anchor transactions contain a digest of the Stacks chain’s block header information and some additional data, and are broadcasted to the Bitcoin network to ensure their immutability. Additionally, Stacks has its own consensus algorithm called Proof of Transfer (PoX): in Stacks, miners and transaction validators have two separate roles, where transaction validators stake STX tokens (mining BTC) and miners stake BTC on the Bitcoin main chain (mining STX). Therefore, while Stacks relies on the security of the Bitcoin network, it is essentially a sidechain with its own independent consensus validation network.

In terms of network design, Stacks has the Bitcoin base settlement layer at the bottom, adds the smart contract and programmability layer (Stacks) on top of it, and then achieves scalability and speed on the higher layer (Hiro subnets).

Image source: https://docs.stacks.co/docs/intro

The core layer of Stacks interacts with the Bitcoin layer based on the Proof-of-Transfer (PoX) mechanism. PoX is a stake-based mechanism similar to Proof-of-Stake (PoS), where miners participate in leader elections by sending transactions on the Bitcoin blockchain. A verifiable random function (VRF) is used to randomly select the leader for each round. The elected leader then writes new blocks on the Stacks chain.

Specific Process:

  1. PoX miners spend Bitcoin on the Bitcoin layer to participate in bidding and become the leader of the next block, earning STX tokens as a reward.
  2. When a PoX miner wins the leader bidding, they will start creating a new block and add it to the Stacks layer. This process is achieved through chain anchoring, which binds information in the Stacks blockchain with information on the Bitcoin blockchain.
  3. In the Stacks layer, the new block contains all the latest transactions and state changes. These transactions and state changes are broadcast to the entire network and verified and confirmed by other nodes.
  4. Once the new block is confirmed, it is added to the Stacks blockchain, and all relevant parties can see the latest state.

STX holders can participate in consensus and earn BTC rewards by participating in a process called “Stacking.” In this process, users lock their STX for a reward cycle (approximately two weeks), run or support a full node, and send useful information on the network through STX transactions. STX holders actively participating in Stacking will receive Bitcoin rewards for that cycle.

Currently, the Stacks network has approximately 20 million TVL and 50+ ecosystem protocols. Although it is still relatively small compared to Ethereum’s Layer 2 in terms of scale, Stacks is currently a leading platform in the Layer 2 field within the BTC ecosystem.

Image source: https://defillama.com/chain/Stacks

Stacks network has opened the door for developers to build various decentralized applications and deploy DApp environments on the most secure blockchain network currently available. This allows developers to confidently design applications that can securely handle sensitive data and valuable assets.

Conclusion and Outlook

As the volume of transactions on the Bitcoin network continues to grow, a major development direction is how to enable Bitcoin to handle more transactions and a broader ecosystem. Whether it’s the Lightning Network, sidechains, or the RGB protocol, the development of Bitcoin’s second layer (Layer 2) is ongoing, ultimately aiming for compatibility between Bitcoin’s network security and scalability.

The current scale of the Bitcoin ecosystem is still far behind Ethereum. First, there are fewer well-known projects compared to Ethereum, and second, the user base is also smaller than Ethereum. However, as the blockchain network with the highest market value, the potential for growth in its derived ecosystem is significant.

The current challenge in the development of Bitcoin Layer 2 lies in the limitations of three types of network characteristics: open networks and consortium networks; issuing tokens or not; compatibility with the Ethereum Virtual Machine (EVM) or using native development languages.

Developers can only choose two of the three ideal attributes: (a) open network, (b) no new tokens, and (c) complete/global virtual machine. The choices are: (a) either an open network (ideal) or a consortium, (b) either not introducing tokens (ideal) or introducing tokens, and (c) either having a complete/global virtual machine or limited off-chain contracts.

Liquid operates as a consortium chain and cannot issue tokens. Lightning has chosen to be an open network but lacks a global state or complete virtual machine. Stacks and RSK have open networks and have issued their own network tokens, STX and RSK, respectively. Both aim to expand Bitcoin’s functionalities and application scenarios, differing in network compatibility implementation and network security design.

The Stacks network’s construction is more closely tied to Bitcoin, while RSK has EVM compatibility, making it easier for developers to enter the RSK ecosystem. The STX token is tied to network development, capturing more of the ecosystem’s value. In terms of governance, Stacks allows any community member to participate, whereas RSK’s governance model is represented by a governance committee consisting of 5 seats.

From a project value perspective, there aren’t many options for investors regarding BTC Layer 2 projects. Stacks has developed well, with a current market value of about $1 billion. However, compared to its TVL of only $20 million, further improvement in ecosystem data is needed. RSK, with a market value of about $100 million, still has good potential for growth, but its network only has about 70,000 active transactions per month.

Overall, compared to the maturity of Ethereum’s Layer 2, BTC Layer 2 still has a significant gap. However, as the infrastructure of the Bitcoin ecosystem continues to improve, it’s expected to attract more projects and investor attention.

Recently, projects based on the Lightning Network, such as OmniBOLT and the RGB protocol, have been making continuous efforts. Markets for inscription NFTs, like Ordinals and Nostr Assets Protocol Atomiclas, are also worth attention. In the future, the Bitcoin ecosystem is expected to accelerate development in payment, DeFi, NFT, and other areas, covering more tracks and users.

How to Acquire STX/RIF Tokens?

To obtain STX/RIF tokens, try purchasing them through centralized cryptocurrency exchanges. For instance, you can buy them on reputable exchanges like Gate.io that support STX/RIF trading. First, create an account. Then, verify your account and deposit the target tokens. After creating your account, follow the prompts to complete the purchase and acquire STX/RIF. Remember to research and compare prices across different exchanges before buying, and ensure that the purchased tokens are stored in a secure and reliable wallet.

Take Action on STX/RIF

Check out STX and RIF price today, and start trading your favorite currency pairs.

Author: Nick
Translator: Sonia
Reviewer(s): Wayne、KOWEI、Elisa、Ashley He、Joyce
* The information is not intended to be and does not constitute financial advice or any other recommendation of any sort offered or endorsed by Gate.io.
* This article may not be reproduced, transmitted or copied without referencing Gate.io. Contravention is an infringement of Copyright Act and may be subject to legal action.
Start Now
Sign up and get a
$100
Voucher!
Create Account