Lightning Network technology solves the problems of transaction congestion and high handling fees in blockchain, allowing users to conduct fast and low-cost transactions, making large-scale application of blockchain technology possible. In the past few years, countless developers have devoted a lot of effort to this track. Yesterday, CKB released the "Next Generation Lightning Network" Fiber Network Light Paper. This technology provides RGB++ assets with fast, low-cost and decentralized multi-currency payment and peer-to-peer transaction solutions, demonstrating the team's excellent technical skills. Influenced by this good news, CKB rose nearly 20% and became a dazzling star project in the market. So, what is the Lightning Network, what problems does it solve, and how does Fiber Network make this technology land? Let me tell you in detail.

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 implement its financial attributes, so that Bitcoin can not only be used to buy pizza, but also become a means of daily transactions and achieve large-scale application (mass adoption). However, blockchain technology itself, especially the most recognized Bitcoin chain, faces many challenges in scalability and transaction speed. Simply put, transactions are slow and expensive, and it is difficult to meet the needs of daily use.

1. Slow transactions (AKA "scalability issues"): This is mainly reflected in the low "transactions processed per second (TPS)" and the slow "packaging confirmation speed".

First, due to the limitation of block size, the Bitcoin network can only process 7 transactions per second, and the Sol chain, which has been called "high throughput", has an average daily TPS of only 1,000 transactions. In the payment network that is widely used in reality, this number is negligible. For example, the TPS of the UnionPay 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 - if it is processed through the Bitcoin network, it will take 21 hours to process the order volume in one second. Such a network speed cannot meet the actual needs at all. If Alipay uses the Bitcoin network for processing, it would probably have been scolded to bankruptcy.

Secondly, after the transaction in the blockchain is processed, it still needs to go through the block packaging and confirmation process to complete a transaction. This usually takes ten minutes on the Bitcoin chain, but it may take up to several hours if there is a block jam. Imagine that when you buy a bottle of mineral water in a supermarket and pay with your card, you have to sit in the store for several hours before you hear the prompt "2 yuan has been received through Alipay" at the cash register. Only then will the merchant let you leave with confidence. Who would like such a payment experience?

2. Expensive transactions: When there are too many transactions at the same time, transaction fees (handling fees) will rise sharply. In order to prioritize their own transactions, there are often gas wars on the chain. For example, during the day before yesterday's Babilon pledge and the halving of runes in the first half of the year, the on-chain fee was as high as 2,000 satoshis/byte. Due to the high gas, there was even a situation where the cast inscriptions increased tenfold to recover the cost. In life, who would be willing to pay a 20 yuan handling fee for a bottle of 2 yuan mineral water? Not to mention that the handling fee is also affected by the activities of the entire chain. If you encounter a popular application such as Babilon, your transaction may be postponed indefinitely, which is obviously unacceptable.

图像

Through this 2 yuan bottle of mineral water, I believe everyone has basically understood the problems of blockchain, especially Bitcoin chain, in achieving widespread application. Next, let’s see how the Lightning Network solves these problems.

Lightning Network

The Lightning Network solves this problem in three main ways:

1. Bookkeeping (AKA "payment channel"): The Lightning Network allows transactions to be completed without on-chain settlement by creating a "payment channel", which is settled once the channel is closed. It is similar to the "bookkeeping" or "credit" method in life. Back to the supermarket mentioned above, in order to solve the problem of high single transaction fees and slow settlement, the merchant can open a book for you to record every transaction and settle once a month. In the Lightning Network, the "payment channel" plays the role of a book, and in order to avoid the situation of running away, when establishing a channel, both parties need to lock a part of the funds (the merchant confirms that you have money in your card and will not run away, and you confirm that the merchant has goods in the store and will not go bankrupt).

