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 the large-scale application of blockchain technology possible. Over the past few years, countless developers have devoted a lot of effort to 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%, becoming 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 land, so that Bitcoin can be used not only to buy pizza but also as a means of daily transactions, achieving mass adoption. However, blockchain technology itself, especially the most recognized Bitcoin chain, faces many challenges in terms of scalability and transaction speed. In simple terms, it is slow and expensive, making it 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. If these transactions were processed through the Bitcoin network, it would take 21 hours to complete the orders of that second. Such network speed cannot meet practical needs. If Alipay were to use the Bitcoin network for processing, it would have been criticized and bankrupted 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. In the Bitcoin chain, this usually takes ten minutes, but it can also take several hours in the case of block congestion. Imagine that after buying a bottle of mineral water in a supermarket and paying with a card, you have to sit in the store for several hours before hearing the prompt "Alipay received 2 yuan". The merchant will not let you leave until then. Who would like such a payment experience?
2. Expensive transactions: When there are too many transactions at the same time, transaction fees will rise sharply. In order to prioritize their transactions, there is often a gas war on the chain. For example, during the Babylon staking and the half-yearly reduction of the rune, 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 cost of forging inscriptions increased tenfold before breaking even. In life, who would be willing to pay a transaction fee of 20 yuan for a bottle of 2 yuan mineral water? Not to mention that transaction fees are also affected by the activities of the entire chain. If popular applications like Babylon are launched, your transaction may be indefinitely delayed, which is obviously unacceptable.
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 in one go 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 problems of high transaction fees and slow settlement for a single transaction, the merchant can open an account for you and record every transaction between you. Settlement is done once a month. In the Lightning Network, "payment channels" act as the accounts, and to avoid the possibility of running away, both parties need to lock a certain amount of funds when establishing the channel (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 for his transaction. If you and your friend have frequent financial transactions and have your own accounts, you can buy a bottle of water from the supermarket through you as an intermediary. In the Lightning Network, "routing" acts as the intermediary, and "multi-hop routing" means that multiple intermediaries can complete a transaction.
3. Cash on delivery (AKA "Hash Time-Locked Contract (HTLC)"): In multi-party transactions, the Lightning Network ensures the security of transactions through HTLC, which can be understood as the "three-party custody, cash on delivery" process 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 act as Alipay, and the "logistics information" is the content of HTLC.
P.S. In actual applications, bidirectional channels for mutual delivery also include technical guarantees such as bidirectional information transmission and interactive order games to ensure security. Multi-party interactive HTLC also includes multiple conditions. This article only abstracts the simplest model.
Summary:
- Through the accounting method, the Lightning Network solves the problems of slow transactions and expensive transactions.
- Through intermediaries, the Lightning Network avoids high costs.
- 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, we will focus on the establishment of its payment channels.
Fiber Network#
CKB has built off-chain channels 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.
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 status (accounting) without on-chain broadcasting (settlement). When either party closes the channel, on-chain broadcasting is performed.
What is worth noting is that in the Fiber Network, the following can circulate:
- BTC native assets
- CKB
- 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 unification of ten thousand chains". Such infrastructure is unique in the world, with 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 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 widespread acceptance. Not everyone is willing to accept CKB, Seal, or even BTC, but most people are willing to accept USD-pegged stablecoins like USDT, USDC, and RUSD.
It can be said that on the Fiber Network, the Lightning Network technology has been widely recognized (ccBTC), widely applied (RUSD), and has gathered consensus from the UTXO ecosystem (RGB++ Layer) for the first time.
On-chain contracts#
Fiber Network currently uses HTLC to ensure security. With the help of CKB's Turing completeness, contract functionality will be further expanded in the future, such as introducing version-based revocation mechanisms and more secure fund locking mechanisms.
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 secured by HTLC, and the creation, opening, and closing of the channel are secured 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 CKB's programmability, and based on this, routing algorithms and monitoring services will be optimized to protect the security and privacy of user payment information, among other things.
Future Outlook#
After building such an excellent Lightning Network, how to apply it and implement it becomes the next direction of consideration. 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 further ideas.
- 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 number of DePIN devices indicates the load of the blockchain network, and the Lightning Network provides DePIN devices with cross-chain capabilities. It is reported that CKB has made significant breakthroughs in the DePIN project recently, so stay tuned.
- P2P on-chain information transmission. For believers in blockchain technology, "peer-to-peer" is a more accurate description of their pursuit than "decentralized." The practice of traditional information transmission and downloading 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 precisely meets the needs of P2P transmission in the blockchain world, efficiently completing information transmission while ensuring the security of information.
- 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. By introducing the Lightning Network, channels can be established at the beginning of the game and closed at the end of the game for on-chain settlement. This technological support 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, nor did I know who Lao Wang was. They seemed distant to me, hidden in their own world. Later, starting from the momentary popularity of "Who are you, XX," and through in-depth exchanges with the OGs of the CKB ecosystem, I gradually formed a more complete image of Cipher, Zhang Ren, Jan, Daniel, knwang, Quake, and other CKB technical experts 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 strive to be worthy. They make mistakes and reflect on them, proud of technology and respectful of technology. In the six years of CKB, they have survived the bear market and the halving, even if they have been criticized by the community, they will never start a new project, always adhering 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 hint of shyness and unease on their faces, but they cannot 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: