As we all know, BTC, as the pioneer of the blockchain industry, has been criticized for its transaction speed. Most people outside the industry cannot understand the logic behind the existence and rise of this thing. Even investors who have just been exposed to Crypto for two or three years cannot understand why the term consensus can generate value.
This article is not an article about BTC consensus, but a science popularization about improving BTC efficiency. I hope that through some simple data and examples, you can understand that the current BTC transfer is not single and slow, but has different solutions. solutions to meet global transfer needs.
1. Ways to improve efficiency📈
Since the birth of Bitcoin, it has expanded many application scenarios in more than ten years. With the development of the blockchain/encryption industry, Bitcoin's performance shortcomings have become particularly criticized. For this reason, a variety of different efficiency solutions have been derived. According to the status of their usage scenarios, they are mainly divided into two different factions: on-chain and off-chain.
On-chain expansion advocates transforming the blockchain itself to solve the problem from the root, such as modifying the block size to accommodate more transactions, or adjusting the block generation speed to solve transaction efficiency issues. But this solution has also been criticized by some early supporters of Bitcoin, who believe that this solution violates the original intention of Bitcoin.
The conflict of opinions has resulted in different branches creating many projects that are similar to Bitcoin but are better than Bitcoin in performance. These projects are currently classified as the "altcoin" sector. Among them, LTC, which is the most eye-catching, is superior to BTC in all aspects of performance, and BCH is also another chain that forked from the original BTC block, and its performance is better than the original chain.
However, none of the above solutions have developed very well, and most people in the industry are still fans of Bitcoin.
Therefore, the off-chain solution has become a more acceptable technical solution, which is also the main content of this article.
2. The reason for the birth of Lightning Network🌐
There are two aspects of Bitcoin transactions that are extremely unfriendly to users:
🐌Slow speed: The Bitcoin network can only process about 7 transactions per second. In this deintermediated Bitcoin network, each transaction needs to be confirmed by the entire network, resulting in the effective confirmation time of each transfer taking 1 hours (Bitcoin’s seven blocks confirm transactions, and one block takes ten minutes), and this method is also called on-chain processing.
🥇Expensive: The handling fee is easy to understand. Now Alipay also charges a handling fee of Qianyi for cash withdrawals. Although the Bitcoin transaction transfer fee has nothing to do with the amount, it is a "bidding" mode: when there are too many transactions, if you want to jump in line ——If you process your own transfer first, you will need to pay higher handling fees. At the peak of the Internet, the highest handling fees cost dozens, hundreds or even more dollars, which was prohibitive.
Based on the above two points, the core development team of Bitcoin has been vigorously promoting the use of "Lightning Network" since 2016. It is used by the Bitcoin community as an off-chain payment solution to solve the above two problems. A frequently criticized issue.
3. What is Lightning Network? ⚡
The Lightning Network, as its name suggests, has transaction speeds as fast as "lightning". Before explaining it in detail, let’s take a look at two more important numbers:
The latest data shows that "...the total capacity of the Lightning Network has increased to 5196.86 BTC..." "...the number of Lightning Network channels is 75,728..."
The above two data actually reflect the two prerequisites when using the Lightning Network: 1. Users of the Lightning Network need to pre-store Bitcoin in the network; 2. The Lightning Network is a distributed channel network built based on nodes;
You can also simply understand that the user deposits the bitcoins in the Lightning Network in advance and obtains the quota. Only the two parties of the transaction need to confirm each other, and no third-party accounting is required, and the transfer and consumption can be quickly realized. The larger the pre-stored number in the channel, the more Bitcoins can be traded and the more users there are.
It is equivalent to opening a fast transaction channel to carry frequent transaction amounts, and the transaction data in the channel is not actually uploaded to the chain until the final transaction is completed.
(图源:1ML)
Another data worth paying attention to is the number of nodes. Currently, the number of Lightning Network nodes is 15,989. What does this number mean?
For example, these nodes are like express delivery outlets. With the help of these nodes, we can establish more and more express routes (transaction routes), thereby easily reaching any party in the network and conducting transactions. It is also known as the Lightning Network. That's where it comes from.
Channels are transaction paths established between nodes. In principle, the more channels there are, the faster off-chain transactions will be. Most of the current Bitcoin instant transfer solutions rely on the Lightning Network.
The Lightning Network is logically similar to an ATM machine. Banks need to pre-deposit a certain amount of cash in ATM machines around the country for deposit and withdrawal in order to avoid excessive counter deposits and withdrawals causing a run.
The more nodes there are, the more channels there will be, and the more channels there are, the faster the speed will be, and the lower the cost (because of competition) will be. Joseph Poon, author of the Lightning Network paper, said: The fees people will charge will be infinitely close to zero.
4. Working principle of Lightning Network㊙️
After understanding the above two data, let's briefly look at the usage process of Lightning Network:
First time using Lightning Network:
1. You need to pre-deposit some Bitcoins (together with the counterparty) into the Lightning Network;
2. You establish a connection channel with the counterparty trader;
3. Transfer money in the established channel and it will arrive within seconds;
4. After the transaction is completed, if you do not need to withdraw money, you can choose to keep this channel;
5. If you choose to reflect, the channel will be closed and the amount in the final state will be uploaded to the chain for processing.
Second and subsequent uses of the Lightning Network:
1. You can choose to pay directly with the counterparty to establish a channel, or you can use the connection between the existing channel and other channels to establish a channel with multiple nodes for transit (the latter is theoretically cheaper);
2. Transfer money in the channel and arrive in seconds;
3. The transaction ends.
As the above repeats, the Bitcoin capacity and number of nodes in the network will increase and increase, and our transfer experience will become better and better, the speed will become faster, and the cost will become lower and lower. Finally, when you need to withdraw cash, you can close the corresponding channel, and the final account settlement data needs to be released on the Bitcoin network, which returns to the "transaction on-chain" mentioned at the beginning of the article.
To facilitate understanding, let me give an easy-to-understand example:
☕If the coffee shop I frequent announces that it supports Bitcoin payments at this time, then they need to build an off-chain Lightning Network channel. A lightning network channel is established between the platform APP they developed and the payment software (digital wallet) we use. At the same time, we need to download the APP they developed. We obtain the platform by pre-depositing a certain amount of Bitcoin to the APP. Payment amount.
🛒Each consumption transaction only settles the payment amount of the platform. When we no longer want to go to their home for consumption and want to withdraw money, the final data settlement will be sent back to your digital wallet to complete the on-chain processing, and the transaction will end from then on.
从上面的描述中我们可以看到:闪电网络之所以“闪电”,是将大部分交易放到链下来实现。在此所举例的例子比较浅显,实际的链下交易的安全则由智能合约、加密算法、数字签名等等技术来进行保证,操作起来更加复杂。
It is easier to understand the principles of the Lightning Network for the off-chain transaction channels built by merchants. If the actual operation is point-to-point individual, it will also involve the set punishment mechanism👊
For the sake of space and user preferences, I will not introduce the point-to-point punishment mechanism in this article. However, if you are curious about this, you can tell me in the background private message or leave a message at the end of the article, and I will make a dedicated article. Explain its principle~
In addition, it needs to be noted here that the Lightning Network, as a protocol, can not only be deployed on the Bitcoin network. Since the development of the industry, basic public chain platforms have similar off-chain expansion protocols (because on-chain expansion is more difficult) , its essence is an expansion plan for the platform, but we often don’t pay attention to them when using the product.