2. Middleman (AKA "multi-hop routing"): In the above example, if your friend from out of town comes to visit and also wants to go to the same store to buy a bottle of water, it is obviously not cost-effective to let the supermarket create a separate ledger for this transaction. If the two of you have a lot of economic transactions and have your own ledgers, you can be the middleman to buy a bottle of water from the supermarket. In the Lightning Network, "routing" plays the role of middleman, and "multiple routes" means that multiple middlemen can complete a transaction.

3. Cash on delivery (AKA "Hash Time Lock Contract (HTLC)"): In multi-person transactions, the Lightning Network ensures the security of transactions through HTLC, which can be understood as a "three-party escrow, cash on delivery" process in online shopping. When the buyer places an order, the money is locked in Alipay and a requirement is created that "logistics shows that the goods are delivered to the delivery address within X days". The merchant must meet this requirement to obtain the payment, otherwise the buyer can request a refund. In the Lightning Network, the smart contract plays the role of Alipay, and the "logistics information" is the content of the HTLC.

P.S. In actual applications, the two-way delivery channel also includes two-way information transmission and interactive sequence game and other technical security guarantees. The multi-party interactive HTLC also includes multiple conditions. This article only makes the most basic abstraction of the simplest model.

Summarize:

Through bookkeeping, the Lightning Network solves the problems of slow and expensive transactions;

By using a middleman, the Lightning Network avoids the problem of high costs;

Through cash on delivery, the Lightning Network ensures the security of transactions.

It can be seen that the “accounting method”, or “the construction of payment channels”, is the core of the Lightning Network’s solution to transaction difficulties, while other designs are further optimizations of the Lightning Network. Therefore, in the following introduction to the Fiber Network, we will focus on the construction of its payment channels.

Fiber Network

CKB has built a fast, low-cost and decentralized multi-asset real-time payment exchange network by building off-chain channels on Nervos CKB, including four core modules: off-chain payment channels, on-chain contracts, multi-hop routing, and monitoring services.

图像

1. Off-chain payment channels (Fiber Channels):

The core mechanism of the CKB Lightning Network is to lock a certain amount of RGB++ assets by creating a payment channel on the chain. During the opening of the channel, off-chain transactions can be performed at will, and only the channel status is updated (accounting), and no on-chain broadcast (settlement) is performed. When either party closes the channel, on-chain broadcast is performed.

Most notably, in Fiber Network, what can circulate are:

①BTC native assets;

②CKB ;

③RGB++ native assets

This shows that Fiber Channels not only allows Bitcoin native assets such as inscriptions and runes (through access to RGB++ Layer) to enter the Lightning Network, but also RGB++ native assets such as CKB, Seal, and Nervape can enter the Lightning Network (it is worth mentioning that RGB++ Token represented by Seal may be the first Bitcoin new protocol asset to circulate directly on the Lightning Network, leading other assets into the Lightning era). Even with the help of RGB++ Layer, assets of all UTXO chains (ADA, DOGE, LTC, etc.) can enter the Lightning Network, truly realizing "all chains return to one", and this level of infrastructure is unique in the world.

More importantly, the 1:1 BTC reserve-backed ccBTC previously issued by ccTokens in cooperation with CKB Eco Fund and Meson Finance, as well as the overcollateralized stablecoin RUSD that has been launched on the test network, can also circulate in the Fiber Network. The circulation of ccBTC means the potential support of 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 wide acceptance. Not everyone is willing to accept CKB, Seal or even BTC, but most people are receptive to USDT, USDC, RUSD and other USD-anchored stablecoins.

It can be said that on Fiber Network, the Lightning Network technology has been recognized on a large scale (ccBTC), applied on a large scale (RUSD), and has gathered UTXO ecological consensus (RGB++ Layer), which has become an achievable goal for the first time.

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

Multi-hop routing: Fiber Network is designed based on the Dijkstra algorithm, which allows the payer to automatically find the optimal path through the routing module, without the need for the user to manually explore existing channels. Back to the example above, your friend does not need to know that the channel between you and the supermarket owner exists. He only needs to shout to the sky, "I want to buy a bottle of water!", and God will guide him to complete the purchase process.

