首页  >  文章  >  了解 Nervos Network(CKB):全面概述

了解 Nervos Network(CKB):全面概述

王林
王林原创
2024-06-22 16:01:54771浏览

了解 Nervos Network(CKB):全面概述

作者:Jennifer Obem

摘要

  • 在比特币的核心技术基础上进行了扩展,通过可扩展的一层区块链为比特币 Layer 2 (L2) 提供支持。
  • 为了改善比特币的编程限制,Nervos Network 采用了一个定制的模型(Cell 模型)进行状态存储,以及定制的虚拟机(CKB-VM)来执行交易。
  • Nervos 通过 RGB++ 扩展了比特币的可用性,RGB++ 是一个基于原始 RGB 协议的资产发行协议,旨在将 CKB 定位为比特币的执行层和数据可用层。
  • 自 RGB++ 协议在 CKB 主网推出以来,CKB 网络的交易活动重新活跃起来,4月份新增了近40万个地址,环比3月增长了181%。
  • 将支付通道网络集成到闪电网络的工作正在进行中,这将使 CKB 更具可扩展性,并适用于各种区块链应用。

背景

作为最大的加密货币,比特币不断获得采用和认可。然而,它的成功也暴露出一些限制和挑战,特别是在可扩展性方面。例如,比特币区块链在 Segwit 升级之后,将区块大小限制在 4 MB 以内,这限制了在给定时间内能处理的交易数量。随着网络的增长,这种限制导致了更长的确认时间和更高的交易费用,使得比特币在处理大规模交易量时效率下降。与其他区块链相比,除了价值转移,比特币的脚本语言目前还缺乏开发复杂智能合约所需的灵活性和表现力。

为了解决这些限制,人们提出了多种 Layer 2 (L2) 解决方案,如支付通道、侧链和 Rollup。它们大多旨在通过在链下处理交易来扩展比特币,试图在不影响基础层安全性的情况下提高交易吞吐量。例如,闪电网络创建了一个二层支付通道网络,允许近乎即时的小额支付。另一种方法是侧链 —— 与比特币主链相连的独立区块链,拥有更大的脚本可能性和更快的交易。然而,这些解决方案往往有所取舍,如增加了复杂性、信任假设和潜在的安全漏洞。

Nervos Network 是比特币可扩展性解决方案之一,它采用了更原生的方式,修改了支撑比特币的 UTXO 模型。它改进了 RGB 协议,在无需跨链桥的情况下为比特币提供图灵完备的合约能力。Nervos Network 由 Terry Tai、Kevin Wang、Cipher Wang 和 Daniel Lv 于 2018 年第一季度立项,是一个旨在提高可扩展性的 Layer 1 区块链。为了推动网络的开发,项目团队从种子轮、私募轮和公募中筹集了超过 1 亿美元的资金。2019 年 11 月,Nervos Network 的 Layer 1 区块链 —— Common Knowledge Base(共同知识库,简称 CKB)上线。2024 年 2 月,由 Nervos 联合创始人 Cipher Wang 领导的 CELL Studio 推出了比特币一层资产发行协议 RGB++。受 RGB 协议的启发,RGB++ 协议使用 CKB 作为数据可用性和执行层,为比特币实现了智能合约能力和资产发行。自 2024 年 4 月 RGB++ 上线主网以来,利用 RGB++ 在比特币上发行资产的项目数量不断增加。截至 2024 年 6 月,现有的 15+ 个生态项目使 CKB 的链上活动重新活跃起来。

技术

来源:Nervos Network

Nervos Network 采用分层架构,包括一个可通过支付通道和 RGB++ 进行扩展的 L1 区块链(Common Knowledge Base,简称 CKB)。Cell 模型是比特币 UTXO 记账模型的改进版,CKB-VM 是一种定制虚拟机,它们支持了网络的分层设计。CKB-VM 为在网络上发起交易或构建应用提供了灵活的执行环境。这种设计可以让网络通过在每一层运行专用组件来进行垂直扩展,类似于模块化区块链。

Common Knowledge Base

