banner
CKB 中文

CKB 中文

CKB 是理想的比特币 Layer 2

Four years of ingenuity, Nervos adorns the blockchain with a brilliant pearl - Fiber Network Whitepaper Interpretation

Author: hamburger (Builder of the Seal community); Original article link: https://x.com/bc1phamburger/status/1827338974438039960

Lightning Network technology solves the congestion and high transaction fees problems of blockchain, allowing users to make fast and low-cost transactions, making it possible for the widespread application of blockchain technology. Over the past few years, countless developers have put a lot of effort into this field. Last week, CKB released the "Next Generation Lightning Network" Fiber Network Whitepaper, which provides a fast, low-cost, and decentralized multi-currency payment and peer-to-peer transaction solution for RGB++ assets, demonstrating the team's excellent technical expertise. Influenced by this positive news, CKB rose nearly 20% and became a shining star project in the market.

So, what is the Lightning Network, what problems does it solve, and how does Fiber Network enable this technology to be implemented? Let's listen to the following detailed explanation.

Background#

Bitcoin, the representative of blockchain technology, is defined as a "peer-to-peer electronic cash system". As an innovative technology in the financial field, the lifelong wish of many practitioners is to make its financial attributes come true, so that Bitcoin can be used not only to buy pizza but also as a means of daily transactions, achieving mass adoption. However, the blockchain technology itself, especially the most recognized Bitcoin chain, faces many challenges in terms of scalability and transaction speed, simply put - slow transactions and high transaction costs, which are difficult to meet the needs of daily use.

1. Slow transactions (AKA "scalability problem"): This is mainly reflected in the low "transactions per second (TPS)" and slow "confirmation speed" of each block.

Firstly, due to the limitation of block size, the Bitcoin network can only process 7 transactions per second, which has been called "high throughput". The Solana chain, which is widely used in payment networks in reality, has an average TPS of only 1,000 transactions. This number is negligible. For example, the TPS of the banking system is 240,000 transactions per second, and during the Double Eleven period in 2019, the Alipay system processed 544,000 orders in one second. It would take 21 hours to process the orders of that second through the Bitcoin network. Such network speed cannot meet the actual needs. If Alipay uses the Bitcoin network for processing, it would have been criticized and closed down long ago.

Secondly, after the transactions in the blockchain are processed, they still need to go through the process of block packaging and confirmation to complete a transaction. This generally takes ten minutes on the Bitcoin chain, but it can take several hours in the case of block congestion, etc. Imagine that when you buy a bottle of mineral water at a supermarket and complete the payment with your card, you have to sit in the store for several hours before you hear the prompt "Alipay received 2 yuan" from the cashier. The merchant will not let you leave with peace of mind until then. Who would like such a payment experience?

2. High transaction costs: When there are too many transactions at the same time, transaction fees will rise sharply. In order to prioritize their own transactions, there is often a gas war on the chain. For example, during the Babylon staking and the half-yearly reduction of the printing of runes, the on-chain fees reached as high as 2000 satoshis per byte. Due to the high gas fees, there was even a situation where the inscription had to increase tenfold to break even. In life, who would be willing to pay a transaction fee of 20 yuan for a bottle of mineral water that costs 2 yuan? Not to mention that transaction fees are also affected by the activities of the entire chain. If you encounter popular applications like Babylon, your transaction may be indefinitely delayed, which is obviously unacceptable.

img

Through this bottle of 2 yuan mineral water, I believe everyone has a basic understanding of the problems of blockchain, especially the Bitcoin chain in achieving widespread application. Next, let's take a look at how the Lightning Network solves these problems.

Lightning Network#

The Lightning Network solves this problem mainly in three ways:

1. Accounting (AKA "payment channels"): The Lightning Network allows transactions to be completed without on-chain settlement by creating "payment channels" and settling them all at once when the channel is closed. Similar to the "accounting" or "credit" method in real life. Going back to the supermarket mentioned earlier, in order to solve the problem of high transaction fees and slow settlement for a single transaction, the merchant can open an account book for you and record every transaction between you. Settlement is done once a month. In the Lightning Network, "payment channels" play the role of account books, and to avoid the situation of running away without paying, when a channel is established, both parties need to lock a certain amount of funds (the merchant confirms that you have money in your account and won't run away, and you confirm that the merchant has goods in the store and won't close down).

