In-depth discussion of the past, present and future of BTC Layer2

Bitcoin (Bitcoin), referred to as BTC, is an open-source encrypted currency system based on the decentralized consensus of blockchain and using point-to-point network communication. It is jointly maintained by computer networks and nodes distributed all over the world.

The BTC white paper was released by Satoshi Nakamoto on October 31, 2008, and then on January 3, 2009, the BTC consensus chain produced the first block. However, as the encryption community and ecology grow and prosper, the early BTC technology has been unable to meet users' needs for the scalability of the cryptocurrency system. The complexity and community resistance of directly improving the BTC underlying protocol will increase the risk of the BTC system, leading to hard forks and community splits.

A more suitable solution is BTC Layer 2, which is to build a new layer based on BTC without changing BTC. It is compatible with BTC and meets users' needs for scalability. **This article investigates BTC Layer 2, comprehensively expounds the status quo and problems of BTC, as well as the technical solutions and advantages and disadvantages of BTC Layer 2, and looks forward to its future. **

1. Technical introduction of BTC

The core of BTC is distributed ledger technology, which uses blockchain to store transaction data. The blockchain is based on a hash pointer linked list structure. Each section of the linked list is a data block, which contains the hash value, transaction data, time data, mining parameters and protocol version information of the previous block. In the BTC network, the writing power of the new blockchain, that is, the bookkeeping right, is obtained by nodes following the Proof of Work (PoW) mechanism and relying on computing power competition. After the node that has obtained the bookkeeping right successfully writes a new block, it will receive a certain amount of Bitcoin tokens as a reward, so this process is also called mining.

The block data structure of BTC, image source:

Image source of BTC bookkeeping workflow:

BTC adopts a transaction-based ledger scheme based on transfer records, which only records transfer information in the blockchain without maintaining account balances. **Therefore, in order to prevent double-spending attacks, nodes need to maintain a set of unspent transaction output data (Unspent Transaction Outputs, UTXO) locally, and need to provide the source of funds when transferring accounts, so that nodes can verify the legitimacy of transactions.

UTXO diagram of a single account, image source:

BTC uses asymmetric encryption and hashing algorithms to organize accounts, secure and verify transactions. An account includes account private key and account public key. The account private key is a randomly generated private key, and the account's public key is generated by processing the private key through elliptic curve multiplication. In addition, the address of the account is generated after processing the public key with a hashing algorithm. After the transaction is signed by the private key, it is broadcast to the nodes through the peer-to-peer network. The node uses the corresponding public key to verify the transaction, and after the verification is successful, the transaction is packaged in a new block.

Signature and verification of BTC account private key and public key, image source:

Nakamoto, Satoshi. “Bitcoin whitepaper.”

The consensus mechanism of BTC is PoW. All nodes each construct a new block header such that its hash value is less than or equal to a given target value. The node that first finds the eligible block header has the right to bookkeeping for the next block. By adjusting the size of the target value, the block generation time can be indirectly adjusted. The larger the target value, the easier the mining and the shorter the block generation time; the smaller the target value, the harder the mining and the longer the block generation time. BTC expects the block time of each block to be 10 minutes. Therefore, BTC will readjust the target value every 2016 blocks, that is, adjust the mining difficulty.

Proof Of Work process example, image source:

2. Current status of BTC and problems encountered

BTC is the first digital currency system widely recognized by the global cryptocurrency community. Since 2013, the market value of BTC has accounted for more than half of the total market value of cryptocurrencies all year round, and it is a well-deserved leader in cryptocurrencies.

BTC market capitalization ratio, source:

For a long time, BTC has been sought after by users for its pioneering status and high security. However, with the growth of cryptocurrency users, it is difficult for BTC to satisfy users' requirements for low fees, convenience, instant, privacy protection, and diverse assets of the cryptocurrency system. And the growing demand for diverse applications. In the long run, the ratio of the market value of BTC to the total market value of cryptocurrencies is slowly declining. Compared with Ethereum's prosperous ecology, Solana's low handling fee and high TPS (Transactions Per Second) and other public chains with their own merits, BTC seems to have no other core competitiveness except popularity and security, and faces the following problems:

The transaction speed is slow, the confirmation time is long, and it is not convenient enough:

The capacity of each block of BTC is 1 M, and the data of each transaction is about 250 B, so each block contains up to 4000 transactions. Calculated according to the expected block time of 10 minutes, the TPS of BTC is only about 7. Transactions on BTC need to wait 6 blocks for credible confirmation, which results in a final confirmation time of about 1 hour. In addition, the transfer on BTC can only transfer all the balance out at one time. For change, you need to declare the transfer back to your own address, otherwise it will be rewarded to the miners. This cannot meet users' needs for transaction convenience and instant.

High transaction fees:

When users use BTC to conduct transactions, they need to pay a service fee to attract miners to package the transaction. The higher the service fee, the faster the transaction confirmation speed. When the transaction is congested, the handling fee will become extra expensive, reaching more than 60 US dollars in 2021. From May 14, 2020 to May 15, 2023, Bitcoin transaction fees will cost an average of $4.66. This fee cost prevents many users from using BTC.

Smart contract programming is not supported:

BTC does not support the direct construction of complex applications, and can only start from the protocol layer. However, the cost of developing applications from the protocol layer is much higher than that through standardized smart contracts. This limits the development of diverse applications and assets of BTC.

BTC fee, source:

3. Improving the resistance of BTC and the Layer 2 solution

technical difficulty:

The problems encountered by BTC stem from the fact that the old technical solutions cannot meet the current needs. Even if fine-tuning is performed directly on BTC, the problems cannot be completely solved, and new problems will be derived instead. If BTC is expanded, each block is increased from 1 M to 100 M, and the TPS is increased to 700, it will result in nearly 5 T of new ledger data every year, which will increase the threshold for operating nodes and affect the degree of decentralization of the system , increasing the system risk. Even without considering the size of the ledger data, calculated based on the median Internet bandwidth of 13 Mbps and the size of each transaction in a block being 250 B, the TPS upper limit of BTC is 13 Mbps/8 Mb/250 B ≈ 6815, which cannot be used on Polkadot , Solana and other public chains that can support tens of thousands or even hundreds of thousands of TPS compete. Bitcoin Cash (BCH) expands the block size of BTC and increases the block size of BTC. However, BCH client errors occur frequently, and it increases the operating cost of the full node, which brings centralization risks. In 2019, in order to combat attackers who exploited BCH code vulnerabilities, BCH mining pools launched a 51% attack to modify transaction data.

Community Resistance:

**Between security and scalability, the BTC community prioritizes security. **BTC core developers are cautious about technical risks, so they are very conservative in the suggestion of directly expanding BTC. The simplest extension is to increase the size of each block of BTC. The proposal to increase the BTC block size has been supported by many users, miners and developers since 2015. By increasing the block capacity, users can obtain faster transaction speeds, and miners can charge more transaction fees. However, some developers, led by Wladimir van der Laan, the head of the BTC developer team, disagree with this expansion method and support solutions such as Segregated Witness and Lightning Network. The debate on block expansion caused the BTC community to split. Finally, after BTC introduced the isolation upgrade technology, some people rejected this technology upgrade. In August 2017, it caused a hard fork of BTC and derived BCH. After the hard fork of BCH, the block limit was increased to 8 M, and then increased to 32 M, with an average TPS of around 120. In addition, in 2018, the BCH community split again due to differences in technology upgrade routes, and hard forked out of BSV (Bitcoin Satoshi Vision). This fork caused the total computing power of the BCH network to plummet, and it has not reached the level of computing power before the fork. The upper limit of the block size of BSV has been increased to 4 G, but lacks miners and users, and is far less secure than BTC.

BTC's bifurcation history, image source:

BCH network total computing power history, image source:

Layer2 scheme:

