The History and Importance of Bitcoin Layer 2 Scaling Solution: Why Lightning Network Matters?
星球君的朋友们
2023-08-10 11:20
本文约8097字,阅读全文需要约32分钟
Decompose the Bitcoin scaling solution and the Lightning Network technology in detail.

Original author: Chloe

Original source:chain teahouse

Binance posted on its official Twitter on June 20 that many netizens have discovered that Binance has completed the construction of Bitcoin Lightning Network nodes. And just after Binance announced that it had completed the deployment of Bitcoin Flashpoint network nodes, Binance CEO Changpeng Zhao also responded that relevant construction was in progress.

Looking back a few months ago, it can be speculated that Binance’s involvement in the Bitcoin Lightning Network is actually related to the BRC-20 craze in early May, which caused the Bitcoin network to explode and transaction fees to skyrocket. Moreover, on the 7th and 8th of the same month, Bitcoin withdrawals were suspended for the second time.

Previous research report (Can BRC-20 bring the Bitcoin ecosystem to new prosperity? What are the uses of Bitcoin NFT? What is BRC-30 again?) We mentioned many concepts of BRC-20, and at the end we also mentioned that the next article will focus on the Lightning Network. First I will explain what is the relationship between the two? Then we will introduce the Bitcoin expansion plan, and finally conduct in-depth research and discussion with the Lightning Network as the main axis.

Previously, applications such as NFT and BRC-20 in the Bitcoin ecosystem have become increasingly popular, causing the Bitcoin network to become increasingly congested. From a technical point of view, if the circulation of BRC-20 is supported on the Lightning Network, it will help achieve faster and more efficient transactions. Efficient transactions and unlocking new possibilities for BRC-20. However, this is also the key to Binance’s establishment of the Bitcoin Lightning Network. According to the blockchain data platform Glassnode, the average transaction fee on the Lightning Network is US$0.00013. If the Bitcoin network is used directly for transactions, the average transaction fee on the Bitcoin network is approximately US$18.9, and the price difference between the two is huge.

Seeing this benefit, Binance began to integrate the Bitcoin Lightning Network to enable deposit and withdrawal functions. However, Binance also emphasized that there is still some technical work that needs to be completed before completing the integration of the Lightning Network, and promised to continue to update everyone with the latest news.

Next, we will break down the Bitcoin expansion plan and the technical knowledge of Lightning Network in detail.

Blockchain Challenge

Let’s start with the challenges of blockchain. Moving Bitcoin on the blockchain is a slow, expensive and inefficient process. Because the Bitcoin blockchain can only handle a certain number of transactions (and data) in a certain amount of time. If Bitcoin is to remain competitive with other blockchains, there must be innovative measures to increase the utility of the network.

We must first distinguish between two key concepts: Bitcoin as an asset (BTC) and Bitcoin as a blockchain. Bitcoin as an asset has seen widespread adoption over the past few years and has huge potential for the digital asset today and into the future. However, for BTC to achieve large-scale application, it must have a seamless transaction environment (that is, the Bitcoin blockchain). Bitcoin’s blockchain is highly secure, decentralized, and stable, but Bitcoin has an obvious flaw: its limited ability to process large amounts of transaction data. To confirm transactions on the Bitcoin blockchain, they must be approved through Proof of Work (PoW) consensus. Once a certain number of miners verify the transaction, it can reach the final settlement state of the blockchain and generate a new block.

There are currently several key factors that limit the Bitcoin blockchain: first, block size, a Bitcoin block can only accommodate 1 megabyte (MB) of data; second, block time, approximately every 10 minutes to generate a new Bitcoin block; third, throughput, due to Bitcoin’s block size and block time limitations, it can only process about three to seven transactions per second; fourth, transaction costs, limited The throughput leads to high demand for limited block space, which in turn causes fees to soar when the Bitcoin network is congested; finally, programmability, Bitcoin’s language capabilities are limited, making smart contract logic difficult to implement. This also makes creating decentralized applications on Bitcoin far less simple than on Ethereum.

