Nervos Metabolism - A Recap of Development 2022

There is a deep connection between software development and architectural design, which can be seen from the use of vocabulary between the two, such as: infrastructure, module, framework, etc. This interesting connection gave me inspiration for this recap - we can use concepts in architecture history to look back on the technical development of Nervos in 2022.

“Metabolism” is a post-war Japanese architectural movement in the 1960s. Their unique insight is to treat architecture as a living organism that changes through interaction with its environment and has a positive impact on the environment.


Nakagin Capsule Tower, Kisho Kurokawa, 1970

Similarly, Nervos treats the blockchain network as a living organism that absorbs energy from its environment and continuously grows to form new independent memories and functions by interacting with its environment, pushing the organizational form of human beings to a new stage and eventually becoming the neural network of human society.

As an intellectual leader and central advocate of metabolism, Kiyonori Kikutake’s visionary approach to marine cities is equally impressive. In the context of modern society’s expanding land-based population and rising sea levels, the human dream of moving from land to sea has returned to the forefront. Kikutake, as a core member of the “Metabolism” group, proposed his original concept of the “Marine City” in 1959, seeing the marine city as the basic unit of a new human community.


Floating Structure of Kikutake’s ‘Marine City’, 1960.

Similarly, today’s Internet is also facing a slowdown in user growth and a highly saturated market. The Internet platform is highly centralized and has become a beast that devours user data. The Internet has deviated from its original intention of freedom and openness and become a beast that devours user data. These are the driving forces behind our desire to reinvent the Internet and build Web3. If we can move from land to sea and deep space, we can move from Web2 to Web3 too.

Thanks Shan Lin & Yan Niu for the introduction of Metabolism architectural movement and Annie Peng for readability editing.

Layer 1: Metabolism Driven by Cells


Nakagin Capsule Tower, Kisho Kurokawa, 1970

As with CKB, the design of Kurokawa Kisho’s Nakagin Capsule Tower, the most representative architectural work of the Metabolism School, also revolves around “cells”. Each “cell” is an easily disassembled and reassembled cubic space like a capsule apartment. For the occupants, the “cell” carries memories of their daily lives. Additionally, the “cell” has flexible mobility, much like the living cells that circulate throughout the city.

The design of CKB uses “Cell” as the basic unit to store various types of data maintained by collective consensus called "Common Knowledge”. CKB Cell’s flexibility is enabled by DNA-like Cell script that encodes different rules of behavior. CKB Cell also has a life cycle that drives CKB metabolism through continuous consumption and creation.

CKB 1st Hardfork

CKB successfully activated its first mainnet hardfork in 2022, saying goodbye to Lina and welcoming the new mainnet, Mirana. Mirana is the result of two years of efforts since CKB’s launch in 2019 - including virtual machine versioning, extensible block header, cryptographic-friendly instruction sets like RISC-V B extension, and more. With the hardfork, the CKB address format is also upgraded, providing users with a more consistent experience across applications.

We learned a lot during the process. The most difficult challenge was explaining what would happen after the hardfork to ecosystem players such as miners, pools, exchanges, wallets, and developers. Assist them in upgrading and testing; ensure that everyone is prepared before the hardfork is activated. The coordination was difficult but worthwhile; that is the price we are willing to pay for true decentralization. Thanks to everyone, the network upgrade went off without a hitch!

CKB-VM RVV Extension

CKB-VM RVV (RISC-V Vector Extension) adds vectorization support to CKB-VM, allowing it to process multiple data elements with a single instruction set. Despite the enormous workload of implementing the RVV instructions, we have completed all instruction implementation, developed complete functional, compatibility, and fuzzing tests (RVV is so new that there are no mature testing tools), migrated a number of cryptographic algorithms, and gone through several optimization rounds. Our most recent benchmark shows that cryptographic algorithms running on CKB-VM (e.g. bn128)’s potential slowdown is less than 10x, which is significantly shorter than slowdowns in other VMs.

Although we’ve made a lot of progress, the work needed to put it into production is hard to estimate, a best bet would be at the next hardfork.

Light Client

In 2022, we completed the development of CKB light client, a critical piece in CKB’s blueprint. It uses a sampling-based protocol (based on FlyClient) to avoid having to download and verify all blocks. This will enable users to interact with CKB in resource-constrained environments (such as mobile devices or web browsers).

CKB is also working on its first soft fork that will support light clients. To support future functionality, the CKB light client soft fork makes use of the Extensible Block Header, which was added in the Mirana hard fork as an arbitrary data field in the block header.

After the testnet is activated, we will be able to test the light client protocol in real world environments. The ideal condition to launch the mainnet is after 1~2 of pilot light client applications such as wallets like Neuron, Nexus and CKBull have been tested on testnet.