In fact, the complexity of directly changing BTC is high and the resistance of the community is high. The solution that is more accepted by the community is to build a new layer based on BTC, which is compatible and does not affect the BTC system while solving the above problems. BTC has extremely high security. Using BTC as the core layer, relying on BTC block data and using BTC scripts, developers can build a BTC-compatible system on the upper layer of BTC, and place a large number of transactions outside BTC. The final state data is written into BTC. This type of scheme is called BTC Layer 2.

4. The goal and development history of the second layer of BTC

BTC Layer 2 refers to the second-layer expansion technology of Bitcoin (BTC). This type of technology aims to increase the transaction speed of Bitcoin, reduce handling fees, increase scalability, and solve a series of problems faced by BTC.

Layer2 development goals:

Increase transaction speed: Layer 2 tries to increase the transaction speed of Bitcoin by optimizing the transaction processing method, batch processing transactions under the chain, and using the latest pairing technology to synchronize and verify each transaction under the chain, thereby expanding the global scope of Bitcoin. application and promotion within.

Reduce transaction costs: Layer 2 processes transactions in batches under the BTC chain, and only writes the final state of the transaction into BTC. The intermediate transactions and states in the final state and initial state exist off the chain and are not synchronized on BTC, reducing the Transaction fees, and reduce the burden on Bitcoin's underlying blockchain.

Increased scalability: The introduction of Layer 2 technology aims to alleviate the scalability problem of Bitcoin's underlying blockchain, making it more capable of dealing with future transaction volume growth.

In recent years, Layer 2 has been one of the most important investment themes in the crypto industry, but it specifically refers to Ethereum’s Layer 2 expansion plan in most scenarios. However, BTC’s expansion plan is much earlier than the Ethereum expansion proposal. Even Ethereum was created after Vitalik Buterin's proposed improvements to BTC were rejected.

In 2012, the concept of Pegged Sidechains was first proposed, derived from Two-way Peg, which allows assets to be seamlessly transferred between the two chains. This proposal laid the foundation for later sidechain technology.

In 2014, Blockstream was established to start researching and developing sidechain technology to improve the scalability of Bitcoin.

In 2015, the Lightning Network white paper was released, and Tadge Dryja and Joseph Poon were the authors of the white paper. Lightning Network is a solution that separates small transactions from the main chain. By creating a two-way payment channel, there is no need to record intermediate transactions on the blockchain, and only the final state needs to be recorded on BTC.

Because the design of BTC is relatively simple, and it is not flexible and scalable, it is difficult for the early BTC Layer 2 scheme to be embedded in Bitcoin, so it has not aroused great repercussions.

Until 2017, SegWit (Segregated Witness) was upgraded and activated, which solved the problem of transaction plasticity in the Bitcoin blockchain and made possible the development of Layer 2 technology.

Since 2018, developers have gradually begun to deploy Lightning Network nodes, and have gained certain users and support. According to statistics from the bitcoinvisuals website, as of June 4, 2023, the number of nodes in the Lightning Network has exceeded 18,000, and the number of payment channels that can accommodate exceeds 70,000. The network capacity exceeds 5,000 bitcoins, worth more than 100 million U.S. dollars .

Recently, the emergence of the BRC-20 token standard has further enriched the related ecology of Bitcoin, and at the same time brought BTC Layer 2 into the public eye. There are many projects building BTC Layer 2, the most well-known being the Lightning Network.

5. Lightning Network

The Lightning Network was first proposed in 2015 by Joseph Poon and Thaddeus Dryja in their white paper. The Lightning Network uses micro-payments channel technology to place a large number of transactions outside the Bitcoin blockchain, and only put key links on the chain for confirmation. The transaction process is as follows: a user who needs to trade opens a room for offline transactions. When entering the room, the user pledges the currency to obtain a bill, and uses the new bill to distribute the pledged currency of both parties. After the transaction is completed, when the room is out, the transaction is settled. The latest note redemption currency.

Technical Introduction to Lightning Network