CKB 是 Nervos Network 的底层 L1 区块链,其运行方式与比特币类似,采用工作量证明(PoW)共识机制。它使用比特币算法的升级版 NC-MAX,通过加快交易确认时间和降低孤块率来提高网络效率和响应速度。比特币以 10 分钟的区块间隔为目标,大约每两周调整一次挖矿难度。而 CKB 会根据网络活动的变化动态调整区块间隔(大约每四小时一次),从而优化性能。

CKB secures the network using the Eaglesong function, an ASIC-neutral custom hash function that replaces the widely used SHA256 hash function. Eaglesong is a sponge function optimized for multiple cryptographic elements to provide the same level of security as other proof-of-work (PoW) hash functions, while being specifically tailored for the Nervos Network.

Cell Model

Source: Nervos Network

Cell model is the core of the CKB data structure and can store and verify any data on the chain. Bitcoin’s original scripting language and UTXO model limited its ability to perform the complex calculations required by 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 verify transactions, CKB introduces dual scripts in its Cell model:

  • Lock Script (lock script) ensures that only authorized users can access and use content in the Cell, similar to Bitcoin.
  • Type Script is an optional script that sets the rules for how the Cell is used or changed in future transactions.

Compared to Bitcoin’s limited options, this system enables CKB to support more features, making it more suitable for a variety of applications. Each Cell in CKB is a programmable Cell that can save 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 run independently, meaning they can be updated or referenced without affecting other parts of the blockchain, improving scalability through parallelism.

CKB-VM

CKB-VM is CKB’s execution engine, used to run smart contracts and decentralized applications. The virtual machine uses the RISC-V instruction set, a flexible and simple open source hardware architecture set (ISA) that supports a variety of programming languages, including popular languages ​​​​such as C and Rust. This broad compatibility sets CKB-VM apart from other blockchain virtual machines that are often limited to specific languages, opening it up to a broader developer community. The CKB network also supports SDKs for mainstream languages ​​such as JavaScript, Rust, Go and Java, making it easier for developers to develop using familiar tools. This makes it easier for developers to create complex decentralized applications using familiar programming languages.

In addition, CKB-VM’s architecture provides predictable gas fees, secure execution, and efficient integration with the Cell model, helping to effectively manage state and verify transactions. A predictable gas fee model avoids unexpected fees, improves user experience, and simplifies contract development.

RGB++ Protocol

Source: Nervos Network

CKB extends Bitcoin with the RGB++ protocol, an asset issuance standard that extends the functionality of Bitcoin on CKB. The RGB++ protocol enables complex smart contract and asset management operations that are typically not possible on the Bitcoin network. The original RGB protocol was an L2 solution designed to enable smart contracts and asset issuance for Bitcoin without changing the Bitcoin mainnet. It works by tying assets to specific Bitcoin UTXOs, allowing those assets to be transferred along with the transfer of the UTXO itself. The RGB protocol relies primarily on client-side verification, with transactions processed and verified off-chain, thus reducing the load on the Bitcoin network. However, this approach also has limitations, such as potential issues with data availability – since the data is not stored on-chain, it may not be readily accessible when needed. Additionally, reliance on client-side validation adds complexity that may impact user experience.

Nervos Network addresses these limitations with 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++ uses isomorphic binding technology to map Bitcoin UTXO to CKB’s Cell, achieving seamless integration with CKB’s Turing-complete smart contracts. This is achieved 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 that were not possible with the original RGB protocol. RGB++ also introduces on-chain verification of key transaction elements, improving security and data availability. In addition, the RGB++ protocol can also implement transaction folding, ownerless contracts with shared states, and non-interactive transfers, and can realize cross-chain transfers of Bitcoin without the need for cross-chain bridges.

支付通道

作为底层公链,CKB 可以通过支付通道进行扩展,比如 Polycrypt 开发的支付通道框架 Perun。通过在链下处理交易和链上结算,这些支付通道可以支持从小额支付到支付网关等多种应用,从而提高 CKB 的性能。Perun 利用了 CKB 的 Cell 模型,其中 Cell 携带了 capacity、Lock Script、Type Script 和数据来管理通道的状态。通道的其中一个实现(PerunLockScript)可以管理通道实时 Cell 的访问权限,而另一个实现(PerunTypeScript)可以处理状态转换的验证逻辑。从通道获得资金到关闭,这些转换都是自动管理的。截至发稿时,Perun 仍在测试中,尚未在 CKB 主网上线。Nervos 核心开发人员还在努力将 CKB 连接到比特币的闪电网络,使用户能够在不依赖第三方的情况下交换 BTC 和 CKB。