So why can’t developers just improve Bitcoin’s performance? Because improving the Bitcoin protocol is not as simple as imagined. First, Bitcoin was intentionally designed to be a simple blockchain. Due to the absence of complex coding and applications, Bitcoin has proven to be a highly secure, stable and decentralized blockchain today. Therefore, making sudden and substantial changes to Bitcoin would be counterproductive to the core rules of the protocol. While Bitcoin upgrades will certainly continue, no transformative solutions will be implemented overnight. Therefore, it will be difficult for the blockchain to achieve scalability on its own in the near future. However, now that Ethereum has an L2 solution, the Bitcoin blockchain must also have other solutions that can help expand the network to accommodate these billions of users. and the current status of millions of transactions per day.

While Bitcoin has its limitations, it can still scale by implementing layered solutions, bringing enhanced performance and functionality to the entire network. By building on top of Bitcoin, developers can create scaling solutions without modifying Bitcoin itself. This approach can improve the performance of regular Bitcoin transactions while benefiting from Bitcoin’s liquidity and network effects.

Layering is ETH L2?

Layering enables Bitcoin (and other assets) to be transferred without using the blockchain directly. While each Bitcoin layer has its own unique consensus mechanism to connect to Bitcoin, the goal is the same: move transactions off-chain to make it faster, cheaper, more programmable, and scalable. Next. Let’s dive into Bitcoin’s relationship with these layers.

First, we assume that Bitcoin can be used as the final settlement layer for transactions, and that it will prioritize stability, decentralization, and security. These characteristics make Bitcoin the best basis for building broader economic activity. Additionally, its native currency BTC serves as a long-term store of value asset. At the same time, a layered solution can bring greater scalability and productivity to Bitcoin without compromising the security of its base layer.

Since these layers are built on top of Bitcoin, they have no impact on the base layer and pose no risk to it from a security perspective. The layered approach enables Bitcoin to adopt new, faster and more efficient processes without sacrificing the durability or decentralization of the base layer. Simply put, Bitcoin layering has multiple advantages: first, faster transaction speed, transactions on layers can be processed in a few seconds, which is more suitable for Bitcoin users who need faster confirmation; second, more High throughput, transactions occupy less data, leaving more space for each new block; third, lower transaction fees, more efficient throughput means lower fees; fourth, increased Smart contract functions, smart contracts with complete execution environments make the development of decentralized applications possible, which greatly expands the application scenarios of Bitcoin, including decentralized finance (DeFi), non-fungible tokens (NFT) and Decentralized Autonomous Organization (DAO).

Finally, Bitcoin layering also helps simplify settlement, with micropayments and small transactions not requiring the full security of the Bitcoin blockchain. Instead, they can be moved to layers, where transactions can be confirmed almost instantly at a fraction of the cost, eventually bundled and sent to Bitcoin for final settlement.

What layering solutions are there?

There are currently four main layered solutions that help improve Bitcoin’s scalability:

(1) Stacks:

Stacks is a Bitcoin Layer 2 that supports decentralized applications and smart contracts. This technology uses a programming language Clarity for writing smart contracts. If we look at the overall system, Stacks actually has its own chain, compiler and programming language, and runs simultaneously with Bitcoin to ensure its transactions and integrity. sex.

The core concept of the project is, Because there is a basic settlement layer (Bitcoin) at the bottom to ensure consensus and security, users can add smart contracts and programmability on top of Stacks to achieve scalability and transaction speed. Among them, their core technology is to closely connect the Stacks block with the Bitcoin block through the Proof of Transfer (PoX) consensus mechanism.

In proof-of-transfer, miners on Stacks do not use mining equipment and electricity to mine Stacks, but instead use BTC to mine new STX tokens and earn transaction fees. In order to win the opportunity to mine blocks, miners will submit BTC to the qualified Stacks address participating in the consensus, thereby transferring the committed cryptocurrency to some other participants in the network, thereby winning the opportunity to mine blocks, and then earn STX Reward tokens. Through this system, miners earn STX coins and transaction fees, while STX stakers earn Bitcoin.