Open Transaction

Open Transaction is an off-chain coordination mechanism for building transactions. Transaction initiators could collaborate off-chain to complete interesting and complex tasks such as multisig workflow, CoinJoin, or token swap by signing only a partial transaction and leaving it for others to complete. With Open Transaction, we can divide transaction construction into multiple small steps, each with a different modularized solution. A modular Open Transactionn ecosystem could expand the possibilities for CKB DApps while lowering the barrier for development.

Open Transaction support will be an off-chain layer working with the CKB core. If some of its functions are found to be useful in practice, they may be incorporated into the CKB core. The feature design process began in October, and a working MVP is expected in 2023.

Toolchain: For Better Developer Experience


Basic Types of space formatics for ‘Marine City’, Kiyonori Kikutake, 1960.

Kikutake divides ‘Marine City’ projects into two categories: concentric floating structures at the city scale and linear ocean cities at the national scale. He has designed a number of structural solutions for marine cities, and these building blocks provide the basic ideas and patterns for city developers.

The difference between Nervos and Web2 or even Ethereum is as vast as the difference between land and sea. The vast differences in foundations create a huge barrier for developers who are new to Nervos, therefore we must keep improving tools to lower that barrier and help developers do their jobs more easily.

xUDT

xUDT is an extension to sUDT that incorporates numerous improvements based on community feedback when working with sUDT. Developers could use xUDT to create an extension script that checks whether a token issuance is below a certain threshold, enforces a time-lock on token transfers, or even compactly stores user balances in a Sparse Merge Tree. xUDT simplifies programmatic token generation.

The latest xUDT script has been deployed on the testnet. It will be deployed on the mainnet after code auditing and testing.

Omnilock

Omnilock is a new lock script designed for interoperability. It’s a lock that can be extended to support various transaction verification modes used in popular blockchains like Bitcoin, Ethereum, EOS, and Dogecoin. Omnilock has a regulation compliance module, which can work with xUDT’s Regular Compliance Extension (RCE) to make UDT interoperable with traditional finance. If enabled, the specified administrator can revoke tokens held by users in circumstances deemed appropriate by the administrator. Omnilock and RCE used together is equivalent to an ERC-1404.

Omnilock has been deployed on the Mirana mainnet.

Taproot on CKB

Taproot is the most important Bitcoin upgrade since Segwit. It improves Bitcoin’s privacy, scalability and scriptability. We migrated Taproot to CKB using a lock script to celebrate this achievement with the Bitcoin community and to test CKB’s abstraction. CKB Taproot offers two methods for unlocking: the pubkey path spending (Schnorr signature) and the script path spending. The latter path is powerful because it combines CKB-VM capabilities with arbitrary complex logic.

Taproot on CKB demonstrates how an intriguing new ability could emerge by combining Bitcoin ideas with the Cell model, as well as how easily such a mashup could be accomplished. With powerful smart contract support and a simple UTXO layout, I believe CKB has the potential to become an innovation hotspot for the UTXO ecosystem, where new ideas can be easily tested and good ideas can be cherry-picked for Bitcoin and other UTXO-based blockchains.

Lua scripting