2. Intermediaries (AKA "multi-hop routing"): In the example mentioned above, if your friend from out of town wants to buy a bottle of water from the same store, it is obviously not cost-effective for the supermarket to open a separate account book for his transaction. If you and your friend have frequent economic transactions and have your own account books, you can buy a bottle of water from the supermarket through you as an intermediary. In the Lightning Network, "routing" plays the role of an intermediary, and "multi-hop routing" means that multiple intermediaries can complete a transaction.

3. Cash on delivery (AKA "Hash Time-Locked Contracts (HTLC)"): In multi-party transactions, the Lightning Network ensures the security of transactions through HTLC, which can be understood as the process of "three-party custody and cash on delivery" in online shopping. When a buyer places an order, the money is locked in Alipay, and a requirement of "the logistics show that the goods have been delivered to the shipping address within X days" is created. The merchant must meet this requirement to receive the payment, otherwise the buyer can request a refund. In the Lightning Network, smart contracts play the role of Alipay, and the "logistics information" is the content of HTLC.

P.S. In actual applications, the bidirectional channels for mutual delivery also include technical guarantees such as bidirectional information transmission and interactive order games to ensure security. The HTLC for multi-party interactions also includes multiple conditions. This article only abstracts the simplest model.

Summary:

  1. Through the accounting method, the Lightning Network solves the problems of slow transactions and high transaction costs.
  2. Through intermediaries, the Lightning Network avoids high costs.
  3. Through cash on delivery, the Lightning Network ensures the security of transactions.

From this, it can be seen that the "accounting method" or the "establishment of payment channels" is the core of the Lightning Network's solution to transaction difficulties, and other designs are further optimizations of the Lightning Network. Therefore, in the introduction of Fiber Network that follows, the focus will be on the establishment of its payment channels.

Fiber Network#

CKB has built an off-chain channel on Nervos CKB to create a fast, low-cost, and decentralized multi-asset real-time payment and exchange network, including off-chain payment channels, on-chain contracts, multi-hop routing, and monitoring services as the four core modules.

img

Off-chain payment channels (Fiber Channels)#

The core mechanism of CKB's Lightning Network, which creates payment channels on-chain and locks a certain amount of RGB++ assets. During the channel opening period, off-chain transactions can be freely conducted, only updating the channel state (accounting) without on-chain broadcasting (settlement), and on-chain broadcasting is done when either party closes the channel.

What is worth noting is that in Fiber Network, the following can circulate:

  1. BTC native assets
  2. CKB
  3. RGB++ native assets

This means that Fiber Channels not only allow Bitcoin native assets such as inscriptions and runes (through the integration of RGB++ Layer) to enter the Lightning Network, but CKB and RGB++ native assets such as Seal and Nervape can also enter the Lightning Network (it is worth mentioning that RGB++ tokens represented by Seal may be the first Bitcoin new protocol assets to circulate directly on the Lightning Network, leading other assets into the Lightning era). Even with the help of the RGB++ Layer, the assets of UTXO chains (ADA, DOGE, LTC, etc.) can enter the Lightning Network, truly achieving "the convergence of all chains". Such infrastructure is unique in the world and has no branches.

More importantly, ccBTC, which was issued in cooperation with ccTokens, CKB Eco Fund, and Meson Finance, and the over-collateralized stablecoin RUSD, which has been launched on the testnet, can also circulate in the Fiber Network. The circulation of ccBTC means potential support from BTC whales (it is understood that many BTC OGs only recognize the Lightning Network as the second layer of BTC), and the circulation of RUSD means widespread acceptance. Not everyone is willing to accept CKB, Seal, or even BTC, but most people are willing to accept USDT, USDC, and RUSD, stablecoins anchored to the US dollar.

It can be said that on the Fiber Network, Lightning Network technology has been widely recognized (ccBTC), widely applied (RUSD), and the convergence of UTXO ecosystems (RGB++ Layer) has become an achievable goal for the first time.

On-chain contracts#