In order to construct a safe and reliable micropayment channel, Lightning Network adopts Recoverable Sequence Maturity Contract (RSMC) and Time Lock Contract (Hashed Timelock Contract, HTLC) as key technologies.

RSMC provides pledge and settlement functions, that is, a multi-signature wallet fund pool. Both parties to the transaction pre-deposit a part of the funds into the fund pool. In the initial case, the distribution plan of both parties is equal to the pre-stored amount. Every time a transaction occurs, it is necessary to jointly confirm the fund distribution results generated after the transaction, and sign at the same time to invalidate the old version of the distribution plan. When any party needs to withdraw cash, he can write the transaction result signed by both parties to the blockchain network to be confirmed. From this process, we can see that BTC transactions are only required when withdrawing cash. The party who first initiates the withdrawal arrives 1000 blocks later than the other party, and the other party can refute within this time window.

The transaction process of Lightning Network, image source:

HTLC establishes a transaction channel for both parties, analogous to a transaction room, sets a validity period, and automatically settles when the validity period expires. At the same time, HTLC also agrees on cross-channel transaction rules to facilitate transaction routing: In the Lightning Network, the establishment of transaction channels requires cost, and there may be no existing transaction channels between any two users. At this time, transaction channels that exist with other people can be used as Intermediary, conduct transactions.

Payment channels and routing of the Lightning Network, image source:

However, the early Lightning Network had the following problems:

Each transaction requires two parties to operate: In the channel, each transaction requires both parties to confirm the signature, and no unilateral transfer is possible

It requires a game between the two sides of the transaction: if A and B conduct a transaction, and A uses the old transaction result to initiate a withdrawal, B can only submit an updated version of the transaction result as a rebuttal within 1000 blocks, otherwise A’s withdrawal will take effect

Channel state management: Users need to dynamically synchronize and back up the state of the channel, otherwise, if an old state is submitted, the counterparty can initiate a fraudulent rebuttal, request a claim, and obtain all assets in the channel

In fact, early versions of the Lightning Network required users to run full-node wallets or use fully-custodial wallets due to the aforementioned issues. Full-node wallets require users to manually manage temporary private keys and channel status, and the transaction experience is not good. Fully managed wallets, such as Chivo used in El Salvador, have a low threshold for use, and the custodian automatically operates on behalf of the user. However, the custodian has control over the private key of the user account, and its security is worrying. As developers continue to develop the Lightning Network, the above problems are gradually being resolved, and a more complete Lightning Network and supporting facilities have been developed, such as OmniBOLT and the OBAndroid Lightning Network wallet developed by its team.

All BOLT

Omni means complete and complete, while BOTL is the abbreviation of Basis of Lightning Technology. Based on BTC and Omni Layer, OmniBOLT proposes a complete Lightning Network protocol. While expanding the function of Lightning Network to pay BTC, it can also issue and trade diversified assets based on Omni Layer, and supports the automated market maker mechanism (AMM: Automated market makers), allowing users to use the fund pool of the payment channel as liquidity on the Lightning Network to build and use decentralized exchanges. OmniBOTL has a grand vision, but at present, the technology is complex, involving multiple protocols and systems, and there may be risks of vulnerabilities, and more time is needed to test its security.

OmniBOLT protocol architecture, image source:

OBAndroid is a full-featured Lightning Network full-node mobile wallet. In this wallet, while the user has control over the private key, it can automatically monitor transactions, quickly synchronize full-node data, and support cloud and local backup channel status. In addition, OBAndroid also supports Omnilayer assets to be traded through OmniBOTL. OBAndroid makes the trading experience of the Lightning Network acceptable to users, lowering the threshold for using the Lightning Network.

OBAndroid full node wallet, image source:

6. Other BTC Layer 2 projects

In addition to the Lightning Network, there are other BTC Layer 2 projects in development:

Syscoin is developed by the SYSLab team forking the BTC source code, aiming to take advantage of the security of BTC and be compatible with the Ethereum ecosystem. Currently, the SYSLab team has launched NEVM (Network-Enhanced Virtual Machine), a virtual machine built using the security of BTC's PoW, compatible with Ethereum smart contracts. In addition, the SYSLab team also plans to launch ZK and Optimistic's Rollup, Validium with on-chain Proof of Data and other projects. The Syscoin project has little information, and it is difficult to evaluate its pros and cons technically. However, its source code library is updated frequently and is still under stable development.

Syscoin’s roadmap, source:

RGB (Really Good for Bitcoin) is a BTC smart contract system integrated with Lightning Network, proposed by Giacomo Zucco and Peter Todd in 2016. RGB leverages BTC to maintain censorship resistance and combat double spend attacks. In RGB, the transaction and verification of all tokens are processed off-chain, and only the party receiving the payment needs to perform client verification. The client checks the source of funds of the payer in BTC, and after confirming that the transaction is valid, it directly modifies the UTXO of both parties without writing the transaction data into the blockchain, which has the feature of protecting privacy. In addition, the client can directly introduce the function of the smart contract to judge the rules of the transaction, and because the global state consensus is not required, the data of the smart contract does not need to be uploaded to the chain, and the privacy feature can also be guaranteed. The RGB community has developed a Turing-complete smart contract virtual machine AluVM (algorithmic logic unit VM), which has good scalability, security and privacy protection.

Comparison of transactions on RGB and transactions on BTC, source:

Comparison of AluVM with other programming modes, source:

7. BTC Layer2 Summary and Outlook

Although Bitcoin is the world's earliest, safest, most well-known and highest-valued blockchain network, its ecological development has continued to deepen. For example, the channel capacity of its largest second-layer network, the Lightning Network, continues to grow, the Taproot upgrade improves the efficiency and privacy of Bitcoin, and the Taro protocol introduces stablecoin payments and on-chain native NFTs to the Lightning Network. However, compared with the number of Bitcoins on the Ethereum chain, the Bitcoin capacity of the Lightning Network is relatively low, and due to the full node data synchronization and channel state management, the use threshold of the Lightning Network is high, and the user scale is not as good as that of Ethereum, but This status quo may indicate huge growth potential. With the further development of Lightning Network-related ecology, the continuous development of the improved version of the Lightning Network protocol like OmniBOLT and the OBAndroid wallet that lowers the threshold for use will make the Lightning Network finally have good security and scalability. It is accepted by users because of its reliability and ease of use, which may bring the market value of BTC to a higher level.

At the same time, we also need to pay attention to the development of other Layer 2 projects, such as the RGB scheme with natural privacy protection and Syscoin compatible with the Ethereum ecosystem. These projects are not as famous as the Lightning Network, but they can also solve the problems faced by BTC, and have advantages that other solutions cannot match. However, compared to the second-tier extension projects of Ethereum, these projects are not well-known enough, have received less investment, and do not receive the support of the BTC core development team like the Lightning Network. Their expansion of BTC will most likely be later than Ethereum The implementation of extensions, such as Syscoin's Rollup solution. In terms of Layer 2 ecology, it seems that the Ethereum ecology has a better virtuous circle and is more favored by investors.

In the future, we may see accelerated expansion of the Bitcoin ecosystem. As the Lightning Network infrastructure improves and attracts more and more attention, Lightning Network-based projects like OmniBOLT and RGB can benefit from it, gaining a better development foundation, more users and even more investment. And BTC Layer 2 projects compatible with Ethereum such as Syscoin will also benefit from the rapid development of Ethereum's second-layer ecosystem and accelerate the progress of its roadmap. In addition, the discussion on the BTC expansion scheme has not stopped: the Bitcoin-based zk-rollups two-layer network proposed by John Light in 2022 may bring more functions, higher scalability and Better privacy while maintaining its decentralized nature; Block, a company led by former Twitter CEO Jack Dorsey, is promoting the liquidity improvement of the Lightning Network, which may mean that the Bitcoin ecosystem will be more popular in payments, DeFi, NFT, etc. Outside the field, open up a new track to cover more users.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)