CKB-VM could support smart contracts written in any programming language thanks to RISC-V compatibility. However, in order to write smart contracts in any language, an easy-to-use toolchain is required. Rust and C are two popular programming languages, but we always want more. The next step is Lua scripting support, which is also our first serious attempt at a dynamic language. [Lua](Lua (programming language) - Wikipedia is a lightweight, dynamic language that is widely used in game development and other areas that require programmable extensions. Lua scripts could be used in conjunction with lock/type scripts written in Rust/C to enable programmable customization and extension of CKB DApps.

We’ve been working on it for quite some time and it’s already functional now. The JoyID and.Bit teams have given us positive feedback. It is currently undergoing additional testing and optimization. It’s reasonable to anticipate the first DApp with Lua scripting in 2023.

Kuai

A group of MagickBase developers took the initiative to create Kuai, a javascript-based DApp framework for CKB, with the goal of drastically lowering the DApp development barrier and making it possible to create a DApp, say, did.id, in weeks rather than months. The difference between Kuai and Capsule is that Kuai is a full framework that includes, in addition to contract development, a build system, template generation, useful abstractions, an off-chain component, and testing. The project is still in its early stages, but it is making steady progress.

Nexus

Another group of MagickBase developers began to work on a solution for a problem that had long plagued CKB dapp developers - a “Metamask” for CKB. Although Ethereum Metamask can be used to access CKB dapps due to CKB’s abstraction ability, it is designed for account models and thus foregoes most UTXO model benefits such as asset management across addresses and privacy. It also lacks support for the CKB light client. Nexus is the solution to this problem. It’s a UTXO wallet designed to provide seamless support for NervosDAO, xUDT, omnilock, light client, and other protocols.

Others

CKB has 4 SDKs (Rust, Go, Java and Javascript) which provide basic and versatile support for all developers. Mercury is a high-level middleware suitable for simple integration use cases such as wallets and exchanges. Lumos is a web-developer-friendly javascript/typescript toolbox for DApp development, while Capsule provides handy Rust smart contract support. CKB-CLI is the swiss-army knife for CKB developers. These tools have proven to be useful and are constantly being improved in response to community feedback.

CKB ninjas love ckb-indexer, a lightning-fast indexer for on-chain data. It’s so popular that the CKB team merged it into the CKB node, as the community requested. The integration sped up CKB node and Neuron synchronization, and simplified devops for DApp developers by requiring only one daemon instead of two.

Layer 2: Megastructure and Scalability Solutions


The City in the Air, Arata Isozaki, 1960

In addition to “cells”, the Metabolists also brought up another enlightening concept of Megastructure. Rather than building units with a specific purpose, they wanted to design a “massive structural framework” for the city. This framework must be strong and long-lasting; allowing people to add/remove building units with specific functions as needed to meet the growing needs of the urban population. Differentiated from most blockchain projects, Nervos has the foresight to design with modularized Layer 2 as the solution for scalability and extensibility. Furthermore, Godwoken and Axon, the two frameworks on Nervos Layer 2, are experimenting layer 2 designs from different angles.

Godwoken

Godwoken is the world’s first rollup that runs on a Layer 1 blockchain other than Ethereum. Godwoken made two significant achievements in 2022: the first was successfully completing the upgrade from version 0 to version 1, and the second was pursuing the concept of Game+ Blockchain and providing a series of developer support for it. Godwoken v1 is a significant upgrade in Godwoken’s EVM compatibility, going from 99% compatibility to 100% equivalent. The development team worked tirelessly to resolve the remaining 1% incompatibility, and has then achieved full compatibility from EVM opcode to EVM toolchain, allowing developers to deploy DApps on Godwoken without modifying any code. This upgrade reduced the cost of both EVM DApp migration and DApp development, bringing new development to the Godwoken ecosystem.

Godwoken Game+Blockchain has taken Godwoken’s developer support to a new level, transforming it from a Rollup framework that requires developers to solve many problems themselves into a complete solution optimized for game developers. Often, game developers do not have a thorough understanding of blockchain technology when they seek to enter the world of Web3. What they really need is an easy gaming compatible blockchain solution that allows them to focus on game development rather than the details of the blockchain. They would want their potential players to play their game without having to learn about mnemonics or transaction fees. Rather than simply using token incentives to drive growth in data that looks nice on paper, they want to create games in which players can own their loots, participate in quest creation, share revenue, and have fun. Godwoken Game + Blockchain can offer all of these to the game developers.

For more information, please follow GodwokenRises team on Twitter and Github.

Axon

Axon is another high-performance layer 2 framework based on CKB. It makes a different design trade-off than Godwoken: instead of relying entirely on CKB for security, it uses CKB as a staking layer to achieve both high performance and better-than-L1-PoS security, as the inherent problems of L1 PoS, such as long-range attack and subjectivity no longer exist.

Besides being 100% EVM compatible, Axon is one of the first to achieve universal account abstraction, thanks to the powerful CKB-VM and cryptographic libraries stored on the CKB blockchain. Axon smart contracts can load cells from CKB and validate their data and scripts using a special precompiled EVM that invokes CKB-VM.

Axon is also a native multi-chain framework with built-in interoperability and Cosmos IBC support, allowing Axon DApps to communicate with CKB, other Axon chains, and other blockchain ecosystems, especially those with compatible IBC ecosystems.

Axon’s core framework was stabilized in 2022, it is ready for devs who wants to run a high-performance EVM blockchain to build on it. Future work will focus on Axon’s staking and governance mechanisms. Axon will become a high-performance, highly interoperable, and simple-to-use scalability layer for Nervos with built-in staking and governance solutions.

For more information, please follow AxonWeb3 team on Twitter and Github.

Interoperability: From Land to Ocean

Marine-City-1963-1980s-Model-exposed-on-top-of-a-translucent-blue-cube-Photo
Marine City, 1963/1980s. Model exposed on top of a translucent blue cube. Photo: documented by the author in Metabolism: the City of the Future Exhibition at Mori Art Museum, Tokyo (Sept 2011)

The Metabolists’ design not only seeks to expand on land by constructing a framework but also to continuously extend to the waters, allowing people to move in both areas of land and sea. The land and the sea can be viewed as two distinct systems with distinct natural laws, like Web2 and Web3, or one blockchain and another, which can be viewed as independent ecosystems with distinct consensuses and protocols. Ingenious architectural design can communicate with land and sea, and excellent interoperability infrastructure must communicate across as well, allowing users’ assets and information to flow more freely between systems.

Force Bridge, the bridge between Ethereum/BSC and CKB, demonstrates Nervos interoperability with a concrete example - Ethereum users could move assets between Nervos and Ethereum without changing wallets. Nervos is now connected to the two largest ecosystems, Ethereum and BSC, so the marginal benefit of connecting to more ecosystems diminishes. At the same time, a series of bridge hacks in 2022 reminded us again the importance of decentralization.

Force Bridge operated smoothly and safely throughout 2022, but it’s better to decentralize it now rather than later. The Synapse team is working hard to achieve this goal. The first step is to create IBC-compatible relayers for CKB, which will allow messages to be passed between CKB and all other blockchains such as Ethereum, Cosmos, and even Axon and Godwoken. Then we can scale up a few relayers to create a more decentralized relay network, on which we can build a more decentralized Force Bridge 2.0.

Research

The Nervos research team has always emphasized quality above quantity, and in 2022, they published three papers at the industry’s top conferences:

  • NC-Max: Breaking the Security-Performance Tradeoff in Nakamoto Consensus
    • In this paper we identify and experimentally prove that the crux resides with the prolonged block propagation latency caused by not-yet-propagated transactions. We thus present a two-step mechanism to confirm only fully-propagated transactions, and therefore remove the limits upon NC’s performance imposed by its security demands, realizing NC’s untapped potential. Implementing this two-step mechanism, we propose NC-Max, whose (1) security is analyzed, proving that it provides stronger resistance than NC against transaction withholding attacks, and (2) performance is evaluated, showing that it exhausts the full throughput supported by the network, and shortens the transaction confirmation latency by 3.0 to 6.6 times compared to NC without compromising security.
    • Published on The Network and Distributed System Security Symposium (NDSS) 2022, February 2022
  • Polynomial IOPs for Linear Algebra Relations
    • This paper proposes new Polynomial IOPs for arithmetic circuits. They rely on the monomial coefficient basis to represent the matrices and vectors arising from the arithmetic constraint satisfaction system, and build on new protocols for establishing the correct computation of linear algebra relations such as matrix-vector products and Hadamard products.
    • Our protocols give rise to concrete proof systems with succinct verification when compiled down with a cryptographic compiler whose role is abstracted away in this paper. Depending only on the compiler, the resulting SNARKs are either transparent or rely on a trusted setup.
    • Published on The International Conference on Practice and Theory of Public-Key Cryptography (PKC) 2022, March 2022
  • Analysing and Improving Shard Allocation Protocols for Sharded Blockchains
    • As the first study on shard allocation, the overlooked core component for shared permissionless blockchains, the paper provides the first study on formalizing the shard allocation protocol, evaluates the shard allocation protocols in 7 permissionless sharded blockchains including Ethereum, proves the impossibility of simultaneously achieving optimal self-balance and operability, identifies and defines a property memory-dependency that is necessary for shard allocation protocols to parameterize the trade-off between self-balance and operability, and proposes Wormhole, a correct and efficient shard allocation protocol.
    • Published on 4th ACM Conference on Advances in Financial Technologies (AFT '22), Sep 2022

Driven by A Decentralized Community


The “mother city” of Marine City Project, 1963

I didn’t realize all of the above were accomplished in a single year until I wrote this post. It feels like we’ve been working for three years since 2021 (it’s no coincidence if you feel the same, 2022 is special in any case). I tried to recollect everything we did but found it impossible to create the complete list. I apologize if I missed anything.

The most significant advancement we made in 2022, in my opinion, was a more decentralized and vibrant developer community. At the infrastructure level, we have teams at Cryptape, MagickBase, Nervina, Godwoken, Axon, and Synapse collaborating closely to extend the frontier of blockchain architecture. At the application layer, teams including .Bit, Unipass, Yokai, Hadouken, Nervape, JoyID, Tempest, and others are shooting countless pieces of feedback at us. Building on Nervos is challenging since it requires work at both the application and infrastructure levels. I want to thank you all for taking on the challenge, creating with passion and building with love.

16 Likes

Some updates for L1:

we have completed all instruction implementation

The floating point instructions in RVV are not implemented since we don’t need that.

The Regular Compliance Extension (RCE) is an intriguing Omnilock
extension that could make UDT interoperable with traditional finance. "

The RCE is an extension of xUDT, not Omnilock.

Corrected, thanks!

This is a stunning beautiful article. Beautiful to read and interpret.
Thank you @janx and everyone involved in it.

1 Like