头图

On July 16, with the release of the CKB v0.100.0 code, means that Nervos CKB's first mainnet upgrade has officially started.
v0.100.0:https://github.com/nervosnetwork/ckb/releases

In order to ensure safety, the Nervos CKB mainnet upgrade will undergo multiple rounds of testing and audits. The final upgrade is expected to be completed in the fourth quarter of this year. After the upgrade is completed, the new Nervos CKB mainnet can effectively implement more encryption algorithms and will be more friendly to dApp developers.

The Nervos CKB mainnet upgrade will be carried out through a hard fork. In response to the issues raised by the community, the CKB core development team shared the details of the mainnet upgrade. At the same time, everyone is welcome to check the RFC included in the mainnet upgrade on GitHub. And ask any questions or suggestions.
GitHub:https://github.com/nervosnetwork/rfcs/pulls

 
 

01 Q: What is the main reason for the hard fork? What caused the hard fork? (That is, is the fork part of the roadmap at this time, or is it caused by some other factor?)

 

The hard fork is planned in advance in the roadmap. The purpose is to upgrade CKB, add new features, and fix some bugs.
 
 

02 Q: In what areas will the main network upgrade improve CKB? What is the expected impact on developers and projects built on Nervos CKB?

 

The hard fork has improved CKB in many ways:

  • The official RISC-V B extension [1] will be introduced into CKB VM, so it can provide more efficient encryption algorithm implementation. With the activation of the B extension, the cost of complex lock scripts will be reduced. (Note: RISCV B extension refers to an extended instruction set used by RISCV for bit operation acceleration. The purpose is to use one instruction to implement bit operation instructions that originally required 2 to 3 instructions.)
  • CKB VM will introduce a new concept, macro-op fusion [2]. From a higher perspective, macro-op fusion is that when people use certain RISC-V instructions together, the CPU can execute them together in a more efficient manner. Therefore, CKB VM will reduce the cycle that forms the macro-op fusion instruction mode. Please note that modern compilers have made extensive use of macro-op fusion, so the only result you may notice is that the CKB VM charges fewer cycles for smart contracts than before the hard fork. For a more detailed introduction of macro-op fusion in RISC-V, please refer to here:

    https://riscv.org/wp-content/uploads/2016/07/Tue1130celio-fusion-finalV2.pdf

  • can perform multiple dep matching in the transaction. CKB Cell uses data hash or type script hash to indirectly match script binary. The cell storing the binary file must be added through the Cell dep. Currently, it is not possible to perform multiple matches in CKB Cell dep to avoid ambiguity. However, if the same Cell appears multiple times in the Cell dep, this error can usually be safely bypassed through the dep group.
  • simplify the since rules for transaction input. This improvement makes it easier to write smart contracts based on the time on the chain.

One of the main reasons behind the CKB VM changes (except for bug fixes) is to reduce overhead. CKB VM is already a thin abstraction layer on the local CPU. With a hard fork, we really want to make the abstraction layer thinner: the RISC-V B extension allows us to directly map RISC-V instructions to the native instructions provided by x86-6 4 cpu, while macro-op fusion does Deeper use of the modern micro-architecture in our CPU. All these efforts are aimed at enabling the encryption algorithm to run more efficiently on the CKB VM, thereby unlocking more potential use cases for Nervos CKB.
 
 

03 Q: How does the mainnet upgrade help the growth and development of Nervos CKB?

 

This mainnet upgrade also includes some repairs, such as re-fixing several bugs in CKB-VM in a cleaner way. These bugs were discovered after the mainnet was launched, and have been fixed with temporary solutions on the mainnet. Cleanup will make the code base healthier, and CKB will be easier to maintain in the future.

The consensus rules of the block/transaction version will also be adjusted to make future soft forks easier. When we want to add new features to CKB, this adjustment will give us more choices.
 
 

04 Q: After the hard fork, what functions or improvements will become possible?

 

One of the main improvements brought about by the hard fork is that can effectively implement more encryption algorithms . For example, consider the BLS signature algorithm. Due to the complexity of the algorithm, although BLS is theoretically feasible, it currently consumes too much cycle on CKB. With the help of B extension and macro-op, we managed to reduce the cycle consumed by the BLS signature verification operation to a feasible ratio on CKB. These technologies that support BLS implementation can also be transplanted and used to optimize more algorithms, such as RSA, secp256r1, etc.
 
 

05 Q: Regarding the hard fork, what other relevant details need to be known to the community?

 

Previously, we included support for the light client protocol Flyclient into the hard fork. In the past few months, we have several design plans, but after evaluation, we think that best to postpone the implementation of the light client protocol Flyclient , because of its relatively large changes, and due to the lack of external support, the impact at this stage /Benefits are not clear. We will have another article to explain this problem, and we will continue to study the light client protocol.

Most of the improvements of this hard fork have already been published on GitHub. Suggestions/comments are welcome:
https://github.com/nervosnetwork/rfcs/pulls

Nervos CKB's mainnet upgrade requires the support of miners, wallets and exchanges. We will do our best to communicate with the community to ensure a stable and elegant upgrade.

 
 

06 Q: How will you upgrade the mainnet?

 

upgrade will be divided into three phases :

The first stage: RC1[3] was released on July 16, which includes all functions and corresponding tools, but does not include the specific upgrade time (epoch), which is mainly used for testing and debugging tools. The first round of audit began. Developers can use Tippy to start a new chain for testing.

The second stage (expected in August): RC2 will be launched on the Aggron testnet. The second round of audit began.

The third stage (expected in September): release the final version and epoch information when it will be activated on the mainnet.
 
expects the main network upgrade to be completed in the fourth quarter.

Ref:
[1] https://github.com/riscv/riscv-bitmanip
[2] https://en.wikichip.org/wiki/macro-operation_fusion
[3] https://github.com/nervosnetwork/ckb/releases

 
 

Recommended reading

Nervos CKB hard fork this year, will airdrop candy?

Nervos 2021 technical roadmap
 
在这里插入图片描述


NervosNetwork
241 声望870 粉丝

这是 Nervos 唯一官方 SF 号。在这里,你能了解到关于 Nervos 的一切,enjoy.