Fiber Network currently uses HTLC to ensure security. With the help of the Turing completeness of the CKB chain, contract functions will be further expanded in the future, such as introducing a revocation mechanism based on version numbers and a more secure fund locking mechanism.

Multi-hop routing#

Fiber Network is designed based on the Dijkstra algorithm, allowing the payer to automatically find the optimal route through the routing module without the need for manual exploration of existing channels. Going back to the previous example, your friend doesn't need to know that there is a channel between you and the supermarket owner. He just needs to shout to the sky, "I want to buy a bottle of water," and the heavens will guide him through the purchase process.

Monitoring services#

In the Fiber Network, transactions within the channel are guaranteed by HTLC, and the creation, opening, and closing of the channel are guaranteed by monitoring services. By analogy, if you find that there are extra expenses in the supermarket's account book, you will most likely check the in-store surveillance footage to see if the owner maliciously recorded at the wrong time, in order to protect your own rights and interests.

Current Progress and Plans#

Currently, Fiber Network has implemented the basic functions of creating, updating, and closing channels between two nodes, and has also verified the cross-chain functionality with the Bitcoin Lightning Network. Next, multi-hop routing and monitoring services will be completed, and more developers will be allowed to join. In addition, privacy protection algorithms will be implemented through the programmability of CKB, and based on this, the routing algorithm and monitoring services will be optimized to protect the security and privacy of user payment information, etc., which are also part of the plan.

Future Outlook#

After building such an excellent Lightning Network, how to apply it and implement it becomes the next step to consider. In addition to the offline payment field that is inevitably mentioned whenever the Lightning Network is mentioned, the Lightning Network has diverse application potential. In all application scenarios that meet the requirements of "high interactivity" and "multiple objects", the Lightning Network can have a place. This article briefly mentions a few examples to stimulate more ideas.

  1. DePIN, which stands for "Decentralized Physical Infrastructure Network". DePIN combines blockchain with real-world infrastructure, involving a large amount of data transmission, resource sharing, data exchange, and small-value transactions. The more DePIN devices there are, the higher the load on the blockchain network. The Lightning Network not only solves these problems but also provides DePIN devices with cross-chain capabilities. It is reported that CKB has made significant breakthroughs in the DePIN project recently, so stay tuned.
  2. P2P on-chain information transmission. For believers in blockchain technology, "peer-to-peer" is a more accurate description of their pursuit than "decentralization". The practice of traditional information transmission and download methods has shown the advantages of the P2P model in terms of efficiency. The construction of "channels" and "multi-hop routing" in the Lightning Network just meets the needs of P2P transmission in the blockchain world, efficiently completing information transmission while ensuring the security of information.
  3. GameFi. In Web3 games, some games involve frequent on-chain interactions with smart contracts, and constantly clicking to authorize verification greatly affects the gaming experience. If the Lightning Network is introduced, a channel can be established at the beginning of the game, and the channel can be closed and settled on-chain at the end, which makes it possible to achieve an immersive experience in full-chain games.

Conclusion#

When I first came to the CKB ecosystem, I didn't know who Cipher was, and I didn't know who Lao Wang was. They seemed far away from me, hidden in their own world. Later, starting from the once popular "Who are you, XX?", and deepening exchanges with the OGs of the CKB ecosystem, peeping into the discussions of the big shots in the group, the images of Cipher, Zhang Ren, Jan, Daniel, knwang, Quake, and other CKB technical experts gradually became clear in my mind.

They are a bit nerdy and a bit crazy, sticking to their principles to the point of stubbornness. They don't seek perfection, but they seek to be true to themselves. They make mistakes and reflect on them, proud of their technology and respectful of technology. In the six years of CKB, they have survived the bear market and the halving, and even if they are criticized by the community, they will never start a new project. They always adhere to the decentralized and retail-sharing spirit of blockchain, always immersed in the infinite charm of blockchain.

Today, through the lines of this whitepaper, I can see a group of young people with a touch of youth, with a hint of timidity and uneasiness on their faces, but unable to hide their inner pride. They carefully hold the brilliant pearl that has been meticulously crafted and polished for four years, and walk forward with excitement, eager to set it in the crown of their loved ones with their own hands.

The light of the ideal shines ahead.

References:

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.