代币经济学

Nervos Network 的原生代币 CKByte(CKB)在维护网络安全和激励有效存储方面发挥着重要作用。CKB在网络中的主要作用包括:

  • 授予代币持有者数据存储权。
  • 作为链上交易的手续费。
  • 作为区块奖励发放给矿工,以确保网络安全。

此外,CKB 代币有三个来源:(1)创世区块;(2)基础发行;(3)二级发行。

创世区块

2019 年 11 月主网启动时,创世区块铸造了 336 亿枚 CKB 代币,其中 84 亿枚 CKB 代币(占初始发行的 25%)被立即销毁。在销毁的这84 亿枚 CKB 中,50.4 亿枚代币被用于链上存储("占用链上空间"),剩余的 33.6 亿枚代币处于流动状态("流动性")。对这些被销毁的代币进行相应的状态分配,目的是为了让矿工在最初时至少能获得二级发行的 15%,而国库基金至少能获得 10%。值得注意的是,目前分配给的国库基金的 CKB 代币全部被销毁,只有通过网络硬分叉才能更改此设定。

创世区块中的 CKB 分配如下:

  • 公募(~21.50%): 创世区块的最大部分在 2018 年提供给了公募投资者,并在 2019 年 11 月主网启动时全部释放。
  • 生态基金(17.00%): 生态基金将支持 Nervos 生态系统内的第三方开发者。在创世区块的计划中,这笔拨款的 3% 已经到位,其余部分将在两年内发放,到 2022 年 12 月结束。
  • 团队(15%): 预留给项目团队,在 2022 年 5 月结束四年的锁定期。
  • 私募(14%): 于 2018 年 7 月提供给私募投资者。其中 66.60% 在主网启动时释放,其余部分在 2020 年结束两年的锁定期。
  • 合作伙伴(5%): 这笔拨款是为帮助建立 Nervos Network 的战略合作伙伴预留的,锁定期是四年。
  • 测试网奖励(0.5%): 这些奖励在主网启动时全部分配给测试网和漏洞赏金计划的参与者。
  • 销毁(25%): 在创世区块中,这部分直接销毁,以保证矿工和国库基金持续获得二级发行。

基础发行

CKB 基础发行(一级发行)的目标是在网络的早期发展阶段提升网络的安全性。每个 Epoch 的 CKB 基础发行量固定,全部奖励给矿工,奖励他们处理网络上的交易。基础发行的上限为 336 亿枚 CKB 代币,并遵循与比特币类似的通胀时间表,即每四年减半一次,直至达到供应量的上限。2023 年 11 月,CKB 经历了首次减半事件,基础发行的年发行量从 42 亿枚 CKB 降至 21 亿枚。

二级发行

CKB 通过两种方法管理状态爆炸。首先,要在链上存储数据,用户必须锁定 CKB 代币。CKB 并不直接向锁定 CKB 代币的用户收取费用来支付状态租金,而是通过一种称为二级发行的通胀机制间接收取费用。每年,13.44 亿枚 CKB 代币通过二级发行被铸造出来,并分配给矿工、Nervos DAO 储户以及国库基金。因此,二级发行针对存储数据的用户引入了通货膨胀,因为锁定的 CKB 代币会自动面临价值稀释,这是支付状态租金的一种间接方式。截至写文,已有超过 6 亿枚 CKB 代币作为状态租金分配给了矿工,约 11.5 亿枚 CKB 代币奖励给 Nervos DAO 储户,分配给国库基金的超过 42.7 亿枚 CKB 代币被直接销毁。

Nervos DAO

通过 Nervos DAO,CKB 代币持有者可以原生地避免被二级发行所稀释。通过将持有的 CKB 代币锁定到 Nervos DAO 智能合约中,用户可以从二级发行中获得代币奖励,确保其持有的代币免受通货膨胀的影响。Nervos DAO 储户获得的收益率与二级发行的通胀率相同,随着总供应量的增加,APR 也会继续下降。用户可以随时往 Nervos DAO 存款,最低金额为 102 CKB,但取款只能在 30 天存款周期结束后才能进行。

