Understanding Nervos Network (CKB): A Comprehensive Overview
Author: Jennifer Obem
Abstract
- An extension based on the core technology of Bitcoin, providing support for Bitcoin Layer 2 (L2) through a scalable layer blockchain.
- To improve Bitcoin's programming limitations, Nervos Network adopts a custom model (Cell model) for state storage and a custom virtual machine (CKB-VM) to execute transactions.
- Nervos expands Bitcoin's usability through RGB++, an asset issuance protocol based on the original RGB protocol, aiming to position CKB as Bitcoin's execution layer and data availability layer.
- Since the launch of the RGB++ protocol on the CKB mainnet, transaction activity on the CKB network has revived, with nearly 400,000 new addresses added in April, a 181% increase compared to March.
- Work is underway to integrate payment channel networks into the Lightning Network, which will make CKB more scalable and suitable for various blockchain applications.
Background
As the largest cryptocurrency, Bitcoin continues to gain adoption and recognition. However, its success has also exposed some limitations and challenges, particularly in terms of scalability. For example, after the Segwit upgrade, the Bitcoin blockchain limits block size to 4 MB, which restricts the number of transactions that can be processed at a given time. As the network grows, this limitation leads to longer confirmation times and higher transaction fees, reducing Bitcoin's efficiency in handling large transaction volumes. Compared to other blockchains, Bitcoin's script language currently lacks the flexibility and expressiveness needed to develop complex smart contracts, aside from value transfer.
To address these limitations, various Layer 2 (L2) solutions have been proposed, such as payment channels, sidechains, and Rollups. Most of them aim to scale Bitcoin by processing transactions off-chain, attempting to increase transaction throughput without compromising the security of the base layer. For example, the Lightning Network creates a second-layer payment channel network that allows for near-instantaneous small payments. Another approach is sidechains ------ independent blockchains connected to the Bitcoin main chain, offering greater scripting possibilities and faster transactions. However, these solutions often come with trade-offs, such as increased complexity, trust assumptions, and potential security vulnerabilities.
Nervos Network is one of the scalability solutions for Bitcoin, adopting a more native approach by modifying the underlying UTXO model that supports Bitcoin. It improves the RGB protocol, providing Turing-complete contract capabilities for Bitcoin without the need for cross-chain bridges. Nervos Network was initiated by Terry Tai, Kevin Wang, Cipher Wang, and Daniel Lv in the first quarter of 2018 as a project aimed at enhancing scalability as a Layer 1 blockchain. To drive the development of the network, the project team raised over $100 million from seed rounds, private placements, and public offerings. In November 2019, the Layer 1 blockchain of Nervos Network ------ Common Knowledge Base (CKB) went live. In February 2024, CELL Studio, led by Nervos co-founder Cipher Wang, launched the Bitcoin Layer asset issuance protocol RGB++. Inspired by the RGB protocol, RGB++ uses CKB as the data availability and execution layer, enabling smart contract capabilities and asset issuance for Bitcoin. Since the mainnet launch of RGB++ in April 2024, the number of projects issuing assets on Bitcoin using RGB++ has been steadily increasing. As of June 2024, more than 15 existing ecosystem projects have revived on-chain activity for CKB.
Technology
Source: Nervos Network
Nervos Network adopts a layered architecture, including a L1 blockchain (Common Knowledge Base, CKB) that can be scaled through payment channels and RGB++. The Cell model is an improved version of Bitcoin's UTXO accounting model, and CKB-VM is a custom virtual machine that supports the network's layered design. CKB-VM provides a flexible execution environment for initiating transactions or building applications on the network. This design allows the network to scale vertically by running dedicated components at each layer, similar to a modular blockchain.
Common Knowledge Base
CKB is the underlying L1 blockchain of Nervos Network, operating similarly to Bitcoin and using a proof-of-work (PoW) consensus mechanism. It employs an upgraded version of the Bitcoin algorithm called NC-MAX to improve network efficiency and responsiveness by accelerating transaction confirmation times and reducing orphan rates. While Bitcoin targets a 10-minute block interval and adjusts mining difficulty approximately every two weeks, CKB dynamically adjusts its block interval based on changes in network activity (approximately every four hours) to optimize performance.
CKB uses the Eaglesong function to ensure network security, which is an ASIC-neutral custom hash function that can replace the widely used SHA256 hash function. Eaglesong is a sponge function optimized for multiple cryptographic elements, providing a level of security comparable to other proof-of-work (PoW) hash functions while being specifically tailored for Nervos Network.
Cell Model
Source: Nervos Network
The Cell model is the core data structure of CKB, capable of storing and verifying any data on-chain. The original script language and UTXO model of Bitcoin limit its ability to perform complex computations required for executing smart contracts. In contrast, CKB generalizes the UTXO model, allowing for more flexible data storage and verification. Unlike Bitcoin, which uses a single script to validate transactions, CKB introduces dual scripts in its Cell model:
- Lock Script ensures that only authorized users can access and use the contents of the Cell, similar to Bitcoin.
- Type Script is an optional script used to set the rules for how the Cell can be used or modified in future transactions.
Compared to Bitcoin's limited options, this system enables CKB to support more functionalities, making it more suitable for various applications. Each Cell in CKB is a programmable Cell that can store different data types, such as tokens, smart contracts, and specific application states. It can also run complex scripts similar to those in Turing-complete languages. Cells operate independently, meaning they can be updated or referenced without affecting other parts of the blockchain, enhancing scalability through parallelism.
CKB-VM
CKB-VM is the execution engine of CKB, used to run smart contracts and decentralized applications. This virtual machine uses the RISC-V instruction set, a flexible and simple open-source hardware architecture (ISA) that supports various programming languages, including popular ones like C and Rust. This broad compatibility distinguishes CKB-VM from other blockchain virtual machines that are typically limited to specific languages, opening it up to a wider developer community. The CKB network also supports SDKs for mainstream languages such as JavaScript, Rust, Go, and Java, making it easier for developers to use familiar tools for development. This allows developers to create complex decentralized applications using programming languages they are already comfortable with.
Additionally, the architecture of CKB-VM provides predictable gas fees, secure execution, and efficient integration with the Cell model, helping to manage state and validate transactions effectively. The predictable gas fee model avoids unexpected costs, enhancing user experience and simplifying contract development.
RGB++ Protocol
Source: Nervos Network
CKB leverages the RGB++ protocol to extend Bitcoin, which is an asset issuance standard that expands Bitcoin's functionality on CKB. The RGB++ protocol enables complex smart contracts and asset management operations that are typically not feasible on the Bitcoin network. The original RGB protocol is an L2 solution aimed at enabling smart contracts and asset issuance for Bitcoin without altering the Bitcoin mainnet. It binds assets to specific Bitcoin UTXOs, allowing these assets to transfer along with the UTXOs themselves. The RGB protocol primarily relies on client-side validation, with transactions processed and validated off-chain, thereby reducing the load on the Bitcoin network. However, this approach has limitations, such as potential issues with data availability ------ since data is not stored on-chain, it may not be readily accessible when needed. Moreover, the reliance on client-side validation increases complexity, potentially impacting user experience.
Nervos Network addresses these limitations through the RGB++ protocol, which extends and enhances the principles behind the original RGB protocol by using CKB as Bitcoin's data availability and execution layer. RGB++ achieves seamless integration with CKB's Turing-complete smart contracts by mapping Bitcoin UTXOs to CKB's Cells through homomorphic binding technology. This is accomplished by leveraging CKB's layered architecture and Cell model, allowing Bitcoin assets to interact with dApps on CKB. By using RGB++, CKB can execute more complex smart contracts for Bitcoin, which was not possible with the original RGB protocol. RGB++ also introduces on-chain validation of key transaction elements, enhancing security and data availability. Furthermore, the RGB++ protocol can achieve transaction folding, ownerless contracts with shared state, and non-interactive transfers, enabling cross-chain transfers of Bitcoin without the need for cross-chain bridges.
Payment Channels
As an underlying public chain, CKB can be scaled through payment channels, such as the payment channel framework Perun developed by Polycrypt. By processing transactions off-chain and settling on-chain, these payment channels can support a variety of applications, from small payments to payment gateways, thereby improving CKB's performance. Perun utilizes CKB's Cell model, where Cells carry capacity, Lock Script, Type Script, and data to manage the state of the channels. One implementation of the channel (PerunLockScript) can manage access to the channel's real-time Cells, while another implementation (PerunTypeScript) can handle the validation logic for state transitions. From funding the channel to closing it, these transitions are managed automatically. As of the time of writing, Perun is still in testing and has not yet launched on the CKB mainnet. Core developers at Nervos are also working to connect CKB to Bitcoin's Lightning Network, enabling users to exchange BTC and CKB without relying on third parties.
Token Economics
The native token of Nervos Network, CKByte (CKB), plays a crucial role in maintaining network security and incentivizing effective storage. The main functions of CKB in the network include:
- Granting token holders data storage rights.
- Serving as transaction fees on-chain.
- Being distributed as block rewards to miners to ensure network security.
Additionally, CKB tokens have three sources: (1) the genesis block; (2) primary issuance; (3) secondary issuance.
Genesis Block
At the launch of the mainnet in November 2019, the genesis block minted 33.6 billion CKB tokens, of which 8.4 billion CKB tokens (25% of the initial issuance) were immediately destroyed. Of the 8.4 billion CKB destroyed, 5.04 billion tokens were used for on-chain storage ("occupying on-chain space"), while the remaining 3.36 billion tokens were in circulation ("liquidity"). The corresponding state allocation for these destroyed tokens aimed to ensure that miners could initially receive at least 15% of the secondary issuance, while the treasury fund could receive at least 10%. Notably, all CKB tokens allocated to the treasury fund have been destroyed, and this setting can only be changed through a network hard fork.
The CKB allocation in the genesis block is as follows:
- Public Offering (~21.50%): The largest portion of the genesis block was offered to public investors in 2018 and was fully released at the launch of the mainnet in November 2019.
- Ecosystem Fund (17.00%): The ecosystem fund will support third-party developers within the Nervos ecosystem. In the genesis block plan, 3% of this allocation has been made available, with the remainder to be distributed over two years, ending in December 2022.
- Team (15%): Reserved for the project team, with a four-year lock-up period ending in May 2022.
- Private Placement (14%): Offered to private investors in July 2018. Of this, 66.60% was released at the mainnet launch, with the remainder released after a two-year lock-up period ending in 2020.
- Partners (5%): This allocation is reserved to help establish strategic partners for Nervos Network, with a four-year lock-up period.
- Testnet Rewards (0.5%): These rewards were fully distributed to participants in the testnet and bug bounty programs at the mainnet launch.
- Destruction (25%): This portion was directly destroyed in the genesis block to ensure that miners and the treasury fund continuously receive secondary issuance.
Primary Issuance
The goal of CKB's primary issuance (first-level issuance) is to enhance network security during the early development phase of the network. The amount of CKB issued in each epoch is fixed and awarded entirely to miners as a reward for processing transactions on the network. The cap for primary issuance is 33.6 billion CKB tokens, following an inflation schedule similar to Bitcoin, which halves every four years until the supply cap is reached. In November 2023, CKB experienced its first halving event, reducing the annual issuance from 4.2 billion CKB to 2.1 billion CKB.
Secondary Issuance
CKB manages state bloat through two methods. First, to store data on-chain, users must lock CKB tokens. CKB does not directly charge users who lock CKB tokens to pay for state rent, but instead indirectly charges through an inflation mechanism known as secondary issuance. Each year, 1.344 billion CKB tokens are minted through secondary issuance and distributed to miners, Nervos DAO depositors, and the treasury fund. Therefore, secondary issuance introduces inflation for users storing data, as locked CKB tokens automatically face value dilution, which is an indirect way of paying for state rent. As of the time of writing, over 600 million CKB tokens have been allocated as state rent to miners, approximately 1.15 billion CKB tokens have been rewarded to Nervos DAO depositors, and over 4.27 billion CKB tokens allocated to the treasury fund have been directly destroyed.
Nervos DAO
Through Nervos DAO, CKB token holders can natively avoid dilution from secondary issuance. By locking their CKB tokens into the Nervos DAO smart contract, users can earn token rewards from secondary issuance, ensuring their holdings are protected from inflation. The yield earned by Nervos DAO depositors matches the inflation rate of secondary issuance, and the APR will continue to decline as the total supply increases. Users can deposit into Nervos DAO at any time, with a minimum amount of 102 CKB, but withdrawals can only be made after the 30-day deposit period ends.
As of the time of writing, 9.2 billion CKB tokens have been deposited into Nervos DAO. The deposit-to-circulation ratio of CKB is 20.84%, which has been on a downward trend over the past two years. This downward trend may be due to the increasing number of unspent Cells on CKB.
Network Activity
Over the past year, the CKB network has remained active. As of now, the average daily transaction volume for CKB is 43,600. This represents a 110% increase compared to the average of 20,800 transactions per day in the fourth quarter of 2023. In terms of new addresses, on-chain activity saw a significant increase in April, with 387,600 new addresses created, a 181% increase compared to March.
Since April, Cell activity on CKB has been steadily increasing, partly due to the launch of the RGB++ protocol. Cell activity is divided into unspent Cells and spent Cells. Unspent Cells can be used for future transactions, smart contract execution, and data storage, reflecting increased network activity and adoption. Although spent Cells are no longer used as transaction inputs, they still contain valuable data that can be accessed and referenced, contributing to the blockchain's history and data traceability. As of May 15, 2024, there are a total of 1.7 million unspent Cells, a 13% increase compared to the end of the first quarter. As for spent Cells, as of the time of writing, there are a total of 57.6 million spent Cells on CKB.
Since the RGB++ protocol went live on April 3, 2024, there have been over 13,200 transactions and 4,400 unique addresses utilizing the protocol. Network activity throughout May and June has shown a downward trend, but more ecosystem projects leveraging RGB++ should help reverse this trend.
Security and Decentralization
As a PoW network, miners validate transactions and add new blocks to the blockchain by solving cryptographic puzzles, ensuring the security of CKB. For each mined block, miners receive the full "primary issuance" reward and a portion of the "secondary issuance" reward. Miners can also earn proposal rewards or submission rewards from transaction fees for processing network transactions. To manage changes in network activity without compromising performance, CKB's custom NC-MAX consensus protocol adjusts mining difficulty approximately every four hours based on network power. This allows the network to optimize block times while reducing the likelihood of block reorganization, which can undermine network stability.
Hashrate is a measure of the basic computational power of PoW blockchain miners. Therefore, hashrate represents the security of the CKB network. In 2024, the total hashrate of CKB has been continuously setting historical highs. On April 27, the total hashrate of CKB reached 397.5 PH/s, the highest value ever recorded for the CKB network. The increase in hashrate is partly due to Binance launching a CKB mining pool on April 18, 2024. Similar to hashrate, the average mining difficulty in 2024 also reached historical highs (with a value of 3.96E on April 21).
Ecosystem
Nervos Network continues to promote ecosystem development through funding, infrastructure, and support tools. At the launch of the mainnet in November 2019, approximately 5.7 billion CKB (17% of the CKB allocation from the genesis block - equivalent to $62.4 million at the time of writing) was reserved for the ecosystem fund. Over the years, the ecosystem fund has provided seed funding for multiple ecosystem development programs to drive the network's development plans. One of these is the CKB Eco Fund (formerly InNervation), which focuses on incubating and investing in early and seed round projects that connect CKB and Bitcoin using RGB++. The CKB Eco Fund supports the construction of critical infrastructure and cross-domain decentralized applications for ecosystem projects, including DeFi, gaming, tools, NFT marketplaces, and more. In January 2024, the CKB Eco Fund launched the BTCKB initiative, aimed at strengthening integration between the Bitcoin and CKB blockchains through PoW consensus mechanisms and the UTXO model. The BTCKB initiative introduces new smart contract functionalities, incorporating BTC, Taproot Assets and RGB++ assets into the CKB blockchain, thereby enhancing the capabilities of the Bitcoin blockchain. As part of this initiative, the CKB Eco Fund has also incubated CELL Studio, a blockchain software company led by Nervos co-founder Cipher Wang, which is also the lead for the BTCKB initiative. CELL Studio develops infrastructure and applications to enhance and expand the Nervos ecosystem, similar to how ConsenSys develops foundational tools like Infura and MetaMask for Ethereum. As of now, notable ecosystem tools developed by CELL Studio include:
- CoTA: An aggregation protocol for fungible and non-fungible tokens on CKB.
- ForceBridge: A cross-chain interoperability protocol connecting CKB and other blockchain networks, currently supporting Ethereum and BNB Smart Chain.
- Spore: A protocol for on-chain digital objects (DOBs) supported by CKB.
Since the launch of the RGB++ mainnet in April 2024, over 15 existing ecosystem projects have utilized the protocol for asset issuance. Notable ecosystem projects include:
- UTXO Stack: A Bitcoin L2 "OP Stack" based on the RGB++ protocol.
- JoyID: A non-custodial wallet that uses biometric technology for user authentication, supporting multiple networks, including Ethereum, Bitcoin, and RGB++ assets.
- HueHub: A decentralized trading platform and launchpad supporting RGB++ assets on Bitcoin.
- Stable++: A decentralized stablecoin protocol supporting CKB and BTC.
- World3: An autonomous world game based on the RGB++ protocol and DOBs.
- Nervape: A multi-chain composable digital object whose "base asset" is issued on Bitcoin and "attached assets" are issued on CKB.
- Haste: An RGB++ asset management solution.
- d.id: A decentralized identity protocol for Bitcoin.
The RGB++ development roadmap released by CELL Studio emphasizes important plans to be completed in 2024, including:
- Launching a cross-chain protocol for issuing RGB++ assets across UTXOs.
- Bridging Atomicals, Orderals, and other UTXO-based assets to CKB through the RGB++ protocol without bridges.
- Proposing and implementing RGB++ scaling solutions that support multiple networks.
- Connecting RGB++ with the CKB Lightning Network.
As part of the BTCKB initiative, the CKB Eco Fund also plans to launch a cross-chain bridge and UTXO-based DEX connecting BTC and CKB. Additionally, a payment channel network will be developed for CKB using the RGB++ protocol, with a related proof of concept already completed. This payment channel network will connect to the Lightning Network, making CKB more scalable and suitable for various blockchain applications.
Competitive Analysis
As a Bitcoin L2, Nervos Network primarily extends Bitcoin's functionality through the RGB++ protocol. Competitors like Stacks provide customized execution environments and programming languages, while Rootstock links transactions between the two chains. In contrast, Nervos aims to enhance the native Bitcoin experience without adding complexity or compromising decentralization. With the RGB++ protocol, CKB can provide a smart contract execution environment closely integrated with Bitcoin's original UTXO model. This design may give Nervos Network an advantage in attracting users who are skeptical of solutions that deviate from Bitcoin's core principles ------ decentralization and security.
Compared to scaling solutions like the Lightning Network, CKB's smart contracts offer a broader range of functionalities, enabling developers to build more complex applications on Bitcoin. While the Lightning Network effectively facilitates fast, low-cost transactions, it does not support complex decentralized applications. Meanwhile, platforms like Liquid Network, Merlin Chain, and Bouncebit require trust in semi-centralized alliances to manage cross-chain bridges between sidechains and the Bitcoin mainnet. CKB avoids this level of centralization by using off-chain computation and on-chain settlement.
However, Nervos's approach to extending Bitcoin through the RGB++ protocol is not without limitations. The reliance on external networks (particularly the CKB blockchain) for data availability and asset issuance introduces additional complexity and potential delays for Bitcoin. Furthermore, the lack of comprehensive development tools and multi-party interaction solutions limits the protocol's ability to effectively support decentralized applications. Lastly, the transparency of transactions on the CKB blockchain undermines the privacy advantages initially offered by the RGB protocol.
Conclusion
As demand for scalability and functionality beyond Bitcoin's original capabilities continues to grow, the Bitcoin L2 market is also evolving. Various L2 solutions, such as the Lightning Network, sidechains, and Rollups, aim to address these issues by moving transactions off the main chain, thereby increasing Bitcoin's throughput without compromising security. However, these solutions often introduce new complexities and security challenges. What sets Nervos apart is its extension of the RGB protocol through RGB++. RGB++ provides native scalability for Bitcoin, integrating deeper smart contract functionalities directly related to the Bitcoin UTXO model. These functionalities, in turn, facilitate a more seamless and secure expansion of Bitcoin's usability. Additionally, work is underway to connect payment channel networks with the Lightning Network, which will enhance CKB's scalability for various blockchain applications.
Ultimately, Nervos aims to strengthen its position in the Bitcoin L2 space by simplifying the experience for users and developers. Furthermore, Nervos can prioritize RGB++ support for a wider range of asset types and complex applications, thereby increasing its utility within the Bitcoin ecosystem. By doing so, Nervos can play a key role in the broader adoption and functionality of Bitcoin as a decentralized application and smart contract platform.