Fiber Network is a next-generation public Lighting Network built on Nervos CKB and off-chain channels, providing fast, low-cost, and decentralized multi-currency payments and peer-to-peer transactions for RGB++ assets.
Background
Development and Challenges of Blockchain Technology
Blockchain technology has experienced rapid development since the emergence of Bitcoin. It has gradually expanded from simple payment functions to a wide range of applications such as smart contracts, decentralized finance (DeFi), and non-fungible tokens (NFTs). Although blockchain technology has significant advantages in security, transparency, and decentralization, it faces many challenges in terms of scalability and transaction speed.
Scalability issue: Traditional blockchains like BTC and ETH have significant limitations in transaction throughput. Due to the block size limit and 10-minute block generation time of BTC, the network can only process about 7 transactions per second. Although ETH has made some improvements, its transaction processing capacity per second is still much lower than that of traditional payment networks.
High Money Laundering: With the increasing network congestion, Money Laundering has significantly risen. For example, the gas fees on the Ethereum network at peak times may be higher than the transaction amount itself, which seriously affects user experience and reduces the feasibility of small payments.
Transaction confirmation time is long: In the traditional blockchain network, transactions need to wait for multiple block confirmations to be considered as final confirmation. This process may take from minutes to hours, which is not suitable for real-time payment applications.
Although Nervos CKB has made improvements in performance and confirmation time, it still needs to further improve transaction speed and dropTransaction Cost to meet the needs of small payments and instant payments.
The Enlightenment of Lighting Network
Lighting Network (Lightning Network) as a second-layer scaling solution for the BTC network, has successfully achieved fast and low-cost micropayments through off-chain transactions and payment channel technology. Its core concepts include:
Payment Channel: Users create a payment channel on-chain, and once the channel is open, both parties can conduct off-chain trades an unlimited number of times. On-chain Settlement only occurs when the channel is closed. This significantly reduces the number of on-chain transactions, improves transaction speed, and reduces Money Laundering.
Hashed TimeLock Contract (HTLC): Lighting Network ensures the secure transfer of funds through HTLC technology, avoiding counterparty risks. Even in the event of off-chain transaction failure, users can obtain fund security through on-chain contracts.
Routing Mechanism: Lighting Network uses multi-hop routing, which allows users to complete payments without opening a direct channel with the payee, thereby improving the flexibility and availability of the network.
Advantages of Nervos CKB
Nervos CKB is a Block chain platform that focuses on universality and security. Its unique design gives it unique advantages in solving Block chain scalability and interoperability issues:
Consensus Mechanism: Based on NC-Max[1]Consensus protocol, while combining proof of work (PoW) and state leasing mechanism, ensures network security and effective resource utilization.
The powerful Smart Contract model: CKB’s unique Cell model and RISC-V instruction set virtual machine greatly enhance the capabilities of the UTXO model, not only supporting Turing Complete Smart Contracts, but also easily realizing features such as abstract account and covenant, providing more flexible programmability for Decentralization applications, as well as better interoperability and scalability.
Economic Model: CKB’s economic model encourages long-term holding and rational use of network resources, providing a secure and sustainable decentralized ecosystem for decentralized applications, developers, and users.
The Significance of the Fiber Network project
By building off-chain channels on Nervos CKB, we hope to combine the successful experience of the Lighting Network with the technical advantages of CKB to create a fast, low-cost, and Decentralization multi-asset real-time payment exchange network. Specifically:
Solve the scalability problem: Through off-chain payment channels and multi-hop routing technology, the Fiber network can achieve high throughput transaction processing to meet the needs of large-scale users.
dropTransaction Cost: Reduce the frequency of on-chain transactions, drop Money Laundering for users, making small payments feasible and efficient.
Increase transaction speed: Achieve second-level payment confirmation experience through instant confirmed off-chain transactions, suitable for various instant payment scenarios.
Multi-asset support: Supports payment with a variety of digital assets, providing users with a wider range of payment options.
Network Interoperability Support: Supports interoperability with BTCLighting Network, providing support for Cross-Chain Interaction payments and asset transfers.
Architectural design
Overall Architecture
The overall architecture of the Fiber Network includes the following core modules:
off-chain payment channel (Fiber Channels)
on-chain contract (HTLC)
Multi-Hop Routing
Watchtower Service
Off-chain payment channel
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 is only conducted when the channel is closed. This mechanism significantly reduces the number of on-chain transactions, improves transaction speed, and drops Money Laundering.
The general workflow is as follows:
Channel Creation: Users from both parties create an on-chain payment channel, locking a certain amount of CKB or RGB++ assets.
Off-chain transactions: During the channel opening period, both parties can engage in off-chain transactions as many times as they want. Each transaction updates the channel state but does not need to be immediately broadcasted on-chain.
Channel Closure: When either party decides to close the channel, the final channel state will be broadcasted on-chain for Settlement, ensuring the final balances of both parties are confirmed.
The specific message interaction format can refer to the Fiber Network P2P Message Protocol[2]
on-chain contract
Currently, we use the Hashed TimeLock Contract (HTLC) to ensure the security of off-chain transactions and to be compatible with the Lighting Network. Through it, we can avoid counterparty risk and ensure that users can obtain fund protection through on-chain contracts even in the event of off-chain transaction failure.
The general workflow is as follows:
Transaction Initiation: The payer creates a transaction with a hash lock and time lock conditions, locking a certain amount of CKB.
Hash verification: The payment recipient must provide the correct hash original within the specified time to unlock the transaction and complete the fund transfer.
Refund on Timeout: If the recipient fails to provide the correct hash origin within the specified time, the transaction will be automatically unlocked and refunded to the payment initiator.
Thanks to the Turing completeness of CKB, we can achieve more flexible and secure on-chain contracts. We will further expand the functionality of the contracts, such as introducing version-based revocation mechanisms and more secure Point Time-Locked Contracts.
Multi-hop routing
Multi-hop routing technology allows users to complete payments through multiple intermediate nodes without directly establishing payment channels with each other. This mechanism enhances the flexibility and coverage of the network.
Workflow:
Path Discovery: The payment initiator discovers the optimal path from itself to the payment receiver through the routing module.
Path lock: Create corresponding HTLC contracts on each Node on the path to ensure the safe transfer of funds.
Payment completed: The payment recipient unlocks HTLC, and the funds are transferred sequentially to each Node on the path.
At the same time, we will also use HTLC contracts here to implement payment for Cross-Chain Interaction, and support interoperability with Lighting Network through cross-chain hub service. For details, please refer to Payment Channel Cross-Chain Protocol with HTLC.[3]
Monitoring Service
The monitoring service is an important part of the Fiber Network, responsible for monitoring the status of off-chain payment channels to ensure the security of the channels and funds. The functions and roles are as follows:
Channel Monitoring: Real-time monitoring of the payment channel status of all participating users, including the process of channel creation, update, and closure.
Abnormal detection: Detect abnormal activities in the channel, such as malicious users attempting to close the channel with an old state or attempting Double Spend Attack.
Active Response: When an abnormality is detected, promptly broadcast the latest channel status to the blockchain network to prevent financial losses caused by malicious actions.
Current Progress and Plans
We have completed a prototype of the Fiber Network, which implements the basic functions of creating, updating, and closing channels between two Nodes. At the same time, we have also verified the Cross-Chain Interaction with BTCLighting Network. The project code can be found in these two GitHub repositories:.
The next work plan is to complete multi-hop routing and monitoring services, as well as improve the RPC interface and SDK, so that more developers can easily access the Fiber Network.
The multi-hop routing protocol is based on the Dijkstra Algorithm to search for payment paths, in order to drop routing fees and improve the success rate of multi-hop path payments. After the launch of the Fiber Network, we will optimize the routing Algorithm based on network traffic and operation conditions. It is expected to provide 2-3 path search strategies to adapt to users’ different routing preferences and needs. Fiber Network will also introduce a multi-path payment strategy, dividing larger payments into multiple parts, each transmitted through different paths, further increasing the probability of payment success.
The monitoring service will be provided by some Nodes in the Fiber Network, they stay online, follow the abnormal situations in the network, and help protect the assets in the channel. The monitoring service will also track the cross-chain hub service. Even if the user is offline for a period of time, the monitoring service can ensure successful exchanges with the Lighting Network.
In addition, we will also consider adding more features to the Fiber Network, such as using the programmability of CKB to achieve privacy protection Algorithm, and based on this, optimizing the routing Algorithm and monitoring services to protect the security and privacy of user payment information.
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
Fiber Network: Public Lighting Network based on CKB
Overview
Fiber Network is a next-generation public Lighting Network built on Nervos CKB and off-chain channels, providing fast, low-cost, and decentralized multi-currency payments and peer-to-peer transactions for RGB++ assets.
Background
Development and Challenges of Blockchain Technology
Blockchain technology has experienced rapid development since the emergence of Bitcoin. It has gradually expanded from simple payment functions to a wide range of applications such as smart contracts, decentralized finance (DeFi), and non-fungible tokens (NFTs). Although blockchain technology has significant advantages in security, transparency, and decentralization, it faces many challenges in terms of scalability and transaction speed.
Although Nervos CKB has made improvements in performance and confirmation time, it still needs to further improve transaction speed and dropTransaction Cost to meet the needs of small payments and instant payments.
The Enlightenment of Lighting Network
Lighting Network (Lightning Network) as a second-layer scaling solution for the BTC network, has successfully achieved fast and low-cost micropayments through off-chain transactions and payment channel technology. Its core concepts include:
Advantages of Nervos CKB
Nervos CKB is a Block chain platform that focuses on universality and security. Its unique design gives it unique advantages in solving Block chain scalability and interoperability issues:
The Significance of the Fiber Network project
By building off-chain channels on Nervos CKB, we hope to combine the successful experience of the Lighting Network with the technical advantages of CKB to create a fast, low-cost, and Decentralization multi-asset real-time payment exchange network. Specifically:
Architectural design
Overall Architecture
The overall architecture of the Fiber Network includes the following core modules:
Off-chain payment channel
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 is only conducted when the channel is closed. This mechanism significantly reduces the number of on-chain transactions, improves transaction speed, and drops Money Laundering.
The general workflow is as follows:
The specific message interaction format can refer to the Fiber Network P2P Message Protocol[2]
on-chain contract
Currently, we use the Hashed TimeLock Contract (HTLC) to ensure the security of off-chain transactions and to be compatible with the Lighting Network. Through it, we can avoid counterparty risk and ensure that users can obtain fund protection through on-chain contracts even in the event of off-chain transaction failure.
The general workflow is as follows:
Thanks to the Turing completeness of CKB, we can achieve more flexible and secure on-chain contracts. We will further expand the functionality of the contracts, such as introducing version-based revocation mechanisms and more secure Point Time-Locked Contracts.
Multi-hop routing
Multi-hop routing technology allows users to complete payments through multiple intermediate nodes without directly establishing payment channels with each other. This mechanism enhances the flexibility and coverage of the network.
Workflow:
At the same time, we will also use HTLC contracts here to implement payment for Cross-Chain Interaction, and support interoperability with Lighting Network through cross-chain hub service. For details, please refer to Payment Channel Cross-Chain Protocol with HTLC.[3]
Monitoring Service
The monitoring service is an important part of the Fiber Network, responsible for monitoring the status of off-chain payment channels to ensure the security of the channels and funds. The functions and roles are as follows:
Current Progress and Plans
We have completed a prototype of the Fiber Network, which implements the basic functions of creating, updating, and closing channels between two Nodes. At the same time, we have also verified the Cross-Chain Interaction with BTCLighting Network. The project code can be found in these two GitHub repositories:.
The next work plan is to complete multi-hop routing and monitoring services, as well as improve the RPC interface and SDK, so that more developers can easily access the Fiber Network.
The multi-hop routing protocol is based on the Dijkstra Algorithm to search for payment paths, in order to drop routing fees and improve the success rate of multi-hop path payments. After the launch of the Fiber Network, we will optimize the routing Algorithm based on network traffic and operation conditions. It is expected to provide 2-3 path search strategies to adapt to users’ different routing preferences and needs. Fiber Network will also introduce a multi-path payment strategy, dividing larger payments into multiple parts, each transmitted through different paths, further increasing the probability of payment success.
The monitoring service will be provided by some Nodes in the Fiber Network, they stay online, follow the abnormal situations in the network, and help protect the assets in the channel. The monitoring service will also track the cross-chain hub service. Even if the user is offline for a period of time, the monitoring service can ensure successful exchanges with the Lighting Network.
In addition, we will also consider adding more features to the Fiber Network, such as using the programmability of CKB to achieve privacy protection Algorithm, and based on this, optimizing the routing Algorithm and monitoring services to protect the security and privacy of user payment information.