截至写文,已有 92 亿枚 CKB 代币存入 Nervos DAO。CKB 的存入流通比为 20.84%,在过去两年中一直呈下降趋势。这种下降趋势可能是因为 CKB 上的未花费 Cell 数量不断增加。

网络活动

在过去的一年里,CKB 网络持续活跃。截至目前,CKB 的日均交易量为 43,600 笔。与 2023 年第四季度的日均 20,800 笔相比,增长了 110%。在新增地址方面,4 月份的链上活动明显增加。4 月份创建了 387,600 个新地址,与 3 月份相比,环比增长了 181%。

自 4 月份以来,CKB 上的 Cell 活动一直在稳步增加,部分原因是 RGB++ 协议的推出。Cell 活动分为未花费 Cell 和已花费 Cell。未花费 Cell 可用于未来的交易、智能合约执行和数据存储,反映了网络活动和采用率的提高。已花费 Cell 虽然不再用作交易输入,但仍包含可访问和引用的有价值数据,有助于区块链的历史和数据可追溯性。截至 2024 年 5 月 15 日,共有 170 万个未花费 Cell ,与第一季度末相比增长了 13%。至于已花费 Cell ,截至发稿时,CKB 上共有 5760 万个已花费 Cell 。

自 RGB++ 协议于 2024 年 4 月 3 日上线以来,已有超过 13,200 笔交易和 4,400 个独立地址使用该协议。整个 5 月和 6 月的网络活动呈下降趋势,但利用 RGB++ 的更多生态项目应该有助于扭转这一趋势。

安全性与去中心化

作为 PoW 网络,矿工通过解决加密难题来验证交易并向区块链添加新区块,从而确保 CKB 的安全。每挖出一个区块,矿工就能获得该区块的全部 “基础发行” 奖励和部分 “二级发行” 奖励。矿工还可以从处理网络交易的交易费中获得提案奖励或提交奖励。为了在不降低性能的情况下管理网络活动的变化,CKB 定制的 NC-MAX 共识协议大约每四个小时根据网络的孤儿率调整一次挖矿难度。这样,网络可以优化出块时间,同时降低区块重组的可能性,因为区块重组可能会破坏网络的稳定性。

算力是对 PoW 区块链矿工基础计算能力的衡量标准。因此,算力代表着 CKB 网络的安全性。2024 年,CKB 全网算力不断刷新历史新高。4 月 27 日,CKB 的全网算力达到 397.5 PH/s,是 CKB 网络有史以来的最高算力值。算力上升的部分原因是 Binance 于 2024 年 4 月 18 日开启了 CKB 矿池。与算力类似,2024 年的平均挖矿难度也创下了历史新高(4 月 21 日该值为 3.96E)。

Ecosystem

Nervos Network continues to promote the development of the ecosystem through funding, infrastructure and tool support. At the launch of the mainnet in November 2019, approximately 5.7 billion CKB (17% of the genesis block CKB allocation - $62.4 million at the time of writing) was set aside for the ecosystem fund. Over the years, the Ecological Fund has provided seed funding for multiple ecological development plans to promote the network’s development plans. One of them is the CKB Eco Fund (formerly InNervation), which focuses on incubating and investing in early-stage and seed-round projects that use RGB++ to connect CKB and Bitcoin. CKB Eco Fund supports ecological projects to build critical infrastructure and cross-domain decentralized applications, including DeFi, games, tools, NFT markets, etc. In January 2024, CKB Eco Fund launched the BTCKB initiative, which aims to strengthen the integration between Bitcoin and the CKB blockchain through the PoW consensus mechanism and UTXO model. BTCKB plans to introduce new smart contract features that will enhance the capabilities of the Bitcoin blockchain by incorporating BTC, Taproot Assets, and RGB++ assets into the CKB blockchain. As part of the initiative, CKB Eco Fund also incubated CELL Studio, a blockchain software company led by Nervos co-founder Cipher Wang, who is also spearheading 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, well-known 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 chains.
  • Spore: On-chain Digital Objects (DOBs) protocol powered by CKB.

