Fiber Network is a next-generation public Lighting Network built on Nervos CKB, which achieves fast and low-cost multi-currency payments and peer-to-peer transactions through off-chain channel technology. This network supports RGB++ assets, providing a Decentralization, fast, and low-cost payment method, allowing users to make instant transactions between different digital assets, while maintaining high security and privacy protection through on-chain Settlement when the channel is closed.
In addition, Fiber Network has also been specially designed with interoperability with the BTCLighting Network, enabling seamless transfer of assets between the two networks, thereby expanding users’ payment options and network coverage. With these technologies, Fiber Network aims to bring higher transaction efficiency and broader application scenarios to the BTC ecosystem.
Since the birth of Bitcoin, blockchain technology has continuously evolved and expanded into fields such as Smart Contracts, Decentralized Finance, Non-fungible Tokens, etc. However, it has faced challenges in scalability and transaction speed. To address these issues, Lighting Network, as a second-layer scaling solution for Bitcoin, achieves fast and low-cost micropayments through off-chain transactions and payment channel technology.
As an innovative Block chain platform, Nervos CKB provides better scalability and interoperability for the BTC network through its unique design. The Fiber Network project leverages the advantages of CKB, combines the experience of the Lighting Network, and aims to create a fast, low-cost, Decentralization real-time Payment Network for multiple assets to support large-scale user demand, dropMoney Laundering, and provide second-level payment confirmation, while supporting multi-asset payments and Cross-Chain Interaction interoperability.
The capacity of Lighting Network (source:BitcoinVisua)
The overall architecture of the Fiber Network includes off-chain payment channels, on-chain contracts, multi-hop routing, and monitoring services, among other core modules.
The core idea of payment channel technology is to move the transaction process off the blockchain and only perform on-chain operations when the final state needs to be updated to the on-chain block.
The off-chain payment channel is the core of the Fiber Network, through which multiple off-chain transactions can be realized, and on-chain Settlement only takes place when the channel is closed. This mechanism can bypass the performance limitations of mainchains such as BTC, enabling fast off-chain transactions, significantly reducing the number of on-chain transactions, and improving transaction speed while reducing Money Laundering.
The general workflow is as follows:
Taking Alice and Bob as an example, they can open a payment channel by creating a multisig account on-chain in a Blockon-chain and depositing a certain amount of funds respectively. In this example, suppose Alice and Bob each deposit 100 units of funds. After that, they can freely transfer funds multiple times within the payment channel until they decide to close the channel, at which point their final balance will be updated on-chain.
Assuming that after a series of transactions, Alice and Bob’s balances become Alice 70 units, Bob 130 units. If either of them wants to close the channel, they can submit this final balance to the on-chain Block for Settlement. This process may seem simple, but it actually involves some complex mechanisms to ensure the security of the transactions and the integrity of both parties.
In order to deal with potential fraudulent activities, such as Bob attempting to deceive the system with an outdated transaction status, the payment channel adopts two key concepts: “commitment transactions” and “revocable Secret Key”. After each transaction, both parties will generate a new pair of commitment transactions, which declare their current balance in the channel. These commitment transactions are asymmetric, meaning their unlocking conditions are different for both parties, thus providing a balancing mechanism for both parties.
If Bob tries to submit an expired commitment transaction, Alice can punish Bob by using the revocation Secret Key to seize his funds. This mechanism ensures that any attempt to Double Spending will be appropriately penalized, thus protecting the integrity of the payment channel.
Fiber Network further optimizes this process based on CKB implementation. Compared with BTCLighting Network, Fiber can natively support multiple assets, including CKB, BTC, and RGB++ stablecoins, not just BTC. In addition, due to the Layer1 mainchain that Fiber relies on is CKB, the fees for opening and closing payment channels are much lower, which makes Fiber Network have obvious advantages in user experience. Through these mechanisms, Fiber Network provides a fast, low-cost, and secure payment channel solution.
Payment Channel Lifecycle (Source:Nervos
WatchTower is an important part of the Fiber Network and BTCLighting Network, acting as a 24/7 security role. In payment channels, participants need to monitor each other at all times to prevent the submission of expired commitment transactions to the on-chain Block. However, since users cannot be online all the time, the design of WatchTower becomes particularly important.
The main function of WatchTower is to help users monitor on-chain activities. Once it detects that someone has submitted an expired commitment transaction, it will take immediate action to ensure the security of channels and funds. Specifically, Alice or Bob can pre-construct the corresponding penalty transaction (using the revocation Secret Key to handle expired commitment transactions and declare themselves as the beneficiary), and send the plaintext of the penalty transaction to WatchTower. Once WatchTower detects that an expired commitment transaction has been submitted on-chain, it will immediately submit the penalty transaction for targeted punishment.
In order to protect user privacy, Fiber Network only requires users to send the hash value of expired commitment transactions and the Plaintext of penalty transactions to WatchTower. At the beginning, WatchTower does not know the specific content of the commitment transactions, only the hash value. Unless someone actually submits an expired commitment transaction on-chain, WatchTower will see the Plaintext and then submit the penalty transaction. This design means that unless someone behaves maliciously, WatchTower usually does not see the transaction records of channel participants. Even if it does, it will only see one of the transactions.
Compared with the traditional BTCLighting Network, Fiber Network has made some optimizations in the design of WatchTower. In the BTCLighting Network, the penalty mechanism related to revoking Secret Key is called “LN-Penalty”, which has some drawbacks, such as WatchTower needing to save all expired promise transaction hashes and corresponding revoking Secret Keys, which will bring a lot of storage pressure. However, Fiber Network improves the design of revoking Secret Key by implementing Daric protocol, which allows the same revoking Secret Key to be used for multiple expired promise transactions, thus greatly reducing the storage pressure of WatchTower and user clients.
In the payment channels of BTCLighting Network and Fiber Network, WatchTower plays a role in security monitoring, responsible for protecting their funds when users are offline. To better understand this concept, suppose Alice and Bob have opened a payment channel, where they can trade instantly without having to write every transaction to the blockchain each time. However, this mechanism also carries risks - either party may submit an expired commitment transaction in an unfair situation in an attempt to steal funds.
For example, suppose Alice and Bob each generate a new commitment transaction for each completed transaction, ensuring the latest update of the payment channel status. However, if Bob suddenly decides to act maliciously and attempts to submit an expired commitment transaction—for example, he submits an old transaction that has already been updated and invalidated, hoping to take advantage of Alice’s past fund status. In this case, if Alice is not online, she will not be able to immediately discover Bob’s malicious behavior.
At this time, the role of WatchTower is crucial. Alice sends the relevant punishment transaction Plaintext to WatchTower in advance and informs its hash value. When Bob attempts to submit the expired transaction, WatchTower will immediately identify the expired transaction and submit the punishment transaction pre-constructed by Alice, so that Bob not only cannot successfully steal funds, but also will be punished, and Alice can receive compensation.
Through this process, WatchTower not only protects Alice’s interests, but also reduces the pressure of constantly monitoring the payment channel for her.
WatchTower mechanism (Source: Geek web3)
Multi-hop routing and HTLC/PTLC technologies are core mechanisms in the Blockchain Payment Network, used to achieve secure and flexible value transfer:
In the Fiber Network, the combination of multi-hop routing and HTLC/PTLC technology enhances the flexibility, security, and privacy of the Payment Network. Multi-hop routing allows users to transfer funds through multiple intermediate Nodes, even if there is no direct payment channel between the parties. This can be achieved through the public network structure and the Dijkstra shortest path Algorithm, ensuring efficient completion of transactions.
HTLC ensures that the intermediary Node completes the transaction on time through time lock and hash lock, otherwise the funds will be automatically returned to prevent the intermediary Node from acting maliciously. PTLC further enhances privacy protection by having each Node use a different Secret Key to avoid exposing the correlation of the transaction path.
This combination not only extends the coverage of the Payment Network, but also ensures the security and privacy of transactions, solving the vulnerabilities in traditional Lighting Network, such as substitution transaction loop attacks, making Fiber Network a more secure and efficient payment system.
Assuming Alice wants to transfer 100 yuan to Daniel, but there is no direct payment channel between them. In the Fiber Network, Alice can use multi-hop routing and HTLC/PTLC technology to complete this transaction with the help of an intermediate Node.
Bob
Daniel knows that he has Secret Key R, so he submits the Secret Key within the specified time and receives 100 dollars from Carol. Then, after receiving the Secret Key, Carol also passes it to Bob within the specified time, and Bob provides the Secret Key to Alice, completing the entire transaction. Bob and Carol each earn a transaction fee, while Alice successfully transfers 100 dollars to Daniel. In this process, PTLC technology enhances privacy protection, with each hop’s Secret Key being independent. Bob and Carol will not know the complete transaction path and cannot infer the relationship between Alice and Daniel, protecting the privacy of both parties.
In the Fiber Network, this kind of transaction is not only secure, but also selects the optimal path through the Dijkstra Algorithm to ensure fast and low-cost completion of transactions. At the same time, Fiber’s storage optimization makes the implementation of HTLC/PTLC more efficient, reducing the storage burden of the network and improving overall performance.
Fiber and BTCLighting Network can achieve cross-domain payments through HTLC (hash time lock contract) and PTLC (point time lock contract) to ensure the atomicity of the cross-domain process. This means that in cross-domain payments, all steps either succeed or Rollback all, avoiding partial success and partial failure, thus ensuring the security of user assets.
This design allows Fiber and BTCLighting Network to interoperate, enabling users to seamlessly transfer funds between the two networks. For example, users can transfer funds to BTCLighting Network users on the Fiber network, or exchange CKB or RGB++ assets for BTC through the Fiber network.
The specific process can be understood as follows: suppose Alice wants to transfer CKB in the Fiber network to Bob in the BTCLighting Network. She can achieve this transaction through the cross-domain intermediary Ingrid. Ingrid runs nodes in both networks, acting as a middleman. Alice pays CKB to Ingrid, and Ingrid pays BTC to Bob.
For example, suppose Bob wants to receive 1 BTC. Alice and Ingrid agree on an exchange rate of 1.1 CKB for 1 BTC. Alice pays Ingrid 1.1 CKB, with 0.1 CKB as Ingrid’s fee. Ingrid then pays Bob 1 BTC on the BTCLighting Network. In this process, through the mechanism of HTLC, Ingrid must know Bob’s Secret Key R to complete the payment and ensure that Alice’s money is not lost in transit.
Built on Nervos CKB, Fiber Network has broad potential applications in the encryption industry’s core business models, including Cross-Chain Interaction payments, Cross-Chain Interaction Liquidity Mining, Cross-Chain Interaction lending, and Decentralization exchange (DEX). In these scenarios, Fiber’s technical details provide a foundation for efficient and secure operations.
Cross-Chain Interaction Payment is an important use case of the Fiber Network. Through off-chain payment channels and HTLC contracts, Fiber provides a multi-currency, fast, and low-cost Cross-Chain Interaction Payment function. Users can make instant payments between the BTC network and other chains (such as Nervos CKB) without intermediaries or trusting third parties.
For example, user A can transfer CKB or other supported RGB++ assets to user B from the BTC network through Fiber. Technically, Fiber ensures the security of Cross-Chain Interaction payments through HTLC contracts: A locks the funds and initiates the transaction, and B unlocks the funds after providing the correct hash pre-image, ensuring trustless execution of the transaction. If B fails to unlock in a timely manner, the funds will be automatically returned to A. The interoperability with the BTCLighting Network further enhances the payment coverage of Fiber, supporting more asset types and bringing higher transaction flexibility.
Atomic Cross-Chain Interaction exchange process between CFN and Lighting Network (source:Nervos
By utilizing Fiber’s Cross-Chain Interaction channel and multi-hop routing function, users can provide Cross-Chain Interaction Liquidity for a variety of assets and earn profits from it through Liquidity Mining.
Specifically, users can lock BTC in Fiber’s payment channels to provide liquidity for meme coins or other tokens in the BTC ecosystem, supporting cross-chain interaction issuance and transactions of new assets. Through off-chain payment channels, users can provide off-chain liquidity without frequent on-chain operations by updating channel states. This not only greatly reduces on-chain transaction costs, but also improves the efficiency of liquidity. In addition, Fiber’s watchtower service also protects liquidity providers by monitoring transactions and channel states in real time, preventing malicious users from attempting to attack using old channel states.
With the cross-chain interaction capability of Fiber, users can use mainstream assets such as BTC as collateral to borrow stablecoins or other tokens on the CKB network or other on-chain platforms.
In this lending scenario, the HTLC contract once again plays a key role: the borrower first locks BTC on the BTC network and initiates a lending transaction, and the lent stablecoin is transferred to the CKB network via the Fiber network. The hash lock and time lock mechanisms of HTLC ensure the security and trustless operation of the lending process. Even if there are problems with off-chain transactions, users can still safely retrieve locked assets through on-chain contracts. In this way, Fiber builds a decentralized, permissionless cross-chain interaction lending market, breaking the boundaries of traditional lending markets.
Interaction of Fiber Network with other networks (Source:Nervos
Cross-Chain Interaction Decentralization exchange (DEX) is another important scenario supported by Fiber. Through Fiber’s Cross-Chain Interaction technology, users can trade Decentralization between BTC, CKB, and supported RGB++ assets without relying on the matching service of centralized exchange.
Specifically, Fiber’s multi-hop routing feature allows users to transfer assets through multiple intermediate Nodes to complete Cross-Chain Interaction, without the need to establish payment channels directly with the counterparty, greatly enhancing the flexibility of transactions. At the same time, HTLC contracts provide security guarantees for the transaction process, with each Node locking funds through hash locks and time locks to ensure that each step of the transaction can be safely completed. Ultimately, this low-cost, fast Cross-Chain Interaction transaction feature will greatly enhance the Liquidity of assets in the BTC and CKB ecosystems, and drive the expansion of Decentralized Finance applications.
By combining these technical details, Fiber Network demonstrates strong application potential in scenarios such as Cross-Chain Interaction payments, Liquidity Mining, lending, and Decentralization transactions, becoming an important infrastructure for driving innovation and development of the BTC and Nervos CKB ecosystems.
Currently, the Fiber Network has completed the prototype development, released related demos, successfully implemented the basic functions between two Nodes, including the opening, updating, and closing of channels, and verified the Cross-Chain Interaction functionality with Bitcoin Lighting Network. The relevant project code can be found in the following GitHub repository:
In the future development plan, the team will focus on completing the development of multi-hop routing and watchtower services, and at the same time improve RPC interfaces and SDKs to make it easier for developers to access the Fiber Network.
The multi-hop routing protocol is based on the Dijkstra Algorithm, which is used to search for payment paths, thereby reducing routing fees and improving the success rate of multi-hop path payments. After the official launch of the Fiber Network, the team plans to optimize the routing algorithm based on network traffic and actual operation conditions. It is expected to provide 2 to 3 path search strategies to meet users’ different routing preferences and needs. In addition, the Fiber Network will also introduce a multi-path payment strategy, dividing larger payment amounts into multiple parts and transmitting them through different paths to further improve the success rate of payments.
The Watchtower service will be provided by some nodes in the Fiber Network, which will remain online, monitor network anomalies in real time, and assist in protecting assets in the channels. The monitoring service will also track the Cross-Chain Interaction hub service to ensure successful transactions with the Lighting Network even if the user is offline for a period of time.
In addition, the team also plans to add more features to the Fiber Network, such as utilizing CKB’s programmability to achieve privacy protection Algorithm, and optimizing routing Algorithm and Watchtower service on this basis to enhance the security and privacy of user payment information.
Fiber Network, as a next-generation public Lighting Network based on Nervos CKB, provides fast and low-cost multi-currency payment and transaction capabilities for the BTC and CKB ecosystems. It improves transaction speed and reduces costs through off-chain payment channels and multi-hop routing technology, while supporting cross-chain interaction interoperability, enhancing network scalability, and improving asset liquidity. In addition, Fiber Network introduces monitoring services to enhance security and provide a solid foundation for Decentralized Finance applications, driving innovation and development throughout the ecosystem. In short, Fiber Network is an important infrastructure project that promotes transaction efficiency and flexibility in the BTC and CKB ecosystems.