Blockchain technology has been actively embraced by an increasing number of countries and regions, and many well-known enterprises have begun to lay out their plans to use blockchain. Compared to traditional software development, there is a higher cost threshold for developers and enterprises who want to work with blockchain technology. Most current blockchains, such as Bitcoin and Ethereum, are isolated islands of data and value because inter-chain communication is not yet available for them. In the long run, this is an issue that has to be solved.
So what is the best way to reduce the difficulty in blockchain development and further help facilitate the efficiency needed for enterprises to use blockchain? Cross-chain communications between blockchains is a necessary challenge being tackled by a few projects. Recently, a new M&A crypto fund of 200M USD, established by BlockGroup (BlockVC’s parent company), announced their investment in NULS. Both NULS and Cosmos, which just launched its main network, are prominent representatives in the field of chain building and cross-chain technology.
This article will analyze and compare NULS and Cosmos projects from different perspectives to help you understand their technical implementation for chain-building and cross-chain, as well as their value.
1. Layered Design
In terms of the overall architecture, both NULS and Cosmos have adopted a layered design to separate the business layer from the underlying layer.
Cosmos is divided into two layers as a whole. The underlying layer is called Tendermint Core, which contains the consensus layer and the network layer. The business layer is called Cosmos SDK, which encapsulates the general business functions. In Cosmos, the business layer interacts with the underlying layer by invoking the ABCI (Application Blockchain Interface) of Tendermint Core.
In comparison, NULS has three layers, the underlying layer is called NULSTAR, which is a microservice infrastructure layer, and the business layer is further divided into two layers; the NULS Module Repository of the Basic Service layer and the DAPP layer.
The NULS Module Repository, similar to the Cosmos SDK, has a built-in general function module. For general blockchain purposing, NULS splits the common functions required by all blockchains into general modules.
Enterprises seeking to build a chain on NULS and Cosmos only need to focus on specific business features, and then create a desired blockchain with the general features provided by NULS and Cosmos.
The benefit of layered design is that the underlying code is encapsulated and the business layer correspondingly provides general business functions. In this way, NULS and Cosmos simplify the chain building work to a business-specific development, which greatly reduces the development difficulty and brings significant cost and time savings.
But unlike Cosmos, NULS specifically designs a DAPP layer to support smart contracts.
This can help the blockchain built on NULS extend the ecosystem with ease and efficiency. The DAPP layer of NULS also adds the basic application library, which can help DAPP developers deal with basic work such as network messages thereby reducing the workload. By invoking the interface provided by the Connector in NULSTAR, DAPP can then interact with the NULS platform, which can reduce the complexity of message communication in a more effective way.
Based on the layered design, both NULS and Cosmos are developed in a modular way.
For the business layer, NULS and Cosmos split the general business functions into different modules, and then each of them implements the function. So when developing the application, developers need only focus on the development of special business functions, and directly use the features offered by NULS or Cosmos to implement the common functions.
Both NULS and Cosmos have achieved a layered design of modularity. As a result, the implementation of specific functions does not necessitate the modification or consideration of the underlying layer of blockchain which greatly reduces the difficulty and cost of chain-building.
However, NULS differs significantly from Cosmos in overall architecture. Cosmos adopts a monolithic architecture that requires developers to download all of the code for development and testing, which adds the complexity to both of these processes. Furthermore, Cosmos uses plug-ins to extend the functions, which can be limited by the development language.
NULS adopts a micro-service architecture, with no code dependencies between modules. Each module can be developed and deployed independently making the whole process more developer-friendly. With NULS, developers only need to develop or upgrade a single module to extend the functionality, and are free of development language limitations.
In terms of the overall architecture, there are many differences between NULS and Cosmos for the specific purpose of chain-building. For example, in the modular split, Cosmos puts the consensus mechanism into the underlying Tendermint Core, while NULS puts that into the Basic Service layer of the blockchain — making it an independent consensus module. This means that for the blockchain developed on Cosmos, the consensus mechanism can only be Tendermint, while on NULS, different consensus mechanisms can be selected and used. The application of independent consensus modules in NULS can meet diverse business scenarios and allow enterprises to make flexible adjustments according to their business needs.
By comparison, the micro-service architecture adopted by NULS is more modular than the monolithic architecture of Cosmos, thereby making NULS more conducive to the system function extension which enables more flexibility to cope with different business scenarios. The need to upgrade or replace a module does not affect other modules, which further ensures the stability of the whole system. For the blockchain with complex business applications, micro-service can better split the business service, ensuring the clarity of business data. This reduces the difficulty of operation for enterprises and lowers costs.
3. Consensus Mechanism
Tendermint is the consensus mechanism of Cosmos which is developed by Tendermint, the core R&D team of Cosmos. The NULS consensus mechanism is called POC (Proof of Credit), developed by the NULS core team. Both POC and Tendermint are POS consensus algorithms, and incorporate Byzantine fault-tolerance mechanism.
In both POC and Tendermint, there are two roles: verifier and delegate. The verifier establishes a node by using the collateral Token to join the consensus and get the reward. The delegate can also get the reward if he stakes the Token to the node. Token in the consensus cannot circulate temporarily. You can cancel the consensus relatively soon to enable the circulation.
Cosmos Hub’s main network has just been launched, and Token circulation is not yet available. In the first phase, Cosmos can support 100 verifier nodes. The NULS main network was launched in July 2018 with the main network operating stably and there is no specific limit on the number of nodes.
In DPOS, only super nodes can generate new blocks, while the delegate will not get the consensus reward and the Token participating in the consensus can circulate freely. POC and Tendermint, by contrast, allow more nodes to participate in block production, encouraging more people to maintain the network, thus ensuring the decentralization of the system. What’s more, the Token in consensus cannot be circulated, leading to the improvement of network security. Compared to Bitcoin’s POW mechanism, the threshold for POC and Tendermint to participate in mining is low enough to bring great energy savings.
Partition fault-tolerance is a must for blockchain, and POC and Tendermint deal with partitioning in a different way. The Tendermint network is more focused on consistency when the network is partitioned, and if the partitioning results in less than two-thirds of the nodes voting, the Tendermint network must wait, which means that Tendermint’s network can get stuck. In the POC, network different partitions can produce blocks normally, and will be merged to follow the final consistency if the network is restored.
Availability is of great importance for any public chain. When the network is partitioned, the inaccessible network will cause a large number of applications and transactions to be unusable, which will affect the normal business operation of the enterprise. For the public chain with a big user base, this will lead to transactions and DAPPs being disabled providing unpredictable results.
NULS and Cosmos almost coincide in concept for chain-building. By encapsulating the bottom layer and dividing the business layer into modules, both can enable chain-builders to focus on specific business functions, thus simplifying the chain-building and saving on development time and cost.
However, Cosmos adopts a monolithic architecture. When building a chain on Cosmos developers have to implement other specific business modules through plug-in development with the Cosmos SDK. The micro-service architecture of NULS enables chain-builders to independently develop specific business modules and then dock with the general module of the NULS Module Repository. In addition to this convenience, each module can have multiple replaceable plug-ins to extend any business functions.
The modularity of NULS places no restrictions on the development language. The development and testing process grants ease and flexibility, which can meet more customization requirements of enterprises.
Simple business systems can even directly dock with NULS without any extra development effort. For larger blockchain systems, micro-services has higher scalability, further ensuring the stability of the system and sharply reducing operational costs.
The overall roadmap of Cosmos and NULS shows the telltale differences in their respective development positions. Cosmos generally focuses more on development and research in the cross-chain field, while NULS takes a two-stage development approach, namely chain-building and cross-chain. In the chain-building stage, NULS plans to launch the core product Chain Factory to facilitate “one-click chain building”.
Chain Factory is implemented based on the NULS Module Repository, which not only contains common functional modules, but also business modules developed by different developers. In this way, enterprises can choose suitable business modules when using Chain Factory to build a chain, further reducing the development cost.
Chain-building can be realized through Chain Factory with only four simple steps:
- Select the required modules in the Module Repository of the Chain Factory;
- Configure the basic system parameters and fill in the information of the genesis block;
- Fill in the chain introduction and chain-running method;
- Pay a deposit and broadcast a chain-building transaction.
The Chain Factory itself is a blockchain in which the nodes can run multiple chains at the same time. In this way, the blockchain built through the Chain Factory can directly run on the nodes of the Chain Factory, which saves the trouble of setting up the operation environment of blockchain nodes, and greatly reduces the cost of development. Of course, enterprises can also choose to set up their own nodes for their blockchain.
Cosmos focuses heavily on the development of cross-chain field. It achieves plug-in chain-building through the Cosmos SDK. NULS divides the development stage into two stages: chain-building and cross-chain. In the chain-building stage, NULS accomplishes modular chain-building to facilitate “one-click chain-building” through its core product Chain Factory.
The NULS and Cosmos cross-chain solutions have the same overall idea. Both adopt the relay mode to realize the value communication between the chains.
Cosmos implements the parallel-chain communication through Cosmos Hub as the bridge. NULS uses its main network as the bridge to enable parallel chains to communicate. NULS will process Byzantine on the cross-chain transaction, which will be packaged only after 80% of the nodes confirm the transaction. Cross-chain transactions cannot be lost, and the confirmation will still be restored after merging the partitioned network. For data and other business scenario communications, both NULS and Cosmos can add additional relay chains.
The NULS Module Repository and Cosmos SDK both provide their own cross-chain protocols to directly realize cross-chain functionality. For out-of-ecosystem blockchains, such as Bitcoin and Ethereum, NULS and Cosmos both work in an indirect way. NULS provides the protocol conversion layer to enable other public chains to communicate with the NULS main network, thereby indirectly communicating with other parallel chains in the NULS ecosystem. In Cosmos, a proxy chain is developed with the Cosmos SDK to communicate with the outer chain and the Cosmos Hub, thus indirectly communicating with other parallel chains.
- Both NULS and Cosmos adopt a layered design, which enables enterprises to build a chain with ease through modular development. The difference lies in the technical selection between the two, where Cosmos uses a monolithic architecture, and NULS adopts a micro-service architecture.
- Monolithic architectures and micro-service architectures have different applicable scenarios. For a small blockchain system, Cosmos’s monolithic architecture may be a better choice, but for a large blockchain system, the NULS micro-service architecture can better split the business, improve the scalability of the system to reduce the operation cost of the enterprise.
- NULS and Cosmos have different types of support for chain-building. Cosmos uses plug-in chain-building through the Cosmos SDK and NULS will achieve “one-click chain-building” through the core product Chain Factory.
- Both NULS and Cosmos adopt the POS consensus mechanism, whereby each token holder participating in the consensus receives the consensus reward motivating more people to maintain the network and improve the system security. At the same time, the low threshold for participation in mining effectively ensures the decentralization of the blockchain.
- Both NULS and Cosmos provide chain-building and cross-chain, and their overall ideas have many similarities. The success of NULS and Cosmos in the future will have an important impact on the development of the whole blockchain industry.
About the Author:
Ken Huang is a well-known blockchain expert, chief scientist of NUChain, American Distributed Apps CEO, and member of the Blockchain Experts Committee of the Chinese Institute of Electronics. He is also a NULS technical advisor.
Xiang Wenbo is a Java software engineer, cryptotech-writer and NULS Core Team member. He focuses on blockchain technology research and blockchain solutions.
Reaper Ran is a NULS Co-Founder & Director of Community Operations. He has long been engaged in the research of blockchain technology and project prospect. As an early participant and evangelist of blockchain, he has rich experience in community construction and operation, and is responsible for the research and operation of the NULS community governance.
Ken Huang, NULS Chinese community, “NULS one-click chain-building and cross-chain ecosystem”
Li Hua, ChainNews, “Soft and hard core: thoroughly understand Cosmos; how to implement one-click chain building and numerous chain intercommunications”