Since the launch of the RGB++ mainnet in April 2024, more than 15 existing ecological projects have used this protocol for asset issuance. Ecological projects worthy of attention include:

  • UTXO Stack: Bitcoin L2 "OP Stack" based on RGB++ protocol.
  • JoyID: Non-custodial wallet that utilizes biometrics for user authentication and supports multiple networks including Ethereum, Bitcoin, and RGB++ assets.
  • HueHub: Decentralized trading platform and launchpad supporting RGB++ assets on Bitcoin.
  • Stable++: Decentralized stablecoin protocol, supporting CKB and BTC.
  • World3: An autonomous world game based on RGB++ protocol and DOB.
  • Nervape: A multi-chain composable digital object based on Bitcoin. Its “basic assets” are issued on Bitcoin and “auxiliary assets” are issued on CKB.
  • Haste: RGB++ asset management solution.
  • d.id: Bitcoin decentralized identity protocol.

The RGB++ development roadmap released by CELL Studio highlights important plans to be completed in 2024 including:

  • Release a cross-chain protocol for issuing RGB++ assets across UTXO chains.
  • Transfer Atomics, Orderals and other UTXO-based assets to CKB without a bridge through the RGB++ protocol.
  • Propose and implement an RGB++ extension solution that supports multiple networks.
  • Connect RGB++ with CKB Lightning Network.

As part of the BTCKB plan, CKB Eco Fund also intends to launch a cross-chain bridge and UTXO-based DEX connecting BTC and CKB. In addition, a payment channel network will be developed for CKB using the RGB++ protocol, and the relevant proof of concept has been completed. This payment channel network will be connected to the Lightning Network, making CKB more scalable and suitable for various blockchain applications.

Competitive Product Analysis

As Bitcoin L2, Nervos Network’s method of expanding Bitcoin is mainly to enhance the functionality of Bitcoin through the RGB++ protocol. Competitors like Stacks offer custom execution environments and programming languages, while Rootstock pegs 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 Bitcoin with a smart contract execution environment that is closely integrated with Bitcoin’s original UTXO model. This design may give the Nervos Network an advantage, attracting users who are skeptical of solutions that stray from Bitcoin’s core ideals of decentralization and security

compared to scaling solutions like the Lightning Network , CKB’s smart contracts provide a wider range of functions to provide services for 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 such as Liquid Network, Merlin Chain and Bouncebit need to trust a semi-centralized consortium to manage cross-chain bridges between sidechains and the Bitcoin mainnet. CKB uses off-chain calculation and on-chain settlement methods to avoid this degree of centralization.

Nevertheless, Nervos’ approach to scaling Bitcoin with the RGB++ protocol is not without limitations. The reliance on external networks, specifically the CKB blockchain, for data availability and asset issuance creates additional complexity and potential latency for Bitcoin. In addition, the lack of comprehensive development tools and multi-party interaction solutions limits the protocol's ability to effectively support decentralized applications. Finally, the transparency of transactions on the CKB blockchain compromises the privacy benefits originally offered by the RGB protocol.

Summary

The Bitcoin L2 market continues to grow as demand for scalability and functionality beyond Bitcoin’s original functionality continues to grow. Various L2 solutions, such as Lightning Network, sidechains, and Rollups, aim to solve these problems by moving transactions off the main chain, thus increasing Bitcoin’s throughput without compromising security. However, these solutions often introduce new complexities and security challenges. What sets Nervos apart is extending the RGB protocol with RGB++. RGB++ provides native extensions for Bitcoin integrating deeper smart contract functionality directly related to the Bitcoin UTXO model. These features, in turn, facilitate a more frictionless and secure expansion of Bitcoin’s utility. Additionally, work is underway to connect the payment channel network with the Lightning Network, which will make CKB more scalable and suitable for many blockchain applications.

Ultimately, Nervos aims to strengthen its position in the Bitcoin L2 space by simplifying the user and developer experience. Additionally, Nervos can prioritize RGB++ support for a wider range of asset types and complex applications, increasing its utility in the Bitcoin ecosystem. By doing so, Nervos can play a key role in Bitcoin’s wider adoption and functionality as a platform for decentralized applications and smart contracts.

以上是了解 Nervos Network(CKB):全面概述的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn