Overview
Fiber Network is a next-generation public Lightning 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
The Development and Challenges of Blockchain Technology
Since the advent of Bitcoin, blockchain technology has undergone rapid development. From the initial simple payment function, it has gradually expanded to a wide range of application fields such as smart contracts, decentralized finance (DeFi), non-fungible tokens (NFTs), etc. Although blockchain technology has significant advantages in terms of security, transparency, and decentralization, it faces many challenges regarding scalability and transaction speed.
Scalability Issues: Traditional blockchains like Bitcoin and Ethereum face significant bottlenecks in transaction throughput. Due to the block size limit of Bitcoin and the 10-minute block generation time, its network can only process about 7 transactions per second; although Ethereum has improved, its transaction processing capacity is still far below that of traditional payment networks.
High Transaction Costs: As network congestion increases, transaction fees rise significantly. For example, during peak periods on the Ethereum network, Gas fees may exceed the transaction amount itself, severely affecting user experience and reducing the feasibility of small payments.
Long Transaction Confirmation Times: In traditional blockchain networks, transactions must wait for multiple block confirmations to be considered final. This process can take minutes to hours, making it unsuitable for instant payment applications.
Although Nervos CKB has made improvements in performance and confirmation times, it still needs to further enhance transaction speeds and reduce costs to meet the needs of small and instant payments.
Insights from the Lightning Network
The Lightning Network, as a second-layer scaling solution for the Bitcoin network, successfully achieves fast, low-cost micropayments through off-chain transactions and payment channel technology. Its core concepts include:
Payment Channels: Users create payment channels on-chain, allowing both parties to conduct off-chain transactions an unlimited number of times after the channel is opened, with only on-chain settlement occurring when the channel is closed. This significantly reduces the number of on-chain transactions, increases transaction speeds, and lowers transaction costs.
Hash Time-Lock Contracts (HTLC): Through HTLC technology, the Lightning Network can ensure the secure transfer of funds, avoiding counterparty risk. Even in the case of off-chain transaction failures, users can secure their funds through on-chain contracts.
Routing Mechanism: The Lightning Network uses multi-hop routing, allowing users to make payments without establishing a direct channel with the payee, thereby increasing the flexibility and availability of the network.
Advantages of Nervos CKB
Nervos CKB is a blockchain platform focused on generality and security. Its unique design provides distinct advantages in addressing blockchain scalability and interoperability issues:
Consensus Mechanism: Based on the NC-Max consensus protocol, while combining Proof of Work (PoW) and state leasing mechanisms to ensure network security and effective resource utilization.
Powerful Smart Contract Model: The unique Cell model and RISC-V instruction set virtual machine of CKB greatly enhance the capabilities of the UTXO model, supporting not only Turing-complete smart contracts but also easily implementing features like abstract accounts and covenants, providing more flexible programmability for decentralized applications, as well as better interoperability and scalability.
Economic Model: The economic model of CKB encourages long-term holding and reasonable 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 aim to combine the successful experience of the Lightning Network with the technical advantages of CKB to create a fast, low-cost, and decentralized multi-asset real-time payment exchange network. Specifically:
Addressing Scalability Issues: Through off-chain payment channels and multi-hop routing technology, Fiber network can achieve high throughput transaction processing to meet the needs of large-scale users.
Reducing Transaction Costs: By reducing the frequency of on-chain transactions, lowering users' transaction fees, making small payments feasible and efficient.
Increasing Transaction Speed: Achieving a second-level payment confirmation experience through instant confirmation of off-chain transactions, suitable for various instant payment scenarios.
Multi-Asset Support: Supporting payments in various digital assets, providing users with a wider range of payment options.
Supporting Network Interoperability: Supporting interoperability with the Bitcoin Lightning Network, providing support for cross-chain payments and asset transfers.
Architectural Design
Overall Architecture
The overall architecture of Fiber Network includes the following core modules:
Off-Chain Payment Channels (Fiber Channels)
On-Chain Contracts (HTLC)
Multi-Hop Routing
Monitoring Services (Watchtower Service)
Off-Chain Payment Channels
Off-chain payment channels are the core of Fiber Network, allowing multiple off-chain transactions with on-chain settlement only when the channel is closed. This mechanism significantly reduces the number of on-chain transactions, increases transaction speed, and lowers transaction costs.
The rough workflow is as follows:
Channel Creation: Both users create a payment channel on-chain, locking a certain amount of CKB or RGB++ assets.
Off-Chain Transactions: During the channel opening period, both parties can perform off-chain transactions any number of times, with each transaction updating the channel state but not needing to be immediately broadcasted on-chain.
Channel Closure: When either party decides to close the channel, the final channel state is broadcasted on-chain for settlement, ensuring that both parties' final balances are confirmed.
The specific message interaction format can refer to Fiber Network P2P Message Protocol
On-Chain Contracts
Currently, we use Hash Time-Lock Contracts (HTLC) to ensure the security of off-chain transactions and compatibility with the Lightning Network. This avoids counterparty risk and ensures that even in the event of off-chain transaction failures, users can secure their funds through on-chain contracts.
The rough workflow is as follows:
Transaction Initiation: The payment initiator creates a transaction with hash locking and time-lock conditions, locking a certain amount of CKB.
Hash Verification: The payment receiver must provide the correct hash preimage within the specified time to unlock the transaction and complete the fund transfer.
Timeout Refund: If the receiver fails to provide the correct hash preimage within the specified time, the transaction will automatically unlock and refund to the payment initiator.
Thanks to the Turing completeness of CKB, we can implement more flexible and secure on-chain contracts. Further expansions of contract functionalities will follow, 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 establishing a direct payment channel with the other party. 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 Locking: Each node on the path creates the corresponding HTLC contract to ensure the secure transfer of funds.
Payment Completion: The payment receiver unlocks the HTLC, and the funds are transferred sequentially to each node along the path.
At the same time, we will also implement cross-chain payments using HTLC contracts here, supporting interoperability with the Lightning Network through cross-chain hub service, specific details can refer to Payment Channel Cross-Chain Protocol with HTLC.
Monitoring Services
Monitoring services are an essential part of 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 processes of channel creation, updates, and closures.
Anomaly Detection: Detecting abnormal activities in the channel, such as malicious users attempting to close the channel with an old state or attempting double-spending attacks.
Proactive Response: When anomalies are detected, promptly broadcasting the latest channel status to the blockchain network to prevent financial losses caused by malicious behavior.
Current Progress and Plans
CKB officially released the Lightning Network Fiber Network underlying protocol complete testing version in September and is currently undergoing code auditing, with the mainnet launch imminent.
Fiber Network will initially support four types of RGB++ assets
Fiber Network will initially support four types of RGB++ assets: $CKB native token, compliant stablecoin $USDI (@IPN_Intelligent), $ccBTC (@mesonfi @CactusCustody), and RGB++ leading asset $Seal (@btckbseal). This is an important milestone in our aim to provide the best solutions for the Bitcoin ecosystem through the RGB++ protocol.
Fiber Network will expand the potential of the RGB++ protocol.
For a long time, the Lightning Network could only support BTC, limiting its widespread adoption. Fiber Network's support for diverse RGB++ assets represents a significant leap in the development of the Bitcoin ecosystem. After the upcoming launch of the Fiber Network mainnet, we will focus on establishing a robust liquidity network for the four initial assets. The four initially supported assets will participate in decentralized liquidity lending and other Lightning-based BTCFi, leading the next development direction of Bitcoin-native financial services.
Our comprehensive development roadmap will include:
- Integrating with wallets in the ecosystem such as @joy_protocol, @UTXOGlobal, @wizzwallet, and industry-leading wallets to enhance accessibility and user experience.
- Achieving Lightning Network liquidity management and Bitcoin decentralized native staking through @utxostack.
- Introducing diversified RGB++ RWA.
- Developing a decentralized trading protocol based on the Lightning Network.
- Developing an AI Agent protocol based on the Lightning Network and RGB++.
- Developing a full-chain tg game based on the Lightning Network and RGB++.
Fiber Network will greatly expand the upper limit of RGB++, making the protocol a leader in Bitcoin ecosystem protocols.
RGB++ Protocol: The best solution for the Bitcoin ecosystem.
Recently, we announced that we will launch the meme economy on #BTC and #DOGE and other #UTXO chains, as an example of how RGB++ can provide programmability and interoperability for all UTXO chains. Fiber Network's support for the four initial RGB++ assets will further complement our ambitious strategy, demonstrating that RGB++ is the best solution for the Bitcoin ecosystem and showcasing CKB's development capabilities. It is envisioned that Seal is expected to become the first meme asset on the Lightning Network, setting a precedent for future RGB++ assets and applications on the Bitcoin and DOGE networks; we will strive to leverage RGB++ to fully realize the potential of Bitcoin's scalability.
• Fiber Network Official Website: ckbfiber.net
• GitHub: github.com/nervosnetwork/…
• Tutorial: github.com/gpBlockchain/c…
• Video Guide: youtu.be/-es_tPxfQTo
• Join the CKB Community: https://t.me/ckb_community