In addition to using anchor blocks in the final link with Bitcoin to help ensure the security and reliability of Stacks, Stacks also introduces the concept of micro-blocks, which can be used between two Bitcoins. Thousands of transactions are published between blocks. In this way, Stacks’ scalability is significantly improved and can handle higher transaction volumes, making it a more efficient and practical blockchain solution.

We have previously explained BRC-20 and Ordinals technology in the previous research report (Can BRC-20 bring the Bitcoin ecosystem to new prosperity? What is the use of Bitcoin NFT? What is BRC-30?), and this happens This is an application case of Stacks.

With the increasing popularity of Ordinals and the craze of BTC NFT (Ordinals technology), NFT activity on Stacks has also increased, which can be said to directly benefit from Stackss lower cost and faster NFT minting speed.

(2) RSK (Rootstock):

RSK (also known as Rootstock) is a general-purpose smart contract platform secured by the Bitcoin network. RSK was founded by RSK Labs to address Ethereums shortcomings by leveraging Bitcoins stability, security, and economic cornerstones. By moving its smart contracts from Ethereum to RSK, RSK makes all Ethereum applications compatible with the Bitcoin blockchain. RSK creates a new block approximately every 33 seconds, which is much faster than Bitcoin’s 10-minute block time. RSK can also process approximately 10-20 transactions per second, which is faster than Bitcoin’s approximately 5 transactions per second. Efficient.

The RSK sidechain design has some unique features compared to other Bitcoin layering solutions. First, merged mining, the RSK blockchain uses the same proof-of-work (PoW) consensus algorithm as Bitcoin, but miners can 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 merge mining and mine for both the Bitcoin and RSK blockchains at the same time, but have Bitcoin and RSK consume the same mining computing power, so the miners contribute The computing power can also mine RSK blocks, which allows merged mining to significantly increase the profitability of miners without investing additional resources.

Merged mining allows RSK to verify transactions, generate blocks and send them to Bitcoin. With this mining process, users can rest assured that RSK’s smart contracts benefit from the security of the Bitcoin blockchain.

The second unique design is Powpeg Powpeg, which is a two-way bridge between the RSK blockchain and Bitcoin. The Powpeg protocol is implemented through RSK’s asset smartBTC (RBTC). Technically, the RSK platform does not have its own native token. Therefore, RSK uses smartBTC (RBTC), which is a token issued by BTC locked on Bitcoin at a ratio of 1:1. That is, RBTC is always worth the same as BTC to cover transaction fees on RSK.

There are two main mechanisms to bridge funds between RSK and Bitcoin: vaults and smart contracts. When we want to transfer Bitcoin to RSK, this process is called pegging-in and requires the user to lock a certain amount of Bitcoin in a vault on the Bitcoin network. This will unlock the corresponding amount of Bitcoin on RSK. On the contrary, when we want to return Bitcoin from RSK to the Bitcoin network, this process is called pegging-out and requires the user to send a certain amount of RBTC (RSKs asset) to the smart contract on RSK. The corresponding number of Bitcoins will then be unlocked from the Bitcoin network’s vault.

The last unique design is the RSK Virtual Machine (RVM). One of RSK’s advantageous components is its interoperability with Ethereum smart contracts. RSK Virtual Machine (RVM) is based on the Ethereum Virtual Machine and can execute Ethereum smart contracts on RSK. Developers can seamlessly use the same code and tools when building RSK applications. This gives the Ethereum community a cheaper and faster option to interact with its favorite decentralized applications (dApps). This means that RSK developers can program using Solidity, the smart contract programming language used on Ethereum, and users can also send their RSK assets to Metamask.

(3) Liquid Network:

Liquid Network is a Bitcoin sidechain developed by Blockstream to facilitate the rapid settlement of Bitcoin transactions. The networks consensus mechanism is similar to Bitcoin, but has centralized features in the chains governance structure.