Monitoring service: In Fiber Network, transactions within the channel are secured by HTLC, while the creation, opening, and closing of the channel itself are secured by the monitoring service. By analogy, if you find that there are several extra expenses in the supermarket's account book, you will most likely retrieve the store's surveillance to check whether the boss has maliciously recorded when it should not be recorded, in order to protect your own rights and interests.

Current progress and plans

At present, Fiber Network has realized the basic functions of creating, updating and closing channels between two nodes, and has also verified the cross-chain function with Bitcoin Lightning Network. Next, multi-hop routing and monitoring services will be completed and more developers will be allowed to access. In addition, the privacy protection algorithm will be implemented through the programmability of CKB, and the routing algorithm and monitoring service will be optimized based on this to protect the security and privacy of user payment information.

Future Outlook

After we have established such an excellent lightning network, how to apply it and how to implement it have become the next direction of thinking. In addition to the offline payment field that must be mentioned whenever the lightning network is mentioned, the lightning network has a variety of application potentials. In all application scenarios that meet the requirements of "high interaction" and "multi-objects", the lightning network can have a place. This article will temporarily give a few examples to stimulate discussion.

①Depin, or "decentralized physical infrastructure network", Depin devices combine blockchain with real-world infrastructure, which involves a large amount of data transmission, resource-sharing data exchange and small 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 certain cross-chain capabilities. It is reported that CKB has also made a major breakthrough in the Depin project recently, and its self-developed Depin box will once again shock the market.

②P2P information transmission on the chain. For believers of blockchain technology, instead of using the word "decentralization", "Peer to Peer" can more accurately describe their pursuit. The practice of traditional information transmission and downloading methods has demonstrated the efficiency advantage of the P2P model, and the construction of the Lightning Network's "channel" and "multi-hop routing" just meets the needs of P2P transmission in the blockchain world, completing information transmission efficiently while ensuring information security.

③Gamefi, in Web3 games, some games involve very frequent on-chain interactions with smart contracts, and constantly clicking on authorization verification greatly affects the gaming experience. If the Lightning Network is introduced, a channel is established at the start of the game, and the channel is closed and on-chain settlement is performed at the time of settlement. This technical support makes it possible to get an immersive experience in the full-chain game.

Conclusion

When I first came to the CKB ecosystem, I didn’t know Cipher or Lao Wang. They seemed far away from me, hiding in their own world. Later, starting from the popular “Who the hell are you?”, from in-depth exchanges with OGs in the CKB ecosystem, and from snooping into the discussions of the big guys in the group, the images of Cipher, Zhang Ren, Jan, Lv Guoning, knwang, Quake and other CKB technical big guys in my mind gradually became fuller.

They are a bit nerdy and a bit crazy, and they stick to their principles to the point of being a bit annoying; they don't seek perfection, but they seek to be at peace with themselves. They make mistakes and reflect on them, and they are proud of their technology and in awe of it. In the six years of CKB, they survived the deep bear market and the halving. Even if they were criticized by the community, they would never start a new business. They always adhere to the decentralized, retail-shared blockchain spirit and always indulge in the infinite charm of blockchain.

Today, through the lines of this light-cover book, I seem to be able to see young boys with a little timidity and uneasiness on their faces, but they can't hide the pride in their hearts. They carefully held the bright pearl that had been carved and polished with great concentration for four years, and walked forward with joy, eager to set it in their lover's crown with their own hands.

The ideal light shines ahead.



References

https://medium.com/@NervosCN/fiber-network-%E5%9F%BA%E4%BA%8E-ckb-%E7%9A%84%E5%85%AC%E5%85%B1%E9%97%AA%E7%94%B5%E7%BD%91%E7%BB%9C-55e497e13a49

https://blog.csdn.net/jingzi123456789/article/details/104807107

https://learnblockchain.cn/article/5707

https://www.sohu.com/a/359912076_99950532

https://www.odaily.news/newsflash/376599