CKB stablecoin payment is a DecentralizationStable Coin payment solution based on the CKB network, which allows users to generate and manage Stable Coin RUSD pegged to the US dollar through the combined network of CKB and BTC, utilizing Layer 2 extensions such as RGB++ and Fiber Network, to achieve fast, low-cost, and secure Cross-Chain InteractionStable Coin payments.
2. Introduction to Core Components
2.1 CKB(Common Knowledge Base)
2.1.1 What is CKB
CKB is the Layer 1 blockchain of Nervos Network, its main functions can be summarized as Consensus and Execution (Consensus & Execution) and Data Availability, enhancing scalability through payment channels and RGB++.
It is based on PoW Consensus Mechanism, similar to BTC, and adopts an upgraded version of BTC Algorithm NC-MAX. This Algorithm improves network efficiency and responsiveness by speeding up transaction confirmation times and dropping orphaned blocks. Unlike the fixed interval of one Block every 10 minutes in BTC, CKB dynamically adjusts Block intervals based on network activity (approximately once every four hours) to optimize performance.
CKB adopts the Eaglesong hash function, which is a hash function specifically tailored for Nervos Network, as an alternative to SHA-256, providing the same level of security.
CKB adopts the Cell model as the core of its data structure, which is an improved version of BTC’s UTXO accounting model:
Through the dual-script system, it allows for more flexible data storage and verification, supporting asset issuance and the execution of smart contracts. It provides data storage and state management functions, ensuring the long-term availability of all on-chain assets and data.
2.1.2 Cell Model
Cell model and its characteristics:
The Cell model is similar to BTC’s UTXO model, but it achieves on-chain data storage and validation of Smart Contract scripts by introducing dual scripts. It can store data or assets of any type: in BTC’s UTXO model, each transaction output can only contain simple amount information and ownership; while each Cell of CKB can store Smart Contract code and trigger the execution of these scripts through external calls in transactions. This means that each Cell can independently execute the Smart Contract logic related to it and has programmability. Separation of state and computation: Because Cell stores the code and state of Smart Contracts, each Cell can independently execute the contract logic. Complex computational tasks can be executed on Layer 2 or off-chain, and the execution results are synchronized back to Layer 1 through transactions, ensuring network security and data consistency. Parallel execution and transaction packaging: With the Cell model, Smart Contracts in different Cells can achieve parallel execution, and at the same time, the transaction results of different Cells can be packaged and updated on-chain. This approach makes computation more efficient and drops Money Laundering.
The working principle of the CELL model:
Cell is composed of inputs and outputs: similar to the UTXO model of BTC, Cell executes transactions and updates states through inputs and outputs. Each Cell can be spent as an input of a transaction and generate new outputs, creating new Cells. Components of a Cell: Each Cell contains Capacity, Updated Data, Lock, and Type. Capacity: Capacity records the size of the Cell’s storage space, representing the storage value of CKB Tokens. Users need to allocate a certain Capacity based on the data volume when creating Cells to ensure effective utilization of on-chain storage space. Data: It is one of the core features of the Cell model, capable of storing arbitrary information ranging from simple numbers to complex Smart Contract states, enabling the storage of diversified data on-chain within Blocks. Dual script system: Lock is used for identity verification, similar to the signature mechanism of BTC, preventing unauthorized access or modification of data in Cells. Users must provide the correct signature or Multi-signature to unlock and use Cells. Type defines the data validation logic of Cells, setting rules for how Cells can be used or modified in future transactions. By executing Smart Contracts or rule validation, the legitimacy of transactions or states is determined. Live Cell & Dead Cell: Live Cell refers to Cells that have not been spent and can still be used as inputs for the next transaction or state update. Once a Cell is spent, it becomes a Dead Cell and cannot be used anymore, but its history is retained on-chain for traceability. State leasing mechanism: Users need to lease on-chain storage space by paying CKB Tokens to ensure long-term data storage and prevent State Bloat.
2.1.3 Programmability & CKB-VM
The Cell model is the basis of CKB’s programmability: it supports storing the state and execution scripts of smart contracts in each Cell, tightly integrating contract execution and asset management.
Developers can execute custom Smart Contracts on-chain through the Turing Complete RISC-V Virtual Machine (CKB-VM). The flexibility of the RISC-V instruction set gives developers more freedom to write contracts, enabling CKB to support complex contract logic.
CKB-VM supports multiple languages: including C and Rust, among other popular languages. This wide compatibility sets CKB-VM apart from other blockchain Virtual Machines that are typically limited to specific languages, opening up to a broader developer community. The CKB network also supports SDKs for mainstream languages such as Java, Rust, Go, and Java, making it convenient for developers to use familiar tools for development.
Compatibility and Scalability: The design of CKB-VM ensures compatibility with BTC’s UTXO model and other blockchains, while supporting highly scalable smart contracts and complex applications.
2.1.4 PoW Consensus Mechanism
CKB adopts a PoW Consensus Mechanism similar to BTC, ensuring network security and decentralization. Similar to BTC, Miners compete to calculate hash values to package Blocks, thereby ensuring the network’s immutability and resistance to censorship.
NC-MAX Algorithm: Compared to BTC, CKB has introduced an improved NC-MAX Algorithm. This improvement allows for higher throughput and optimizes Block packaging efficiency, reduces the orphan block rate, and improves transaction confirmation speed, making it suitable for large-scale application scenarios such as asset storage and payment Settlement.
Eaglesong hash function: The custom design of the Eaglesong hash function provides performance and security advantages for the Nervos CKB network through ASIC neutrality, efficiency, security, and network fairness, ensuring Decentralization while improving Mining efficiency and network scalability.
2.1.5 Multilayer Security Architecture
CKB adopts a multi-layer security architecture: Layer 1 focuses on the final settlement of data and secure storage of states, while Layer 2 is used to extend transaction processing capacity.
The separated architecture ensures the security of the mainchain (Layer 1) by reducing the load when processing transactions, and improving the overall network stability.
2.1.6 Connection and Legitimacy of BTC
Cross-Chain Interaction interoperability of UTXO model:
CKB’s Cell model is an extension of the BTC UTXO model. BTC users can map their assets to the CKB network and use the flexibility of the CKB network for storage, smart contract operations, and decentralized finance (DeFi) applications. Since Cell and BTC UTXO are structurally similar, and CKB is compatible with the BTC Signature Algorithm, users can manipulate CKB on-chain assets with a BTC wallet, and the same applies to other UTXO-based public chains.
Orthodoxy: CKB maintains ideological consistency with BTC by adopting NC-Max (Nakamoto Consensus Max), an improved version of the Nakamoto Consensus, which provides better security and performance.
Community support: The Nervos community consists of numerous blockchain technology enthusiasts, developers, and Miners, and has received support from part of the BTC community. Its legitimacy lies in its inheritance of the Decentralization concept of BTC, and it meets a wider range of needs through extended functionality.
2.1.7 CKB’s Role in Stablecoin Payments
Storage and management of Stable Coin balances: The Cell model of CKB is the foundation for storing Stable Coin. User’s balances of RUSD and other Stable Coins are stored in on-chain Cells. Each Cell contains complete balance information, ensuring the security and traceability of assets.
Recording transaction status: CKB supports recording every state change of transactions on-chain, and all payment processes can be transparently recorded and tracked through the Cell model. This mechanism is crucial in stablecoin payments, ensuring the security and verifiability of transactions.
Execution of Smart Contracts: Complex operations such as conditional payments and locking in the payment process of Stable Coin can be achieved through Smart Contracts supported by CKB-VM.
2.2 RGB++
2.2.1 What is RGB++
RGB++ is a kind of Decentralization asset issuance and Smart Contract protocol, applicable to Bitcoin UTXO model and other UTXO public chains.
The RGB++ protocol inherits the idea of creating a separate transaction for on-chain and off-chain from the RGB protocol, the difference being that RGB uses client-side validation to move more data that cannot be stored on the BTC network and smart contracts that cannot be implemented to off-chain, and creates corresponding transactions that are bound to on-chain. In contrast, RGB++ moves these unstoreable data and unimplementable smart contracts to CKB, making CKB the smart contract settlement layer for BTC.
2.2.2 Basic Functions
Using RGB++, CKB is used as the shadow chain of BTC: as a supplementary chain of BTC, it undertakes complex logic and Smart Contract operations including those in the Turing Machine that BTC cannot handle natively.
Interacting with the BTC network:
Transaction Occurrence: In the BTC network, users complete transactions through the conventional UTXO model, while the part involving Smart Contract execution is bound to CKB through RGB++, which binds the contract state and data to CKB. Verification Logic: The transaction records conducted on the BTC network will be synchronized with the contract state stored on CKB through RGB++, and specific verification logic will be used to ensure the legality of the transaction. Every time a transaction occurs on the network, RGB++ triggers contract execution on CKB to check whether the transaction meets the predetermined rules, such as whether the balance is sufficient, whether the signature is valid, whether the contract conditions are met, etc.
RGB++ uses the Client-Side Validation mode to ensure the privacy and integrity of off-chain data, and the data will only be submitted to CKB for final Settlement after passing off-chain validation.
Asset issuance and management: RGB++ allows users to issue assets (such as stablecoins, tokens, etc.) through off-chain protocol issuance, and use CKB to manage the lifecycle of these assets (including not only the issuance and circulation of assets, but also more complex operations such as time locks, conditional payments, etc.).
RGB++ realizes the combination of high security of BTC and programmability of CKB.
2.2.3 Isomorphic Binding
Asset & Status Cross-Chain Interaction Synchronization: Homomorphic Binding refers to the mechanism that keeps assets and statuses synchronized between BTC and CKB (or other UTXO public chains, such as Cardano). Whenever there is an asset transaction on BTC on-chain, RGB++ will map the corresponding contract status or asset changes on CKB.
Extended UTXO: In the isomorphic binding, each UTXO of BTC on-chain will have a corresponding Cell (UTXO container) on CKB, which records the corresponding asset status and Smart Contract conditions.
Asset Binding: When a user holds a certain type of RGB++ asset on-chain in BTC, the Cell on CKB will store the corresponding asset state, and the consistency of these asset information between the two chains is ensured through isomorphic binding.
Transaction synchronization: When an RGB++ Token transaction occurs, the homomorphic binding mechanism generates a Commitment on the BTC network, and the corresponding Cell on the CKB on-chain will be consumed. A new Cell will be generated to allocate assets.
Advantages of Isomorphic Binding - Empowering BTCFi
Smart Contract Support: BTC cannot natively support Turing Complete smart contracts, but through token interoperability, CKB can serve as the execution layer for smart contracts, managing complex transaction conditions of BTC assets, such as time locks, conditional payments, etc. Asset management flexibility: Token interoperability allows for managing assets circulating on the BTC network on CKB. Users can execute complex financial operations with the flexible programming capabilities of CKB without changing the underlying protocol of BTC.
2.2.4 Leap
RGB++ Layer upgrade proposal: Extend the binding relationship between CKB and BTC to all UTXO chains, and achieve asset Cross-Chain Interaction through “rebinding”.
BTC and other UTXO chains’ bridgeless Cross-Chain Interaction: Its core purpose is to enable seamless transfer of BTC on-chain RGB++ assets to other UTXO on-chain by switching the UTXOs the assets are bound to, supporting asset management and transfer across multiple Block on-chain.
Bridgeless technology: Leap achieves asset cross-chain interaction transfer through isomorphic binding technology and switching different on-chain UTXOs, without relying on traditional Lock-Mint Cross-Chain Interaction bridges.
Operation process: For example, users can control the RGB++ assets originally on BTC on-chain through the Cardano chain, and split and transfer assets on the Cardano on-chain.
Commitment Release: First, users need to publish a Commitment on BTC on-chain, declaring the intention to release the assets bound to the BTC UTXO. Cardano Chain Binding: Next, publish a new Commitment on Cardano on-chain to bind the RGB++ assets to Cardano’s eUTXO. Modify Locking Script: Then, modify the locking script of the RGB++ assets on CKB on-chain, switching the unlocking condition from BTC UTXO to Cardano on-chain’s eUTXO. This step allows asset holders to control assets originally on BTC on-chain through the Cardano chain.
The role of CKB in Leap:
CKB plays the role of both indexer and Data Availability (DA) layer. All RGB++ asset data is still stored on-chain in CKB, and CKB acts as a third-party witness to process Leap requests and ensure the security of Cross-Chain Interaction assets. CKB provides security and trustworthiness: compared to the common multi-signature or MPC (Multi-Party Computation) mechanisms in traditional Cross-Chain Interaction bridges, CKB’s security and decentralization properties are more reliable.
2.2.5 The Role of RGB++ in Stablecoin Payments
Stablecoin issuance and circulation: issuing stablecoins on BTC on-chain through RGB++, and realizing intelligent asset management with CKB.
Cross-Chain Interaction Asset Management: By combining RGB++ Layer and CKB, ensure seamless operation of Stable Coin payments in different UTXO on-chain.
Smart Contract support: Provides complex payment conditions, time locks, and other functions for Stable Coin payments, improving payment flexibility and security.
Bridge Function: The RGB++ Layer acts as a bridge between BTC (and other UTXO chains) and CKB, expanding the programmability and asset management capabilities of BTC, making the Stable Coin payment function of BTC more diverse and flexible.
2.3 Fiber Network
2.3.1 Fiber Network Introduction
Fiber Network is a Layer 2 scaling solution on CKB similar to BTC Lighting Network: it is specifically designed to enhance CKB’s off-chain payment capabilities, allowing users to make fast and low-cost payments off-chain. By implementing payment channels for off-chain transactions, it reduces the burden on the mainchain and improves transaction speed.
Characteristics of off-chain payments: Fiber Network achieves fast transfers off-chain through payment channels, reducing reliance on the CKB mainchain and improving transaction throughput.
Current status: As of September 2024, according to the data from mempool, over 300 million US dollars are currently allocated in the BTC Lighting Network, with approximately 12,000 Nodes and nearly 50,000 payment channels established between them. The Fiber Network based on Nervos CKB has been launched on Testnet.
2.3.2 Technical Highlights
off-chain payment channels (Fiber Channels): The Fiber Network allows users to directly exchange assets off-chain by creating payment channels, and only submits the final state to CKB mainchain for Settlement when the channel is closed.
On-chain contract (HTLC):
Similar to BTC Lighting Network, Fiber Network now also uses Hashed TimeLock Contract (HTLC) to ensure the security of off-chain transactions; if off-chain transactions are not confirmed within the agreed time, assets can be automatically refunded via HTLC. PTLC: Based on HTLC, Fiber Network has improved to avoid using the same cryptographic value for the entire payment path graph, and will use PTLC to prevent privacy leakage of transaction correlation.
Multi-Hop Routing: Like Fiber Network and BTC Lighting Network, it supports payment path hopping through multiple Nodes, and uses Dijkstra Algorithm to search for payment paths, thereby reducing routing fees and improving the success rate of multi-hop path payments.
Monitoring Service - Watchtower Service: Users can use 24/7 monitoring services to monitor the status of payment channels, preventing Malicious Nodes from attempting Double Spending or cheating (preventing transaction participants from submitting expired commits to the chain), and the service can automatically track transactions and raise alerts.
2.3.3 The Difference Between Fiber Network and BTC Lighting Network
Multi-asset support:
The Lighting Network previously only supported off-chain payments for BTC, but now it can support other assets through the Taproot Asset upgrade. The Fiber Network supports multiple assets, including CKB, BTC, RGB++ stablecoins, etc.
Fees and transaction speed:
Lighting Network for BTC requires high BTC transaction fees for opening and closing channels on the BTC on-chain, especially when BTC is pumping, the channel operation cost increases significantly. Fiber Network relies on CKB, which has higher TPS and lower money laundering, making the cost of opening and closing channels lower and providing a better user experience.
Cross-Chain Interaction:
BTC Lighting Network is mainly used for payments within the BTC network and does not yet support Cross-Chain Interaction payments for other UTXO chains. Fiber Network supports the circulation of various assets, including BTC native assets (including inscription, rune, etc.), CKB, RGB++ native assets (including RUSD, etc.). Cross-Chain Interaction assets can be paid off-chain: with the help of the RGB++ Layer, assets from all UTXO chains can enter the Lighting Network. Fiber Network can be interconnected with BTC Lighting Network to achieve Cross-Chain Interaction payments (only Fiber Network can initiate, BTC Lighting Network can receive). Users can use CKB or RGB++ assets through Fiber Network to purchase assets on the BTC Lighting Network and ensure the atomicity of Cross-Chain Interaction transactions (avoiding situations where some assets succeed/fail in Cross-Chain Interaction).
The role of 2.3.4 Fiber Network in Stablecoin payments
The Fiber Network is used to support stablecoin transfers off-chain to ensure instant and low-cost payments.
Fiber Network enables users to conduct high-frequency transactions off-chain, reducing the pressure on the mainchain by creating off-chain payment channels.
Stable++ is a Decentralization over-collateralization stablecoin protocol in the CKB ecosystem, allowing users to mint RUSD pegged to the US dollar by collateralizing BTC or CKB.
RUSD is theoretically the first stablecoin issued directly on the BTC network based on the RGB++ protocol, using the capabilities of CKB to provide a more localized and efficient solution.
Fee: Users need to pay fees for staking BTC/CKB to mint RUSD and for redeeming BTC/CKB to return RUSD.
RUSD stake: Users can obtain governance Token STB by staking borrowed RUSD.
Governance Token STB: Users can participate in the liquidation of collateral to earn profits by staking STB; Users can also participate in fee sharing by staking STB.
Cross-Chain Interaction: RUSD can achieve transfer between UTXO chain accounts through RGB++ homomorphic binding and Leap function.
Lower minimum stake ratio (MCR): Due to efficient liquidation, the protocol and stability providers face potential risks of loss, thus dropping the demand for collateral value.
Decentralization: Stable++ is a completely decentralized, independently operated protocol, without the need for any entity control or permission, allowing users to interact with the system freely and securely.
2.4.2 Clearing Mechanism - Double Insurance
Overview: The liquidation mechanism is a protective measure triggered when the value of Collateral falls to a certain critical point (the lowest stake ratio for borrowing RUSD), ensuring that the generated RUSD Stable Coin always has sufficient Collateral support. The system will automatically liquidate those users with insufficient collateral to maintain the overall stability of the system.
Stability Pool:
To solve the problem of low efficiency in the event of widespread liquidation, Stable++ uses a stable pool instead of the auction method commonly used by most lending protocols for liquidation, eliminating the need to find liquidators in the market. Automatic liquidation: The stable pool requires LP (users) to deposit RUSD as reserves in advance. When liquidation occurs, an equivalent amount of RUSD in the stable pool will be directly destroyed, and the collateral will be distributed directly to LP. The ability to automatically liquidate through the stable pool, replacing traditional auctions with direct distribution of excess collateral, improves the operational efficiency and stability of Stable Coins in the event of widespread liquidation.
Redistribution:
Overview: When the stable pool does not have enough reserves to complete the bad debt liquidation, the bad debt and collateral will be allocated among the borrowers through a fair distribution mechanism. Debt redistribution: When the liquidation pool cannot cover all the bad debts, the remaining debts will be proportionally redistributed among all borrowers. Collateral allocation: While all borrowers collectively absorb the bad debts, they will also receive over-collateralization distributed proportionally as a reward. By having all borrowers share the bad debts, this mechanism ensures that there are no uncovered debts in the system, avoiding the accumulation of systemic risks. 2.4.3 Stable++ Role in Stable Coin Payments
Stable++ protocol generates Stable Coin RUSD, which is the primary Stable Coin used in payments.
By innovating the liquidation mechanism, Stable++ has improved the traditional over-collateralization method to ensure the stability of RUSD price.
With the help of RBG++'s isomorphic binding and Leap capability, Stable++ makes RUSD the first stablecoin that can truly circulate freely on-chain in any UTXO-supported system, further expanding the liquidity of stablecoins.
2.5 JoyID
2.5.1 What is JoyID
JoyID Passkey Wallet is an encryption Wallet that combines Passkey Secret Key management.
In the Nervos ecosystem, JoyID is designed as a Cross-Chain Interaction and Decentralized identity authentication and management tool, enabling users to securely store and use Crypto Assets as well as other Decentralized applications.
2.5.2 Main Functions
No need for password and seed phrase: access the Wallet through biometric recognition to achieve keyless login.
Support BTC and Fiber Network: Users can trade faster and more efficiently, and help expand CKB’s application scenarios.
Multi-chain support: JoyID supports not only BTC and Nervos CKB, but also ETH and a range of EVM chains.
Obtain extra security through Passkey: Passkey generates secp256r1 signatures associated with hardware devices to meet the secp256k1 signatures required by the blockchain exchange. Since secp256r1 signatures are not exposed in transactions and are only generated through biometric information, they provide additional security to the Wallet.
The combination of security and user-friendliness:
JoyID serves as the user interface, allowing users to make Stable Coin payments on the CKB network, manage their RUSD assets, and payment channels.
JoyID can further empower CKB-based Stable Coin payments and other transactions through its excellent combination of capabilities (security, ease of use, multi-chain support).
3. Payment Link
Payment Initiation and Acceptance: Users can open payment channels through JoyID wallet for Stable Coin payments. Stable Coin Issuance: RGB++ and Stable++ collaborate, Stable++ generates RUSD by over-collateralizing BTC or CKB, and then issues it on-chain through RGB++. Cross-Chain Interaction Trading and Circulation: RGB++ seamlessly connects BTC chain (and other UTXO chains) and CKB chain through isomorphic binding and Leap, allowing RUSD and other assets to perform Cross-Chain Interaction operations on multiple UTXO on-chain, expanding the scope of asset circulation and ensuring data synchronization. Transaction Recording and Settlement: The combination of Fiber Network and CKB supports fast processing of off-chain payments, and CKB as L1 chain ensures the final Settlement of transactions, ensuring the security of all transaction states and assets. Basis of Complex Transactions: CKB’s Virtual Machine and Cell model provide an execution environment for Smart Contracts, supporting complex payment conditions and custom contract logic, while also ensuring the Decentralization of Stable++ protocol.
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.
CKB Stablecoin Payment implementation
Author: Jimmie, from 10K Ventures
1. Overview
CKB stablecoin payment is a DecentralizationStable Coin payment solution based on the CKB network, which allows users to generate and manage Stable Coin RUSD pegged to the US dollar through the combined network of CKB and BTC, utilizing Layer 2 extensions such as RGB++ and Fiber Network, to achieve fast, low-cost, and secure Cross-Chain InteractionStable Coin payments.
2. Introduction to Core Components
2.1 CKB(Common Knowledge Base)
2.1.1 What is CKB
CKB is the Layer 1 blockchain of Nervos Network, its main functions can be summarized as Consensus and Execution (Consensus & Execution) and Data Availability, enhancing scalability through payment channels and RGB++.
It is based on PoW Consensus Mechanism, similar to BTC, and adopts an upgraded version of BTC Algorithm NC-MAX. This Algorithm improves network efficiency and responsiveness by speeding up transaction confirmation times and dropping orphaned blocks. Unlike the fixed interval of one Block every 10 minutes in BTC, CKB dynamically adjusts Block intervals based on network activity (approximately once every four hours) to optimize performance.
CKB adopts the Eaglesong hash function, which is a hash function specifically tailored for Nervos Network, as an alternative to SHA-256, providing the same level of security.
CKB adopts the Cell model as the core of its data structure, which is an improved version of BTC’s UTXO accounting model:
Through the dual-script system, it allows for more flexible data storage and verification, supporting asset issuance and the execution of smart contracts. It provides data storage and state management functions, ensuring the long-term availability of all on-chain assets and data.
2.1.2 Cell Model
Cell model and its characteristics:
The Cell model is similar to BTC’s UTXO model, but it achieves on-chain data storage and validation of Smart Contract scripts by introducing dual scripts. It can store data or assets of any type: in BTC’s UTXO model, each transaction output can only contain simple amount information and ownership; while each Cell of CKB can store Smart Contract code and trigger the execution of these scripts through external calls in transactions. This means that each Cell can independently execute the Smart Contract logic related to it and has programmability. Separation of state and computation: Because Cell stores the code and state of Smart Contracts, each Cell can independently execute the contract logic. Complex computational tasks can be executed on Layer 2 or off-chain, and the execution results are synchronized back to Layer 1 through transactions, ensuring network security and data consistency. Parallel execution and transaction packaging: With the Cell model, Smart Contracts in different Cells can achieve parallel execution, and at the same time, the transaction results of different Cells can be packaged and updated on-chain. This approach makes computation more efficient and drops Money Laundering.
The working principle of the CELL model:
Cell is composed of inputs and outputs: similar to the UTXO model of BTC, Cell executes transactions and updates states through inputs and outputs. Each Cell can be spent as an input of a transaction and generate new outputs, creating new Cells. Components of a Cell: Each Cell contains Capacity, Updated Data, Lock, and Type. Capacity: Capacity records the size of the Cell’s storage space, representing the storage value of CKB Tokens. Users need to allocate a certain Capacity based on the data volume when creating Cells to ensure effective utilization of on-chain storage space. Data: It is one of the core features of the Cell model, capable of storing arbitrary information ranging from simple numbers to complex Smart Contract states, enabling the storage of diversified data on-chain within Blocks. Dual script system: Lock is used for identity verification, similar to the signature mechanism of BTC, preventing unauthorized access or modification of data in Cells. Users must provide the correct signature or Multi-signature to unlock and use Cells. Type defines the data validation logic of Cells, setting rules for how Cells can be used or modified in future transactions. By executing Smart Contracts or rule validation, the legitimacy of transactions or states is determined. Live Cell & Dead Cell: Live Cell refers to Cells that have not been spent and can still be used as inputs for the next transaction or state update. Once a Cell is spent, it becomes a Dead Cell and cannot be used anymore, but its history is retained on-chain for traceability. State leasing mechanism: Users need to lease on-chain storage space by paying CKB Tokens to ensure long-term data storage and prevent State Bloat.
2.1.3 Programmability & CKB-VM![7314991 NSosT1TUfLJoi8byGrrpophwYFzjq2OfhSbaNTu0.jpeg]()
The Cell model is the basis of CKB’s programmability: it supports storing the state and execution scripts of smart contracts in each Cell, tightly integrating contract execution and asset management.
Developers can execute custom Smart Contracts on-chain through the Turing Complete RISC-V Virtual Machine (CKB-VM). The flexibility of the RISC-V instruction set gives developers more freedom to write contracts, enabling CKB to support complex contract logic.
CKB-VM supports multiple languages: including C and Rust, among other popular languages. This wide compatibility sets CKB-VM apart from other blockchain Virtual Machines that are typically limited to specific languages, opening up to a broader developer community. The CKB network also supports SDKs for mainstream languages such as Java, Rust, Go, and Java, making it convenient for developers to use familiar tools for development.
Compatibility and Scalability: The design of CKB-VM ensures compatibility with BTC’s UTXO model and other blockchains, while supporting highly scalable smart contracts and complex applications.
2.1.4 PoW Consensus Mechanism
CKB adopts a PoW Consensus Mechanism similar to BTC, ensuring network security and decentralization. Similar to BTC, Miners compete to calculate hash values to package Blocks, thereby ensuring the network’s immutability and resistance to censorship.
NC-MAX Algorithm: Compared to BTC, CKB has introduced an improved NC-MAX Algorithm. This improvement allows for higher throughput and optimizes Block packaging efficiency, reduces the orphan block rate, and improves transaction confirmation speed, making it suitable for large-scale application scenarios such as asset storage and payment Settlement.
Eaglesong hash function: The custom design of the Eaglesong hash function provides performance and security advantages for the Nervos CKB network through ASIC neutrality, efficiency, security, and network fairness, ensuring Decentralization while improving Mining efficiency and network scalability.
2.1.5 Multilayer Security Architecture
CKB adopts a multi-layer security architecture: Layer 1 focuses on the final settlement of data and secure storage of states, while Layer 2 is used to extend transaction processing capacity.
The separated architecture ensures the security of the mainchain (Layer 1) by reducing the load when processing transactions, and improving the overall network stability.
2.1.6 Connection and Legitimacy of BTC
Cross-Chain Interaction interoperability of UTXO model:
CKB’s Cell model is an extension of the BTC UTXO model. BTC users can map their assets to the CKB network and use the flexibility of the CKB network for storage, smart contract operations, and decentralized finance (DeFi) applications. Since Cell and BTC UTXO are structurally similar, and CKB is compatible with the BTC Signature Algorithm, users can manipulate CKB on-chain assets with a BTC wallet, and the same applies to other UTXO-based public chains.
Orthodoxy: CKB maintains ideological consistency with BTC by adopting NC-Max (Nakamoto Consensus Max), an improved version of the Nakamoto Consensus, which provides better security and performance.
Community support: The Nervos community consists of numerous blockchain technology enthusiasts, developers, and Miners, and has received support from part of the BTC community. Its legitimacy lies in its inheritance of the Decentralization concept of BTC, and it meets a wider range of needs through extended functionality.
2.1.7 CKB’s Role in Stablecoin Payments
Storage and management of Stable Coin balances: The Cell model of CKB is the foundation for storing Stable Coin. User’s balances of RUSD and other Stable Coins are stored in on-chain Cells. Each Cell contains complete balance information, ensuring the security and traceability of assets.
Recording transaction status: CKB supports recording every state change of transactions on-chain, and all payment processes can be transparently recorded and tracked through the Cell model. This mechanism is crucial in stablecoin payments, ensuring the security and verifiability of transactions.
Execution of Smart Contracts: Complex operations such as conditional payments and locking in the payment process of Stable Coin can be achieved through Smart Contracts supported by CKB-VM.
2.2 RGB++
2.2.1 What is RGB++
RGB++ is a kind of Decentralization asset issuance and Smart Contract protocol, applicable to Bitcoin UTXO model and other UTXO public chains.
The RGB++ protocol inherits the idea of creating a separate transaction for on-chain and off-chain from the RGB protocol, the difference being that RGB uses client-side validation to move more data that cannot be stored on the BTC network and smart contracts that cannot be implemented to off-chain, and creates corresponding transactions that are bound to on-chain. In contrast, RGB++ moves these unstoreable data and unimplementable smart contracts to CKB, making CKB the smart contract settlement layer for BTC.
2.2.2 Basic Functions
Using RGB++, CKB is used as the shadow chain of BTC: as a supplementary chain of BTC, it undertakes complex logic and Smart Contract operations including those in the Turing Machine that BTC cannot handle natively.
Interacting with the BTC network:
Transaction Occurrence: In the BTC network, users complete transactions through the conventional UTXO model, while the part involving Smart Contract execution is bound to CKB through RGB++, which binds the contract state and data to CKB. Verification Logic: The transaction records conducted on the BTC network will be synchronized with the contract state stored on CKB through RGB++, and specific verification logic will be used to ensure the legality of the transaction. Every time a transaction occurs on the network, RGB++ triggers contract execution on CKB to check whether the transaction meets the predetermined rules, such as whether the balance is sufficient, whether the signature is valid, whether the contract conditions are met, etc.
RGB++ uses the Client-Side Validation mode to ensure the privacy and integrity of off-chain data, and the data will only be submitted to CKB for final Settlement after passing off-chain validation.
Asset issuance and management: RGB++ allows users to issue assets (such as stablecoins, tokens, etc.) through off-chain protocol issuance, and use CKB to manage the lifecycle of these assets (including not only the issuance and circulation of assets, but also more complex operations such as time locks, conditional payments, etc.).
RGB++ realizes the combination of high security of BTC and programmability of CKB.
2.2.3 Isomorphic Binding![7314992 dUAva0iWCgSZK1oFflfjmdNzifzxcVTrgxKldqvp.jpeg]()
Asset & Status Cross-Chain Interaction Synchronization: Homomorphic Binding refers to the mechanism that keeps assets and statuses synchronized between BTC and CKB (or other UTXO public chains, such as Cardano). Whenever there is an asset transaction on BTC on-chain, RGB++ will map the corresponding contract status or asset changes on CKB.
Extended UTXO: In the isomorphic binding, each UTXO of BTC on-chain will have a corresponding Cell (UTXO container) on CKB, which records the corresponding asset status and Smart Contract conditions.
Asset Binding: When a user holds a certain type of RGB++ asset on-chain in BTC, the Cell on CKB will store the corresponding asset state, and the consistency of these asset information between the two chains is ensured through isomorphic binding.
Transaction synchronization: When an RGB++ Token transaction occurs, the homomorphic binding mechanism generates a Commitment on the BTC network, and the corresponding Cell on the CKB on-chain will be consumed. A new Cell will be generated to allocate assets.
Advantages of Isomorphic Binding - Empowering BTCFi
Smart Contract Support: BTC cannot natively support Turing Complete smart contracts, but through token interoperability, CKB can serve as the execution layer for smart contracts, managing complex transaction conditions of BTC assets, such as time locks, conditional payments, etc. Asset management flexibility: Token interoperability allows for managing assets circulating on the BTC network on CKB. Users can execute complex financial operations with the flexible programming capabilities of CKB without changing the underlying protocol of BTC.
2.2.4 Leap
RGB++ Layer upgrade proposal: Extend the binding relationship between CKB and BTC to all UTXO chains, and achieve asset Cross-Chain Interaction through “rebinding”.
BTC and other UTXO chains’ bridgeless Cross-Chain Interaction: Its core purpose is to enable seamless transfer of BTC on-chain RGB++ assets to other UTXO on-chain by switching the UTXOs the assets are bound to, supporting asset management and transfer across multiple Block on-chain.
Bridgeless technology: Leap achieves asset cross-chain interaction transfer through isomorphic binding technology and switching different on-chain UTXOs, without relying on traditional Lock-Mint Cross-Chain Interaction bridges.
Operation process: For example, users can control the RGB++ assets originally on BTC on-chain through the Cardano chain, and split and transfer assets on the Cardano on-chain.
Commitment Release: First, users need to publish a Commitment on BTC on-chain, declaring the intention to release the assets bound to the BTC UTXO. Cardano Chain Binding: Next, publish a new Commitment on Cardano on-chain to bind the RGB++ assets to Cardano’s eUTXO. Modify Locking Script: Then, modify the locking script of the RGB++ assets on CKB on-chain, switching the unlocking condition from BTC UTXO to Cardano on-chain’s eUTXO. This step allows asset holders to control assets originally on BTC on-chain through the Cardano chain.
The role of CKB in Leap:
CKB plays the role of both indexer and Data Availability (DA) layer. All RGB++ asset data is still stored on-chain in CKB, and CKB acts as a third-party witness to process Leap requests and ensure the security of Cross-Chain Interaction assets. CKB provides security and trustworthiness: compared to the common multi-signature or MPC (Multi-Party Computation) mechanisms in traditional Cross-Chain Interaction bridges, CKB’s security and decentralization properties are more reliable.
2.2.5 The Role of RGB++ in Stablecoin Payments
Stablecoin issuance and circulation: issuing stablecoins on BTC on-chain through RGB++, and realizing intelligent asset management with CKB.
Cross-Chain Interaction Asset Management: By combining RGB++ Layer and CKB, ensure seamless operation of Stable Coin payments in different UTXO on-chain.
Smart Contract support: Provides complex payment conditions, time locks, and other functions for Stable Coin payments, improving payment flexibility and security.
Bridge Function: The RGB++ Layer acts as a bridge between BTC (and other UTXO chains) and CKB, expanding the programmability and asset management capabilities of BTC, making the Stable Coin payment function of BTC more diverse and flexible.
2.3 Fiber Network
2.3.1 Fiber Network Introduction
Fiber Network is a Layer 2 scaling solution on CKB similar to BTC Lighting Network: it is specifically designed to enhance CKB’s off-chain payment capabilities, allowing users to make fast and low-cost payments off-chain. By implementing payment channels for off-chain transactions, it reduces the burden on the mainchain and improves transaction speed.
Characteristics of off-chain payments: Fiber Network achieves fast transfers off-chain through payment channels, reducing reliance on the CKB mainchain and improving transaction throughput.
Current status: As of September 2024, according to the data from mempool, over 300 million US dollars are currently allocated in the BTC Lighting Network, with approximately 12,000 Nodes and nearly 50,000 payment channels established between them. The Fiber Network based on Nervos CKB has been launched on Testnet.
2.3.2 Technical Highlights
off-chain payment channels (Fiber Channels): The Fiber Network allows users to directly exchange assets off-chain by creating payment channels, and only submits the final state to CKB mainchain for Settlement when the channel is closed.
On-chain contract (HTLC):
Similar to BTC Lighting Network, Fiber Network now also uses Hashed TimeLock Contract (HTLC) to ensure the security of off-chain transactions; if off-chain transactions are not confirmed within the agreed time, assets can be automatically refunded via HTLC. PTLC: Based on HTLC, Fiber Network has improved to avoid using the same cryptographic value for the entire payment path graph, and will use PTLC to prevent privacy leakage of transaction correlation.
Multi-Hop Routing: Like Fiber Network and BTC Lighting Network, it supports payment path hopping through multiple Nodes, and uses Dijkstra Algorithm to search for payment paths, thereby reducing routing fees and improving the success rate of multi-hop path payments.
Monitoring Service - Watchtower Service: Users can use 24/7 monitoring services to monitor the status of payment channels, preventing Malicious Nodes from attempting Double Spending or cheating (preventing transaction participants from submitting expired commits to the chain), and the service can automatically track transactions and raise alerts.
2.3.3 The Difference Between Fiber Network and BTC Lighting Network
Multi-asset support:
The Lighting Network previously only supported off-chain payments for BTC, but now it can support other assets through the Taproot Asset upgrade. The Fiber Network supports multiple assets, including CKB, BTC, RGB++ stablecoins, etc.
Fees and transaction speed:
Lighting Network for BTC requires high BTC transaction fees for opening and closing channels on the BTC on-chain, especially when BTC is pumping, the channel operation cost increases significantly. Fiber Network relies on CKB, which has higher TPS and lower money laundering, making the cost of opening and closing channels lower and providing a better user experience.
Cross-Chain Interaction:
BTC Lighting Network is mainly used for payments within the BTC network and does not yet support Cross-Chain Interaction payments for other UTXO chains. Fiber Network supports the circulation of various assets, including BTC native assets (including inscription, rune, etc.), CKB, RGB++ native assets (including RUSD, etc.). Cross-Chain Interaction assets can be paid off-chain: with the help of the RGB++ Layer, assets from all UTXO chains can enter the Lighting Network. Fiber Network can be interconnected with BTC Lighting Network to achieve Cross-Chain Interaction payments (only Fiber Network can initiate, BTC Lighting Network can receive). Users can use CKB or RGB++ assets through Fiber Network to purchase assets on the BTC Lighting Network and ensure the atomicity of Cross-Chain Interaction transactions (avoiding situations where some assets succeed/fail in Cross-Chain Interaction).
The role of 2.3.4 Fiber Network in Stablecoin payments
The Fiber Network is used to support stablecoin transfers off-chain to ensure instant and low-cost payments.
Fiber Network enables users to conduct high-frequency transactions off-chain, reducing the pressure on the mainchain by creating off-chain payment channels.
Fiber Network supports Cross-Chain Interaction atomic payments, enabling secure cross-chain payments of Stable Coins.
2.4 Stable++
2.4.1 Stable++ Introduction![7314993 5wgAZewYSy7PYlkpuzBNyqNeTyAA3UGR8yoNk2XH.jpeg]()
Stable++ is a Decentralization over-collateralization stablecoin protocol in the CKB ecosystem, allowing users to mint RUSD pegged to the US dollar by collateralizing BTC or CKB.
RUSD is theoretically the first stablecoin issued directly on the BTC network based on the RGB++ protocol, using the capabilities of CKB to provide a more localized and efficient solution.
Fee: Users need to pay fees for staking BTC/CKB to mint RUSD and for redeeming BTC/CKB to return RUSD.
RUSD stake: Users can obtain governance Token STB by staking borrowed RUSD.
Governance Token STB: Users can participate in the liquidation of collateral to earn profits by staking STB; Users can also participate in fee sharing by staking STB.
Cross-Chain Interaction: RUSD can achieve transfer between UTXO chain accounts through RGB++ homomorphic binding and Leap function.
Lower minimum stake ratio (MCR): Due to efficient liquidation, the protocol and stability providers face potential risks of loss, thus dropping the demand for collateral value.
Decentralization: Stable++ is a completely decentralized, independently operated protocol, without the need for any entity control or permission, allowing users to interact with the system freely and securely.
2.4.2 Clearing Mechanism - Double Insurance
Overview: The liquidation mechanism is a protective measure triggered when the value of Collateral falls to a certain critical point (the lowest stake ratio for borrowing RUSD), ensuring that the generated RUSD Stable Coin always has sufficient Collateral support. The system will automatically liquidate those users with insufficient collateral to maintain the overall stability of the system.![7314994 Inl0xy8UMystIcYsWfMQrO8H3MaNEsP9pdx3v0qa.jpeg]()
Stability Pool:
To solve the problem of low efficiency in the event of widespread liquidation, Stable++ uses a stable pool instead of the auction method commonly used by most lending protocols for liquidation, eliminating the need to find liquidators in the market. Automatic liquidation: The stable pool requires LP (users) to deposit RUSD as reserves in advance. When liquidation occurs, an equivalent amount of RUSD in the stable pool will be directly destroyed, and the collateral will be distributed directly to LP. The ability to automatically liquidate through the stable pool, replacing traditional auctions with direct distribution of excess collateral, improves the operational efficiency and stability of Stable Coins in the event of widespread liquidation.
Redistribution:
Overview: When the stable pool does not have enough reserves to complete the bad debt liquidation, the bad debt and collateral will be allocated among the borrowers through a fair distribution mechanism. Debt redistribution: When the liquidation pool cannot cover all the bad debts, the remaining debts will be proportionally redistributed among all borrowers. Collateral allocation: While all borrowers collectively absorb the bad debts, they will also receive over-collateralization distributed proportionally as a reward. By having all borrowers share the bad debts, this mechanism ensures that there are no uncovered debts in the system, avoiding the accumulation of systemic risks. 2.4.3 Stable++ Role in Stable Coin Payments
Stable++ protocol generates Stable Coin RUSD, which is the primary Stable Coin used in payments.
By innovating the liquidation mechanism, Stable++ has improved the traditional over-collateralization method to ensure the stability of RUSD price.
With the help of RBG++'s isomorphic binding and Leap capability, Stable++ makes RUSD the first stablecoin that can truly circulate freely on-chain in any UTXO-supported system, further expanding the liquidity of stablecoins.
2.5 JoyID
2.5.1 What is JoyID
JoyID Passkey Wallet is an encryption Wallet that combines Passkey Secret Key management.
In the Nervos ecosystem, JoyID is designed as a Cross-Chain Interaction and Decentralized identity authentication and management tool, enabling users to securely store and use Crypto Assets as well as other Decentralized applications.
2.5.2 Main Functions
No need for password and seed phrase: access the Wallet through biometric recognition to achieve keyless login.
Support BTC and Fiber Network: Users can trade faster and more efficiently, and help expand CKB’s application scenarios.
Multi-chain support: JoyID supports not only BTC and Nervos CKB, but also ETH and a range of EVM chains.
Obtain extra security through Passkey: Passkey generates secp256r1 signatures associated with hardware devices to meet the secp256k1 signatures required by the blockchain exchange. Since secp256r1 signatures are not exposed in transactions and are only generated through biometric information, they provide additional security to the Wallet.
The combination of security and user-friendliness:
Security: Hardware Wallet > PasskeyWallet > Software non-custodial Wallet > Hosted Wallet Usability: PasskeyWallet > Hosted Wallet > Software non-custodial Wallet > Hardware Wallet
2.5.3 The role of JoyID in Stable Coin payment
JoyID serves as the user interface, allowing users to make Stable Coin payments on the CKB network, manage their RUSD assets, and payment channels.
JoyID can further empower CKB-based Stable Coin payments and other transactions through its excellent combination of capabilities (security, ease of use, multi-chain support).
3. Payment Link
Payment Initiation and Acceptance: Users can open payment channels through JoyID wallet for Stable Coin payments. Stable Coin Issuance: RGB++ and Stable++ collaborate, Stable++ generates RUSD by over-collateralizing BTC or CKB, and then issues it on-chain through RGB++. Cross-Chain Interaction Trading and Circulation: RGB++ seamlessly connects BTC chain (and other UTXO chains) and CKB chain through isomorphic binding and Leap, allowing RUSD and other assets to perform Cross-Chain Interaction operations on multiple UTXO on-chain, expanding the scope of asset circulation and ensuring data synchronization. Transaction Recording and Settlement: The combination of Fiber Network and CKB supports fast processing of off-chain payments, and CKB as L1 chain ensures the final Settlement of transactions, ensuring the security of all transaction states and assets. Basis of Complex Transactions: CKB’s Virtual Machine and Cell model provide an execution environment for Smart Contracts, supporting complex payment conditions and custom contract logic, while also ensuring the Decentralization of Stable++ protocol.