The team behind Blockstream is a digital Bitcoin core developer. Some foreign media believe that it is an all-star development team in the industry.

Here is a brief explanation of Liquid Network’s unique functions and features:

  • Fast settlement: Liquid Networks block time only takes 60 seconds, which is much faster than Bitcoins 10 minutes, which means transactions on Liquid Network can be confirmed and settled faster.

  • Low transaction fees: Liquid Network’s transaction fees are only about one-tenth of Bitcoin’s on average. This makes micropayments and everyday transactions more cost-effective.

  • Centralized structure: Unlike Bitcoin’s decentralized structure, Liquid Network has a more centralized structure. This is a compromise made to improve performance, allowing for faster transaction confirmations and higher throughput.

The main purpose of Liquid Network is to provide a solution better suited to address Bitcoin’s fast, high-frequency trading needs. It can be widely used in cryptocurrency exchanges, payment services and other financial applications to make these transactions more efficient and convenient. It should be noted that Liquid Network is still built on the Bitcoin blockchain, so it inherits the security and reliability of Bitcoin. At the same time, Liquid Network also provides faster and cheaper transaction methods to meet the growing transaction demand.

(4) Lightning Network

The Lightning Network is a new system for off-chain Bitcoin transactions that allows users to transact with each other without the need for a central institutional role like a bank. As an L2 solution for Bitcoin, it can be used to expand micropayments and daily transactions, and by using smart contracts and payment channels, two parties can quickly conduct Bitcoin transactions at almost zero cost.

Earlier we talked about the relationship between BRC-20 and the Lightning Network. Next, we will analyze the technical principles, applications and future development of the Lightning Network in detail.

Lightning network technology principle and origin

The Lightning Network leverages Bitcoin’s multi-signature wallet and offline transaction capabilities to allow participants to establish payment channels outside of the blockchain. These payment channels allow for fast and low-cost transactions between participants without recording each transaction on the Bitcoin blockchain.

In the Lightning Network, payment channels are established by bidirectional multi-signature wallets between participants. For example, lets say there are participants A and B, and they want to conduct transactions on the Lightning Network. They can create a jointly controlled multi-signature wallet and lock a certain amount of Bitcoin in it to fund the payment channel. Once a payment channel is established, A and B can conduct multiple transactions within the channel without submitting each transaction to the Bitcoin blockchain. These transactions are only recorded and verified within the payment channel. Only when they want to end the payment channel and submit the final settlement results to the Bitcoin blockchain do they need to transfer the latest channel status to the blockchain.

Payment channels in the Lightning Network use a technology called offline transactions, which allows participants to conduct transactions without a blockchain network connection. This is done by using previously confirmed transaction data on the blockchain to verify the validity of the transaction. Offline transactions allow transactions within payment channels to be completed quickly without waiting for confirmation on the blockchain.

If in the Lightning Network, if A and B want to conduct transactions within a payment channel, but there is no direct payment channel between them, they can use relay nodes to conduct transactions. Relay nodes are participants in the Lightning Network who allow the flow of funds between payment channels. Through relay nodes, A and B can establish an indirect payment channel to realize transactions. And the Lightning Network also uses a mechanism called routing to ensure the smooth transmission of payments in the network. When a payment needs to be transmitted through multiple relay nodes, the router will choose an optimal path to ensure that the payment reaches the destination smoothly.

I believe anyone who has used Google Maps for navigation can imagine that the navigation function of Google Maps provides drivers with driving route suggestions for the fastest path from point A to point B, and uses big data and their own The algorithm function helps users estimate the fastest route and estimated time required by recommended navigation guidance. This is the role of a router, which uses a concept called Lightning Paths to specify the routing of payment channels.

Finally, in addition to providing fast and cheap transactions, the Lightning Network also scales well. Because transactions on the Lightning Network do not need to be confirmed on the Bitcoin blockchain, it can support millions of transactions while remaining fast and low-cost. In summary, the Lightning Network is an innovative technology that provides an efficient, fast and low-cost transaction method by establishing a payment channel on the Bitcoin blockchain. It solves the scalability problem of Bitcoin and opens up new possibilities for the application scenarios of the Bitcoin blockchain.

The Lightning Network originated from a paper in 2015, proposed by researchers Thaddeus Dryja and Joseph Poon. Their research is based on a derivative discussion of payment channels by Satoshi Nakamoto, the creator of Bitcoin. The paper describes an off-chain protocol consisting of payment channels designed to solve Bitcoin’s scalability issues.

Just in 2016, Dryja and Poon co-founded a company called Lightning Labs, dedicated to developing Lightning Network technology. Lightning Labs has worked hard to ensure that the protocol is compatible with Bitcoin’s core network.

With the SegWit soft fork of Bitcoin in 2017, the way was paved for the implementation of the Lightning Network. SegWit increases the capacity of Bitcoin transactions, providing more space per block while solving the long-standing transaction malleability problem. Developers have begun building applications on the Lightning Network during testing ahead of launch. These applications include simple use cases such as wallets and gambling platforms, leveraging the Lightning Network’s micropayments capabilities.

Supplement: SegWit (Segregated Witness) is an important soft fork upgrade designed to improve the scalability and security of the Bitcoin blockchain. The goal of this upgrade is to solve the problem of Bitcoin’s limited transaction capacity while increasing the network’s throughput and reducing transaction fees.

The main change in SegWit is to separate the transaction signature (witness data) from the transaction body and place it in a new block called the “witness block”. This reduces the amount of data per transaction, freeing up more space to accommodate transactions. Specifically, SegWit makes changes to the transaction data structure, moving the signature data out of the transaction itself and storing it in a new block. In this way, the amount of transaction data in the block is reduced and more transactions can be accommodated.

At the same time, this change also provides greater flexibility to introduce more transaction types and features. Implementation of SegWit requires participants on the network to upgrade their Bitcoin software to support the new transaction format. Although SegWit is a soft fork, it was widely accepted by the Bitcoin community and was successfully activated in August 2017. In addition, SegWit provides the necessary foundation for subsequent Lightning Network implementations to function better.

In 2018, Lightning Labs launched a beta version of the Lightning Network on the Bitcoin mainnet and began practical applications. Since then, many well-known figures, including Twitter founder Jack Dorsey, have also begun participating in the Lightning Network project. Since then, the Lightning Network has continued to grow, attracting more developers and users. It is considered an important solution to the scalability problem of Bitcoin, providing a faster and lower-cost transaction method for Bitcoin, and opening up new possibilities for a wider range of application scenarios.

Lightning Network limitations and challenges

Currently, the Lightning Network is considered by many to be the most effective solution to the Bitcoin transaction fee problem, but this is not the case. First of all, although the Lightning Network can move transactions from the main blockchain to off-chain, thereby reducing transaction fees, there are still other costs and challenges. When using the Lightning Network, you need to pay a fee equal to a Bitcoin transaction between opening and closing a channel. These fees are the cost of using the Lightning Network. In addition, in addition to the cost of switching channels, there is an additional routing fee for transferring payments between channels. Even if the Lightning Network fee is low, this may result in nodes not having enough incentives to participate in the payment routing process.

(In the Lightning Network, nodes play the role of processing payments and are responsible for transferring payments from one channel to another. However, due to low routing fees, nodes may be unwilling to bear these costs or provide corresponding services. This may lead to Nodes are unwilling to participate in the payment routing process, resulting in payment delays or failures.)

In contrast, there are some cryptocurrencies on the market that reduce payment costs by offering free software plug-ins or through special nodes. Dash, for example, allows users to pay extremely low fees when making payments. Its system is designed with Masternodes that require a certain amount of Dash coins to be deposited in order to be able to process transactions quickly.

In addition to the fact that the Lightning Network is misunderstood as the most effective way to reduce transaction fees, there is one more point that needs clarification. Nodes that are always online are vulnerable to attacks. In Bitcoins Lightning Network, nodes must always be online to send and receive payments. This means that if both parties involved in the transaction are not online or their computers are compromised, funds can be stolen.

However, the Lightning Network also allows for the use of cold storage to keep funds safe, which is a method of storing funds offline and is considered one of the most secure methods of cryptocurrency storage. In addition, there are also some problems if offline operations are performed on the Lightning Network. For example, when one of the two transaction parties closes a payment channel and withdraws the money, but the other party is not online, this is called a fraudulent channel closure. While there is a period of time to contest the closure of a channel, if one party is offline for an extended period of time, the opportunity to contest may be missed. In addition, malicious attacks also pose risks to the Lightning Network. If a payment channel becomes congested and is subject to a malicious attack, participants may not be able to get their funds back in time because the channel is congested. Therefore, although the Lightning Network provides faster payments and low-cost transactions for Bitcoin, the requirement that nodes are always online and the risks associated with offline operations and malicious attacks still require users to consider and pay attention.

Finally, the emergence of the Lightning Network would have meant that Bitcoin could be used as a medium for everyday transactions. Users can open payment channels with companies or individuals who frequently conduct transactions. For example, they can open payment channels with landlords or e-commerce stores where they shop frequently and conduct transactions using Bitcoin. However, Bitcoin still has a long way to go before becoming a mainstream payment method. The increase in its trading volume is mainly attributed to the increase in trading volume. In other words, Bitcoins popularity is a double-edged sword, as the increased attention attracts investment, but it also attracts more traders, increasing the cryptocurrencys volatility, or price swings.

Price fluctuations make it difficult for merchants to use Bitcoin as a payment method when pricing products to sell to customers or purchasing inventory from suppliers. For example, let’s say a company needs to pay a supplier an invoice in Bitcoin. Usually, suppliers give customers a certain amount of time to pay, such as 30 days. If the price of Bitcoin increases by 10% during these 30 days, the company will need to prepare an additional 10% of fiat currency or other cryptocurrencies to convert to Bitcoin to pay the invoice. This exchange rate risk exists because a business may receive fiat currency from customers instead of Bitcoin. For consumer transactions, exchange rate risk also exists because most people are not paid in Bitcoin, so the transaction needs to be converted from fiat currency to Bitcoin. Therefore, the Lightning Network’s overall impact on reducing Bitcoin transaction fees and scaling may be limited, as Bitcoin is not yet widely accepted as a payment method.

Latest applications and news

On July 6 this year, Lightning Labs launched a new developer tool that enables the Lightning Network and artificial intelligence developer communities to build inclusive, out-of-the-box, cost-effective LLM (Large Language Model) tools. Seamlessly integrate Lightning Network and Bitcoin.

These tools are built on the L 402 protocol, the Lightning Networks native authentication mechanism, and Langchain to simplify the use of AI agents by adding external data, allowing more advanced features to be enabled.

Conclusion

It can be seen that Bitcoin’s Lightning Network still faces some challenges, whether it is to increase its scale or reduce transaction fees. However, the core team of this technology has also developed some new application scenarios and invested in a lot of research to help improve network performance.

The Lightning Network now supports larger payment amounts than before. It previously limited channel sizes to 0.1677 Bitcoins, but now these restrictions have been lifted, allowing users to create larger channels. These new designs, known as Wumbo channels, are designed to increase the adoption and usefulness of the Lightning Network for consumers and enterprises.

In addition, the Lightning Network is also being adopted by cryptocurrency exchanges, such as Kraken and Block’s Cash App, which have also integrated the Lightning Network, allowing users to conduct transactions more conveniently.

Finally, Bitcoin’s Lightning Network still has great potential to provide faster and lower-cost transactions. As the technology continues to develop and improve, we can expect the Lightning Network to bring even more convenience and widespread adoption possibilities to the use of Bitcoin and cryptocurrencies in the future.

星球君的朋友们
作者文库