Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
Cosmos in-depth research report: Blockchain 3.0, the basic state of the Internet
Foresight
特邀专栏作者
2022-02-03 08:34
This article is about 20808 words, reading the full article takes about 30 minutes
In 2014, Cosmos began to build a blockchain network; in 2022, will it become the singularity of the Cosmos explosion?

first level title

Original source:Foresight Research

0. Preface

In 2014, Tendermint, the prototype of Cosmos and its source project, was established, and it was only 5 years since the white paper of Bitcoin was released.

In 2018, the white paper of Cosmos won the best white paper at the Wanxiang Blockchain Week in Shanghai, and the bear market started a 4-year cycle.

In 2022, Cosmos finally realized the white paper, and the blockchain world began to think seriously. The public chain is no longer the only one, but as described by Cosmos, it is a universe of blockchain interconnection.

Table of contents

Table of contents

1. Cosmos: Blockchain 3.0

1.1 Bitcoin: Blockchain 1.0, the value of decentralization

1.2 Ethereum: Blockchain 2.0, Explosion of Applications

1.3Cosmos: Blockchain 3.0, a scalable and modular blockchain network

1.3a) Construction of public chain

1.3b) Composition of the public chain

1.3c) Tendermint consensus mechanism: provision of BFT-based POS

1.3d) Cosmos SDK: Modular development method

1.3e) IBC cross-chain protocol: TCP/IP protocol of blockchain Internet

1.3f) Cosmos Hub: Value Hub

1.3g) Gravity Bridge+EVMOS: Compatible with the Ethereum ecosystem

2. Choice of multiple chains: Cosmos Vs. Polkadot Vs. Avalanche

3. The inevitability of multiple chains: the premise of Web 3.0

3.1 Multi-chain world: infinitely scalable modular blockchain

3.2 Multi-chain Defi: a complete financial system

first level title

4. Summary

1. COSMOS: Blockchain 3.0

Cosmos is not an independent blockchain, but a network, a network of blockchains.

The goal of Cosmos is not to build its own blockchain, but to build an interoperable network ecosystem. In order to achieve an interoperable network, Cosmos provides developer tools to lower the development threshold, including the Tendermint consensus engine, the modular development framework of the Cosmos SDK, and the IBC communication protocol to realize the transfer of information and assets between blockchains, and to open up different blocks The isolated islands of chains form the Internet.

secondary title

1.1 Bitcoin: Blockchain 1.0, the value of decentralization

Bitcoin is a decentralized monetary system. Bitcoin's blockchain technology introduces a consensus mechanism in a distributed database for the first time: Proof of work, which encourages participants to become miners by rewarding the native token bitcoin to ensure consistent ledgers.Bitcoin is a ledger that anyone can participate in bookkeeping, but no one can own this ledger, so no one can change the records on this ledger. It is the first time to realize a decentralized monetary system through technical means , transfer value.You can trade or transfer money with anyone in the world, you only need to know the bitcoin address of the other party, and you don't need to confirm the bank or even provide the residential address.

The consensus mechanism of POW solves the trust problem and does not need to trust a certain person or institution (this will give them great rights).Everyone can participate in the Bitcoin network and become a node to keep accounts together. A node can only keep accounts and obtain the consensus of the whole network after calculating the mathematical problem of the encryption algorithm, ensuring that the same bitcoin will not be used twice . If someone wants to maliciously attack the network, for example, transfer 1,000 bitcoins to their own ledger, then 51% of the nodes in the network must agree to complete the modification. Now Bitcoin mining is more like an arms race, the barriers to joining the network are getting higher and higher, and it is even more difficult to master 51% of the nodes, ensuring the security of the network. Therefore, the value of Bitcoin as decentralization is increasingly being recognized by more people and has gained a global consensus.

However, Bitcoin has limited room for development.secondary title

1.2 Ethereum: Blockchain 2.0, Explosion of Applications

The smart contracts brought by Ethereum have opened up the development space of application scenarios, and the blockchain can be adopted by more mainstream people.Ethereum Virtual Machine, Ethereum Virtual Machine simulates a processing system with complete hardware system functions, through which applications can be run, which is the smart contract we see. Developers only need to tell the smart contract what to do and how to do it through the code, and the rest only needs to be executed by the smart contract itself. Smart contracts liberate the development space of the application layer, and developers can build various applications that can be used by users, entering the blockchain 2.0 era.

But Ethereum still faces the problem of balance, that is, the problem of scalability, usability, and independence.Existing app DAPPs deployed on EVM are essentially competing for the limited block space on the chain, and the expandable space is limited: only universal optimization can be done to deal with various types of EVM, but different Application scenarios have different requirements. For example, Defi needs to be confirmed quickly, but NFT applications require storage space, so Ethereum cannot be suitable for all application scenarios, and the availability ceiling is low: all DAPPs based on EVM need to rely on The underlying environment of Ethereum, because EVM is deployed on each node on the Ethereum network, if DAPP needs to be modified, it is limited whether it is compatible with the underlying Ethereum network. Once a smart contract is deployed, developers can basically only rely on the contract to run autonomously.

EVM has really opened up the application scenario space where the blockchain is supported by the underlying technology.Systems like Apple's IOS give developers room to create, turning mobile phones from a single communication tool into a smart tool that includes social, entertainment, and work. As the bottom layer of smart contracts, Ethereum's EVM also gives developers unlimited creative space, bringing the decentralized financial system Defi we see now, providing NFT with confirmed rights, and a decentralized game economy Body gamefi.

secondary title

1.3 Cosmos: Blockchain 3.0, a scalable modular blockchain network

Cosmos goes a step further on the basis of Ethereum, and provides scaffolding for building blockchains in the form of CosmosSDK. It provides a general development framework and Cosmos SDK modules, which greatly simplifies the difficulty of blockchain development. For developers, customization can be added. function extensions.

1.3a) Construction of public chain

First of all, all applications that solve specific application scenarios need to be built on the underlying public chain. Specifically, the application layer on the upper layer of the public chain has the greatest impact on application development, and the network layer and consensus layer at the bottom of the public chain provide more What matters is the underlying performance of the application running. As long as the specific underlying design ensures the performance, it will not have more impact on the application itself.

However, if you want to achieve mainstream adoption, you may need the entire public chain to serve the application alone. For example, Axie, a popular chain game in 21 years, chose to develop its own side chain Ronin to handle a large number of transactions. If you continue to rely on Ethereum, which carries other Defi, NFT and other transaction activities, it will not only be unable to handle the business of the Axie game, but will also cause congestion on the Ethereum network. After all, the TPS of Ethereum is only 10. Therefore, in the long run, a large number of applications are piled up on one main chain to share resources, which can not satisfy the applications, but also drag down the entire network. It is impossible for a single public chain to be optimal for every application scenario. Projects on different tracks should choose to build on the public chain ecology that suits them. Cosmos provides a modular blockchain that developers can build more efficiently. A chain that adapts to the application scenario

At the same time, the explosion of applications on Ethereum has also made developers realize that different application scenarios have different requirements for public chains. For example, the speed of confirmation time has a greater impact on Gamefi projects than Defi projects. Ideally, each application should have an independent blockchain in consideration of future mass usage scenarios. However, developing the bottom layer of the public chain is neither necessary nor a waste of resources. The current design of the location public chain is roughly the same, and the development workload is huge, and there are not many people who can actually do it.

1.3b) Composition of the public chain

We can look at what it takes to build a blockchain from scratch:

1. Data layer: data storage technology, mainly based on cryptography data storage, to achieve transaction security, including Merklle tree, digital signature, hash function, asymmetric encryption technology, etc., store data in a block and then pass the chain The structure, combined with the technology of time stamp, is connected in order to form a block.

2. Network layer: The mechanism of node communication in the peer-to-peer network affects the speed of information confirmation of the blockchain and also determines the scalability of the blockchain

3. Consensus layer: Unified accounting method, allowing decentralized nodes to agree and confirm the records of the ledger to ensure the security of the blockchain.

4. Incentive layer: Encourage nodes to participate in the blockchain through the economic incentive model, which is often referred to as the mining mechanism, which is the basis for the operation of the blockchain

5. Contract layer: Smart contracts represented by Ethereum can develop and automatically execute applications

6. Application layer: user-oriented products

1.3c) Tendermint consensus mechanism

Tendermint is actually the name of the company created by the founder Jae Kwon before Cosmos was created, and Tendermint Core is the actual software used. It mainly consists of two components: Tendermint Core, which provides a consensus mechanism, a consensus engine, and adapts to most programming languages The interface ABCI.

In the design of Cosmos, the data layer and the network layer are classified into the network layer, the contract layer and the incentive layer are classified into the consensus layer, and the contract and application layers are classified into the application layer. For developers, the bottom layer of the network layer and the consensus layer are not the key to their development, but the development of the application layer, which is responsible for business logic to provide application scenarios. Tendemint provides a general network layer and consensus layer, allowing developers to build their own application layers on this basis.

As a general engine, Tendermint Core can safely and consistently record transactions on the chain, which includes the network layer and the consensus layer. The network layer uses the Gossip protocol, which imitates the spread of epidemics in the P2P node network. The network protocol is also the protocol used by the Bitcoin network layer; the consensus layer uses BFT+POS, we can look at the specific algorithm.

1.3c1) Tendermint Core consensus engine: BFT-based POS consensus algorithm

In fact, everyone has encountered the problem of consensus, that is, discussing what to eat when eating with friends. It's just that in the blockchain, it becomes a node to discuss what to write on the next block.The blockchain allows nodes to join or leave at any time. Even if there is a failure, the nodes in the network can still work normally. This is based on the rules formulated in advance, and this set of rules is the consensus mechanism.

Satoshi Nakamoto incorporated Byzantine Fault Tolerance (BFT) into the design of Bitcoin for the first time, and began to introduce the academic fault tolerance mechanism into distributed computing like blockchain, thinking about building a reliable system in an unreliable environment . Jae Kwon was the first to really propose to apply BFT research to the PoS blockchain, and created Tendermint to realize his idea.

BFT Byzantine fault tolerance mechanism

In 1982, Lamport, Shostak and Pease proposed the Byzantine Generals Problem for the first time. A group of Byzantine generals besieged a city from different positions and needed to decide to attack or retreat. However, generals in different positions can only communicate with each other through messengers. If there are traitors among these generals, the traitors can send different messages to different generals, such as sending a false message to a general who is inclined to retreat that other generals are also planning to retreat, disrupting the Everyone's decision.

The ability of a loyal general to reach a consensus mechanism in the presence of traitors is called BFT, Byzantine Fault Torerance. BFT guarantees that when the total number of nodes is N, the number of faulty or malicious nodes is F. As long as N >= 3F + 1, the network can still reach a consensus and make a consistent decision.

Participants in the network cannot determine whether someone is lying, or whether the message has been modified. Even if these problems exist, the system in which the participants can reach a consensus to make a decision is called Byzantine Fault Tolerance (BFT).

POS Proof of Stake

consensus mechanism

consensus mechanism

The process of obtaining consensus is mainly that the verifier obtains 2/3 of the votes in the process of multiple rounds of proposals, pre-voting, and pre-submission. is the quantity) plus 1, otherwise restart the whole process. Those who only participate in the preparation stage of proposal, pre-voting, and pre-submission are called non-verifier nodes, or light clients, which ensure that all nodes in the network can listen to messages; verifiers who participate in the whole process from voting to block generation are also called It is a full node; the verifier who starts each round of voting process is also called the proposer, to ensure that the responsibility is fulfilled, the greater the rights obtained according to the pledged tokens, the greater the probability of being selected. In other words, the more you put in, the better your chances of getting a return.

Of course, not every round will successfully generate blocks, and the whole process will restart when the proposer may be offline or delayed.

At the same time, the light client can verify the validity of the transaction. Compared with the verifier who stores the complete blockchain information, the light client only needs to periodically download part of the information, that is, the block header (which can be understood as the title of the article), and does not even need to synchronize all the block headers on the chain. The final result of the block can be used to track the set of validators participating in the voting, and verify whether more than two-thirds of the validators from the block have pre-committed.

performance

performance

The Nakamoto Consensus and the way of POW allow everyone to join as miners to obtain the right to bookkeeping through the competition of computing power, that is, to produce blocks. However, Tendermint will preset fixed nodes. If you want to increase it, you need at least 2/3 of the nodes to vote unanimously. At the same time, in order to prevent too many nodes from reaching consensus and slowing down, the upper limit of tendermint nodes is 100, and the results obtained have Final determinism, which means that under the same input conditions, the output result is always determined, ensuring that the user's transaction is completed immediately. And Bitcoin may have the risk of bifurcation.

Tendermint verifiers with a limit of 100 may be pledged not decentralized enough,Still, decentralization in blockchain should be a means, not an end in itself.As long as the cost of destroying the system is high enough, and there are targeted defense and punishment mechanisms, even if Tendermint's verifiers are fixed and known, it will not prevent stable and deterministic consensus.

Tendermint Core, as the consensus engine that provides the network layer and the consensus layer, is a consensus mechanism that supports BFT. This means that even if 1/3 of the nodes fail, including hacker attacks and malicious attacks, Tendermint's network can still achieve consensus and work normally. This means that the network using the Tendermint consensus engine can guarantee the safe operation of the network in most cases, which is the prerequisite for any application to start large-scale use; at the same time, it is fast, with a block time of about 1 second, ensuring the same transaction Recorded on the chain in the same order

1.3c2) ABCI interface: an interface that liberates developers

In the Cosmos blockchain network, each blockchain uses Tendermint as the underlying general network layer and consensus layer, and each application can design its own business logic at the application layer. For developers, they only need to call ABCI, Application Blockchain Interface, and they can build applications directly on the final transaction provided by the consensus mechanism provided by tendermint.

ABCI: flexible calling method

ABCI, the full name of Application Blockchain Interface, as a socket protocol is a calling interface, unlike other blockchains that require developers to learn and use a specific language, developers can choose the language they are familiar with for development.

We have seen that Bitcoin and Ethereum all adopt an integrated idea when designing blockchain networks. Each technology stack, that is, each level of the blockchain we just mentioned, is an interlinking and Dependent programs cannot be disassembled individually.

This overall architecture is prone to two problems during development.

1) The code is difficult to use. For example, a stack of Bitcoin includes the transaction pool mempool to be processed, account balance, user permissions, etc. If you want to separate the mempool, it will become very difficult, even if it is forked, it will be difficult to maintain. Noodle code, entangled like noodles, messy and difficult to figure out.

2) Limit the development language. In the Ethereum network, the EVM needs to compile the smart contract code into bytecode through a compiler and upload it to the blockchain before performing operations. As a result, developers can only use the languages ​​supported by the EVM compiler, namely Serpent and Solidity.

Function type

There are mainly 3 ABCI connection application layers and Tenderint consensus layers, including:

1) CheckTx: Verify the transaction and submit it to the mempool transaction pool to broadcast the transaction

2) DeliverTx: Submit to the consensus engine for processing and update the status

3) BeginBlock/EndBlock: Query the status of the application layer

The abci protocol includes several different message types. Tendermint core will create 3 ABCI connections to the application layer:

In computer science, monolithic architectures are generally not considered a good practice. Cosmos has transformed the original need to build a stacked blockchain architecture from the bottom layer into a modular structure that can be freely combined. Just like assembling a computer, you can assemble a memory stick, monitor, keyboard, and mouse into a computer. You need to consider adding specific configurations before you can drive on the road. The configuration of the application layer also provides tools. The Cosmos SDK, a framework that allows developers to customize configurations for application scenarios, provides a new development paradigm.

A diagram summarizing Tendermint

1.3d) Cosmos SDK: Modular development method

The essence of the blockchain is a state machine that can be replicated, a logical model that simplifies the causal relationship of things, and a certain condition can be given to update the state. For example, Bitcoin is a ledger that can be downloaded by everyone. After a new transaction is successful, it will be updated to this ledger that everyone can see.In practice, a large number of transactions can be packaged and uploaded to the chain to modify the state of the ledger.

1.3d1) SDK module design

Through the modular design, the SDK provides common application functions, and each function can run independently and be combined. manage. Each module can also be regarded as a separate small state machine. Developers can customize the state and the way to change the state, and save it in the Multistory in the form of KVStore to support future use. At the same time, as open source software, developers can quickly iterate through project practice.

operating mechanism

operating mechanism

The state of the application layer is defined and maintained through the mechanism of Multistore, and the state of the application layer is divided into different modules, which can be regarded as an independent state machine. The ABCI interface in the underlying basepp built in CosmosSDK can be directly called to adapt to all application types. The Tendermint consensus mechanism is submitted to the mempool transaction pool after being verified by CheckTX as non-attack. After the verification node reaches a consensus and successfully produces a block, the transaction is packaged on the chain, and the status is successfully modified through DeliverTx, that is, the transaction is successful.

After receiving the transaction in byte form through the function of DeliverTx, decode and extract the message. After verifying the information related to the transaction, such as whether there is a signature, it is pushed to the corresponding module for processing, and finally the status is updated. The updated state is saved by the Multistore function in the SDK, and the information can also be divided to correspond to different modules.

1.3d2) SDK module function

Functionality provided by existing modules

Account module: the account module of the company's account management

Bank module: company transfer transaction

Staking module: company token pledge

Slashing module: slashing of division punishment strategy

Distribution module: the distribution module of the company's reward distribution

Supply module: generated by new coins

Gov module: on-chain governance

It basically covers the necessary functions of the application layer, and developers can directly use these wheels to develop their own cars.

compatibility

The SDK supports developers to use third-party modules, but some safety checks need to be done to ensure that each module can be adapted to each other.

The IBC protocol and the SDK run independently. The use of the Cosmos SDK module does not require binding to the consensus mechanism of Tendermint. Developers can choose the underlying consensus protocol according to their own demands, and the IBC module introduced later is linked under certain conditions. Different consensus algorithms, for example, the two major public chains of Bitcoin and Ethereum.

Object-Capability Model supports object model

The Cosmos SDK supports the object capability model, which allows the operating logic of each module to be stored in the Keeper function. By calling the Keeper, the module storage device can be read and written in the corresponding application. This means that even if there is an unknown or malicious attack, without knowing the specific code, the referenced objects and links can be analyzed to ensure the security of the system, as long as there are links between the referenced objects.

This logical control called a keeper can be hidden behind the scenes to isolate different codes and ultimately improve the security of the system. For the application architecture, developers can more clearly sort out the functions, logic, and links of the code, so it is easier to locate problems, adapt to other languages, and even optimize more.

Applications built with Cosmos have an independent application layer, consensus layer and network layer. Developers can choose verifiers of the network layer to build their own communities and economic systems. If the default consensus layer Tendermint Core is used, developers can choose their own verifiers across multiple cosmos blockchains. The public chain based on the Cosmos SDK already has services provided by large public chains such as Binance Chain, Terra, and Kava.

Josh, who developed the Keplr wallet, once concluded that using smart contracts is renting a house, and developing with CosmosSDK is building your own house.

1.3e) IBC cross-chain protocol: TCP/IP protocol of blockchain Internet

The IBC cross-chain protocol is one of the modules of the Cosmos SDK. Applications built using the Cosmos SDK can be upgraded to be compatible with the IBC protocol, just like we usually upgrade mobile phone software.

IBC, the full name of Inter Blockchain Communication Inter-Blockchain Communication Protocol, unifies the standard for cross-chain communication between different blockchains. It can be understood as the unified weights and measures of the Qin State during the Warring States Period, or in the words of Sunny Aggarwal, the former chief researcher of Tendermint, IBC is to standardize the containers for transporting goods and realize global economic trade.

1.3e1) Cross-chain protocol design

The functions and scenarios provided by a single public chain are limited, so cross-chains are required to meet more needs, such as paying through Alipay after ordering takeaway on Meituan. Cross-chain is essentially a safe and credible transfer of data to another chain, and achieves the desired effect.

Referring to the development history of the Internet, born out of Arpanet, ARPANET (Advanced Research Projects Agency Network, Advanced Research Projects Agency Network) is the first network to realize computer remote communication, but it can only be transmitted in a limited number of specified nodes information.It was not until the TCP/IP protocol, or Internet Protocol Suite, the network transmission protocol of Internet Protocol Suite/IPS, provided a standard mechanism for how to communicate and receive information between different computers, that the Internet we use today was formed. On top of TCP/IP, other protocols are needed to ensure different types of transmission, such as HTTP for web pages, SMTP for email, etc.

As a cross-chain standard, the IBC protocol provides:

1. Interoperability

As the basis of cross-chain, the IBC protocol can realize real cross-chain interoperability, including:

1.) Asset cross-chain: transfer assets on different chains to the target chain, such as transferring ETH to the ATOM chain

2.) Cross-chain information: Obtain and use information from other chains, such as borrowing on Cosmos after mortgaging assets on the Ethereum chain

The value of cross-chain is not only reflected in the value of tokens, but also brings about the real Internet composed of blockchains, just like the Internet we use now

2. Security

The less functionality, the less likely there is to be a security hole that can be exploited.And IBC assumes that different chains do not trust each other. The security of the IBC protocol comes from the finality of the Tendermint consensus. The security of BFT and the verification function of light nodes discussed above can provide sufficient security, and no other possible trust assumptions.

3. Versatility

There may be no end to the pursuit of technology, but technology is a tool for service needs, and the final judgment comes from users. Therefore, when a technology is adopted, the choice may not be the best technology, but the technology with the most user base. Similar to the development process of Internet technology, after the TCP/IP network technology was proposed, there have been solutions with better performance, but none of them have been adopted by the entire network. The same is true for the blockchain. In addition to research on technology, technologies that require user needs may be accepted.

From a general point of view, the IBC protocol only puts forward the minimum requirements on the application layer, which is conducive to the widespread deployment of the IBC protocol. When more blockchains join the IBC standard, the greater the possibility of IBC becoming a true cross-chain standard.

4. Compatibility

As a universal standard, IBC needs to adapt to various types of blockchains that do not trust each other. Ensure that the result of the blockchain as a state machine is deterministic, that is, it cannot be withdrawn, so as to ensure the correct execution of communication. This means that the blockchain must have a consensus mechanism that provides finality to be compatible. At present, Bitcoin and Ethereum of POW do not support it, but the Gravity Bridge introduced later can also achieve cross-chain.

1.3e2) Cross-chain protocol content

Similar to the TCP/IP protocol, it defines that different computers use the structure of IP address (computer ID), port number (application program ID), and protocol number (transport layer standard) to transmit information when transmitting information.

In the IBC protocol, the IP address of the locating computer is the channel ID, and the port of the locating application is the port ID. Together with the synchronization information of the client, it constitutes a standardized way of communicating information. The concise protocol reduces the burden of cross-chain communication on the chain itself, and does not have too many constraints on the application itself that participates in cross-chain communication, making it more flexible.

Port ID

Every modular application has a specific port, called Port ID

Channel

First of all, each module needs to recommend a channel using the IBC communication protocol, and multiple channels can be established to avoid information overload of a single channel. It is also possible to reject the channel upon encountering an error return when initializing the channel.

At the same time, the channel can ensure the order of transactions, and theoretically can also support disordered channels to facilitate verification of validity.

port port

light client

light client

The light client needs to synchronize the block header information of the other party, track the validator set of the other party in real time to verify the validity and legitimacy of the transaction, and support the isomorphic blockchain built with CosmosSDK

Handshake handshake connection

After the communication is established, it is necessary to confirm the mode of operation, and the exchange of information can only be carried out after reaching an agreement

1) Chain A initiates an OpenInit request across chains to Chain B, and waits for the Relayer to receive the request.

2) After Realy receives the OpenInit request, it constructs an OpenTry request and sends it to the B chain.

3) After the B chain receives the OpenTry request, it agrees and confirms to generate an OpenACK packet, and sends it to the A chain by the Relayer in the same way.

4) The A chain judges whether the handshake is successful through the OpenACK data packet, and if it succeeds, it will send OpenConfirm and return the data packet containing the information to the B chain, and the information is successfully transmitted; otherwise, the handshake fails

Packet

Cross-chain transaction

Cross-chain transaction

If the user needs to transfer 100 ATOMs from chain A to chain B, then the transaction process is

1) Verify whether the light client verification assets are legal and valid

2) Chain A sends proof that ATOM has been locked

3) B chain verifies the proof of A chain

4) Chain B creates 100 AMT Voucher coupons, which can be circulated and used until returning to Chain A to unlock the original 100 ATOMs

In fact, cross-chain transactions are just the exchange of ownership of assets on the two chains, with BTC still on the Bitcoin blockchain and ETH on the Ethereum blockchain. BTC loses its value when it leaves the Bitcoin blockchain, and the transaction actually transfers BTC as the value of an asset. Under the Cosmos model, the asset itself can be transferred on the chain.

1.3e3) Cross-chain protocol comparison Vs. Polkadot XCMP

XCMP protocol

XCMP, the full name of Cross-Chain Message Passing Cross-Chain Message Passing Protocol, a parachain inserted into Polkadot's relay chain becomes one of the chains in the multi-chain network, and then communicates with other parachains connected to the same relay chain through this protocol.

XCMP operation mechanism

The node that collects transactions in the parallel chain and submits them to the candidate block is called the collector, and verifies the candidate block provided by the collector in the relay chain to complete the transaction, also known as the block, and the node is called the validator. XCMP protocol collectors can send and receive messages from other parachains.

If a parallel chain, chain A, needs to send a message to another chain B, then:

1. The pledged token DOT uses the XCMP protocol to open a one-way channel from chain A to chain B to send messages. Another channel is required to receive messages. The deposit can be returned when the channel is closed after the message is delivered.

2. The collector on the A chain will put the message, recipient, and timestamp into the output queue of the A chain.

2. When the collector of the B chain passes the message through the network of the Gossip mechanism, he will find the message and put it in the input queue, and the message will be saved in the verifiers of the A chain and the B chain to ensure that it is legal and valid

3. The collector of the B chain submits the message to the verifier of the relay chain. After the verifier confirms, he puts the information into the relay chain to record the message and generate a block to complete the message delivery.

Messages sent using XCMP can include any data and messages, that is to say, it supports cross-chain interoperability of assets across chains and information across chains, such as cross-chain calling of contracts across chains.

However, according to the current multi-chain ecology, it is foreseeable that there will be a large increase in cross-chain transactions, and every time you use Polkadot's XCMP cross-chain, you need to pledge DOT to use a one-time channel, which has a certain cost and will sacrifice efficiency. At present, the XCMP protocol is still under development, and it is still necessary to wait to see the actual effect after it goes online.

Polkadot's XCMP protocol maintains global security through the relay chain, and the simple Cosmos IBC protocol reduces the cost of cross-chains by design. The IBC protocol is more like a WTO global trade agreement. Any country can freely establish multilateral Trade agreements, opening up global trade.

The Cosmo team likes to compare the IBC protocol to a container standard. Standardized containers can be traded at any port in the world. Cosmos' IBC protocol standardizes cross-chain information, allowing blockchains in the Cosmos network to communicate and trade. In this economically integrated network, the Cosmos Hub is the hub of this network.

1.3f) Cosmos Hub: Value Hub

The Cosmos network adopts a hub-and-spoke model, and the Hub serves as the central hub in the network, connecting other blockchains called Zones. Zone can connect to the Hub and record each public chain as the status of the Zone. When exchanging information, the three independent blockchains of the Hub and the interacting parties will leave records.

Among them, Cosmos Hub is the first blockchain in the network, and the Cosmos Hub developed based on CosmosSDK is also the first hub in the Cosmos multi-chain network.

1.3f1) Hub: Transportation Hub

The IBC protocol allows every public chain to be connected to each other, but this approach is not scalable. If there are 10 chains in the network, and each chain communicates with other chains, 45 links will be generated; if there are 100 chains, two-phase chains will generate 4950 links. Obviously, this approach is not sustainable.

To change the way of thinking, connect all the chains in series, then only 9 links are needed for 10 chains, and only 99 links are needed for 100 chains. While the level of complexity is significantly reduced, the risk of trust is increased. When A links to B and B links to C, then if you go from chain A to chain C, you must trust chain A and chain B at the same time to ensure the security of assets received by chain C. The verification is very complicated and prone to security risks.

operating mechanism

operating mechanism

Cosomos Hub adopts a hub-and-spoke model. Each blockchain communicates directly with the Hub as a zone zone. The Hub will simultaneously update the block headers of all Zones as verification information, and different Zones can communicate through the Hub. As a hub, the Hub can receive the status and information of all Zones, that is to say, the Hub records the balance and transaction records of each blockchain as the ledger, avoiding the double payment problem (Double Spend). When Zone 1 wants to transfer money across the chain to Zone 2, after Zone 1 sends the transfer message to the Hub, the Hub will prove to Zone2 that the transfer message is correct, and Zone 2 realizes the transfer after verifying that the message is legal through the block header stored on the Hub.

upgradeable

When a new version of the network appears or the configuration needs to be updated, all validators need to transfer to the upgraded blockchain at the same time, which may lead to hard forks in other blockchain networks. The blockchain in the Cosmos network, that is, the partition, only needs to transfer the users of the existing partition to the new partition through accessing the Hub to successfully upgrade.

The Hub + Zone model allows Cosmos to safely expand the network, even if there are 100 blockchains in the network, or even more blockchains can achieve interoperability.

1.3f2) Hub: Value Hub

Blockchain Security

The data verified by the blockchain through the consensus mechanism is difficult to tamper with, thus ensuring the security of data and transactions. For networks that use the POW mechanism, such as Bitcoin, the security is provided by the hashing power provided by the miners. Only when 51% of the computing power of the entire network is mastered can an attack be launched to tamper with data, also known as a 51% attack. At present, the scale of the Bitcoin network is very large, which makes it very difficult to gather 51% of the computing power, and even if it can be done, the cost is quite high, so the security of the POW consensus network is relatively high.

But if a small chain has less computing power, then the possibility of being attacked will be very high, and the network is very insecure. Similarly, networks using PoS consensus also face the same problem, but the security guarantee has changed from computing power to pledge deposit. In the PoS network, the verifier obtains the right to verify the output block through the pledge deposit, and at the same time provides security. The more assets staked, the stronger the security. If a chain is small in scale and the funds pledged by nodes are small, then the cost of nodes doing evil and the cost of attackers will also be reduced, and the security of the network will be greatly reduced.

The Necessity of Cross-chain Security

As mentioned earlier, as a BFT-based POS consensus mechanism, Tendermint requires 2/3 of the total pledged assets on the chain to reach a consensus. In other words, if an attack is to be launched, the attacker’s cost is 2/3 of the chain’s Total pledged assets. For example, the verifiers on a chain have pledged a total of 10 million US dollars. If 50 million funds are gathered on the chain, then the verifier with rational thinking will choose to steal 50 million funds, and only a minimum of 7 million US dollars is required , you can get 50 million - 7 million that was punished and confiscated = 43 million in return.

The way to provide security is to increase the cost of doing evil. There are two ways

1) Ensure that the ratio of pledged assets on the chain to the TVL (total locked value) on the chain is within a relatively safe range.

2) Allow chains with more pledged assets, such as Hub, to allocate assets to other chains with less pledged assets to provide security.

The application scenarios provided on each chain are different, and the TVL that can be captured is also limited. But for the interoperable Cosmos ecology, ensuring the security of each partition can ensure the security of the entire network, so it is meaningful for the entire network to provide the cost of doing evil by allocating capital to chains with less pledged funds.

The partitioned chain can add Hub’s pledge assets on the basis of its own chain’s native tokens, and the node’s cost of doing evil will change from the original chain assets to the sum of the original chain assets plus the Hub’s assets.

The value of cross-chain security

The main value brought to Cosmos by the cross-chain security that will be launched in February 2022 is

1) Guarantee the minimalism of the Hub: **Simplified functions bring improved security, because there are fewer security holes that may be exposed. Moreover, simple functions can serve target users more accurately and avoid serving users with different needs at the same time. ** For example, the features that Defi users like may not necessarily make Gamefi users happy. At the same time, the modular design can disassemble the module that provides a certain application function into an independently running blockchain and use the same set of validators. Even if it is attacked, the Hub can operate normally and avoid shutdown.

2) Lower the threshold for developing and operating public chains: the first thing a public chain must ensure is security. When the security of assets and data can be guaranteed, users will start to become users of the public chain. The cost of maintaining the public chain, as described above, requires a lot of money. If the developer can provide a good application scenario but lacks enough funds for a cold start, it can be obtained through cross-chain security.

3) Ensure the security of the Cosmos network: By sharing validators, the Hub binds the partitioned blockchains in Cosmos to the Hub and becomes a community of interests. The barrel principle is also applicable to the Cosmos network that links each partition. The network security of Cosmos depends on the weakest partition, and cross-chain security ensures that the weakest partition can also lease the security of the Hub, which actually complements the security of the Hub. The weaker blocks are completed, ensuring the security of the entire network. No matter how much economic value the partition application scenario can provide, as a participant in the Cosmos network, it will actually be the beneficiary of the entire network security.

It is worth mentioning that the function of the central ledger in the Cosmuo Hub network may affect decentralization, but everyone can run their own hub, and different partitions can also form a local area network and run independent Hubs. The universe hub.

The network does not require permission. Anyone can create a hub blockchain or partition, and has the right to reject connections from other blockchains to form their own local area network. At the same time, the partitioned LANs can also communicate with each other to ensure that internal communication is not affected by the external network. The Cosmos network can be a testing ground where both developers and users can experiment with different social and economic formations.

1.3f2) Atom: value capture

The native token of the Cosmos Hub is Atom. To become a validator, you need to pledge Atom on the Hub as a deposit to obtain the right to mine, and to obtain handling fees and transaction income. Validators on the Hub can not only earn benefits for the Hub, but also apply for additional benefits for the chains of other partitions. Once the node is evil, the Hub will confiscate Atom through the Slashing penalty mechanism

A way to provide cross-chain security

economic model

economic model

$ATOM is the governance token of the Cosmos Hub. By staking Atom, one can become a node of the Hub and other partitions at the same time to obtain rewards and transaction fees, including tokens of Atom and other partitions. Starting from the genesis block, 1/3 of the total amount of Atoms will be used as work rewards for network validators.

The initial supply is 200 million. Atom adopts an inflation model. In the first year, 7% will be issued for rewards such as nodes. After that, the annual increase will fluctuate with the annual mortgage rate: if the total pledged Atom is less than 2/3 of the total supply , the inflation rate rises to 20%; if the total pledge is greater than 2/3 of the total supply, the inflation rate will be reduced to at least 7%.

At present, the total circulation is 286 million $ATOMs, and the total market value is 8.4 billion US dollars. On January 21, the highest market value was 11.9 billion US dollars. The value of Atom is a large part of the cost of nodes doing evil (the number of pledges * token value), and the appreciation of Atom provides a certain guarantee for the network security of Cosmos by increasing the cost of doing evil.

governance mechanism

governance mechanism

The blockchain network, as software iterations and upgrades, is inevitable, and how to make changes and applications requires a governance mechanism. The Cosmos team explained the independent governance mechanism in "Hub Governance Mechanism Process in Cosmos":

In the real world, there are all kinds of economic systems, companies, governments, and countries. Each participant may have a different purpose, and the same is true for the blockchain. Differences stemming from philosophical or political ideas have caused Bitcoin forks, and the Ethereum community sometimes struggles to reach consensus, and in some cases even affects Ethereum upgrades.

Cosmos believes that there is no set of universal rules that can perfectly adapt to the application scenarios of each blockchain in this network, so each partitioned blockchain can run its own governance mechanism independently.Anyone who holds Atom can initiate a governance proposal for the Hub or Zone, which can be a software update, a block fee, or even a change in the security policy mechanism. The validators and introductions of the Zone or Hub vote on the proposal. Users and developers are given the freedom to experiment with unfettered potential.

1.3g) Heterogeneous chain communication: Compatible with Ethereum

In addition to the isomorphic public chain using CosmosSDK, other heterogeneous public chains can also connect to the Cosmos ecosystem. Among the existing blockchains, Cosmos is the first to realize communication with Ethereum

Obviously, as the ecology with the most developers, the compatibility of Ethereum can allow more developers to join the Cosmos ecology and attract more users.

Classification of blockchain:

1. Deterministic: The state on the blockchain is deterministic, that is, the transaction is irreversible, such as a blockchain based on the Tendermint consensus. At any time, every block starting from the genesis block can be reproduced and deduced.

2. Probabilistic chain: Network participants in the blockchain can only consider a certain chain as the main chain with a certain probability according to the proportion of different chains. For example, Bitcoin using POW can only confirm transactions by confirming that the block is on the longest chain, and usually needs to wait for 6 block confirmations, which is the longest chain rule.

As mentioned above, the premise of the IBC cross-chain protocol is a confirmed transaction. After all, you can only conduct transactions with others after confirming the transaction on your own chain. Therefore, when connecting to other non-deterministic blockchains, such as Ethereum, Cosmos provides Gravity Bridge to bridge Ethereum's native tokens, and EVMOS supports the operation of Ethereum's smart contracts.

1.3g1) Gravity Bridge: A cross-chain bridge between Cosmos and Ethereum

The cross-chain bridge is a method that allows assets and data to be transferred between blockchains with different consensus mechanisms, token standards, and governance models. It keeps assets on the original chain, releases assets on the target chain, and defines custody and unlocking of assets. condition. The Gravity Bridge, which was successfully deployed on January 19, 2022, bridges Ethereum and Cosmos, and supports the transfer of assets between the Cosmos SDK-based chain and Ethereum through the IBC protocol.

As a member of the Cosmos developer ecosystem, the Althea team developed a permissionless cross-chain bridge based on the Peg Zone in the Cosmos white paper, a proxy bridge that can connect Cosmos and other non-final blockchains, Gravity Bridge . At the same time, Gravity Bridge, as a cross-chain bridge exclusive to Cosmos and Ethereum, is not directly one of the modules of Cosmos SKD, but a blockchain independent of the Cosmos ecology, and has independent tokens to motivate users and verify By. Gravity Bridge will have its own independent verifiers responsible for network maintenance and security. At the same time, through the shared security of Cosmos, verifiers holding Atoms can also provide services for Gravity Bridge block generation.

In the design of the cross-chain bridge, it can be divided into:

1) Trust-based bridges are implemented by introducing trusted checkers: For example, Avalanche Bride’s cross-chain bridge requires trusted witnesses to use MPC technology, and Secure Multiple-Party Computation is the multi-party secure computing in privacy computing to ensure the validity of transactions It is legal and turns the cross-chain transaction into an ordinary transaction process on the chain.

2) Bridge without trust: Gravity Bridge first locks the assets to be transferred on the original chain, and after verifying the validity of the assets, it maps the assets to the target chain for use as assets.

As a permissionless bridge, the governance of Gravity Bridge will be carried out in the form of DAO, a decentralized organization, and DAO will hold half of the tokens for airdrops, ecological development, and liquidity mining in the future

1.3g2) EVMOS: EVM Center of Cosmos

Evmos, or EVM on Cosmos, originated from Ethermint, which was first conceived in Cosmos to be compatible with Ethereum's EVM. It is a blockchain that includes Cosmos SDK, Tendermint consensus, and EVM compatible modules. It will be launched in late January 2022.

EVMO: Ethereum Hub

As a compatible EVM blockchain, Evmos can be used as a Hub in the Cosmos ecosystem to connect to the Ethereum chain of specific application scenarios, such as chains that support Defi decentralized finance, or chains that support NFT, so that each application scenario can be used independently. Get the biggest support in the blockchain.

At the same time, both EVMO and IBC will support Ethereum’s token model, ERC20, which also means that other non-EVM-compatible chains that communicate through IBC in the Cosmos ecosystem can also interoperate with the Ethereum ecosystem. In other words, the Cosmos ecology and the Ethereum ecology can achieve interoperability

Moreover, the Cosmos SDK upgrade that will be upgraded this year can allow Evmos-compatible chains to obtain cross-chain security. EVMOS, as a Hub, can provide security for other EVM-compatible partition chains.

Economic Model: Community Shared Value

Although in the Ethereum ecosystem, only miners who maintain the network can get block rewards, Evmos rewards all participants of the Evmos ecosystem:

Staking rewards (validators + delegators): 40%

Team Belonging: 25%

Use bonus: 25%

Community Bonus Pool: 10%

At the same time, it also rewards the behavior of ecological value generation, including:

User fee rebate

Liquidity Mining Rewards

Smart contract revenue sharing

first level title

2. Choice of multiple chains: Cosmos vs Polkadot vs Avalanche

In a multi-chain network, cross-chain security and multi-chain scalability are contradictory. Cosmos, Polkadot, and Avalanche all provide different design solutions.

Cosmos, Polkadot, and Avalanche can be regarded as Taobao, Tmall, and JD.com respectively. Avalanche with professional customization may attract more enterprise users, Polkadot with security costs may attract more developers with financial support, and Comos It is Taobao that allows all things to grow.

Various merchants settle in, bringing various types of traffic and users, and finally leaving a thriving interconnected blockchain ecology. Technology may have a better solution, but the solution that is finally adopted must be a technology that meets actual needs.

If you just hope that a blockchain can meet all the needs or technical scenarios, then there is a high probability that this hope will fail.In fact, a multi-chain network does not necessarily have only one winner. Polkadot and Avalanche can also be used as partitioned ecosystems of the Cosmos ecosystem to give developers and users more choices.first level title

3. The inevitability of multiple chains: the premise of Web 3.0

secondary title

3.1) Multi-chain world: infinitely scalable modular blockchain

The traffic carried by the public chain is limited, and it is unrealistic to realize all application scenarios on one public chain. When the mainstream people adopt the blockchain as the underlying technology, we may need different chains to be designed for different application scenarios, and the modular blockchain makes it easy to build a blockchain

3.1a) Blockchain Design: The Impossible Triangle

In the design of blockchain, there is a famous impossible triangle, namely:

1) Decentralization: whether there is a centralized power center, mainly measured by the number of nodes

2) Scalability: What is the data throughput, mainly measured by TPS, Transaction Per Second.

3) Security: whether it can be protected against network attacks, including Sybil attacks, DOS, etc.

All public chains are designed to achieve these three goals on one main chain at the same time, and they can only choose the second of the three. For example, public chains such as Ethereum before modularization ensured the decentralization It can only sacrifice scalability while optimizing and securing. And most blockchain designs are designed in an integrated way, that is, a monolithic blockchain. It is difficult to provide a certain performance without affecting other functions, until it can be disassembled and combined. blockchain design.

The modular design rescues the blockchain from this impossible triangle, allowing different modules to be responsible for different goals, and completing the goals by combining modules instead of requiring one module to complete all goals. When blockchains are combinable and scalable, more and more blockchains can provide more application scenarios and support more and more people to use blockchains, as the underlying blockchain technology can support future Web 3.0.

3.1b) Blockchain Design: Specialization

Whether it is decentralization, security, or scalability, these properties are the result of describing the working process of the blockchain. The workflow we described earlier can be summarized as:

1. Consensus: Let the nodes participating in the network reach a consensus, and each node replicates the same result in the same order, which determines the degree of decentralization and security of the blockchain. It can be understood as the confirmation of the transaction.

2. Data availability: After the nodes complete the consensus and get the result, there is enough space on the chain to save and be available to everyone, which can be understood as the liquidation of the transaction.

3. Execution: Complete the required functions and upload new results to the chain. The speed of execution determines whether the blockchain can be expanded to support more transactions. It can be understood as the settlement of transactions.

Although most blockchains implement the three functions on the same chain, Ethereum has begun to explore Layer 2, which is to add a new independent layer while retaining the consensus and smart contract layers of Ethereum. The settlement layer solves scalability. This is actually the division of labor design of the blockchain.

secondary title

3.2) Multi-chain Defi: a complete financial system

The consecutive defi summer in 2020 and nft summer in 2021 have brought a large amount of capital into the crypto ecosystem, and the leading public chain, Ethereum, is unable to accommodate the rapid influx of large funds, resulting in a large amount of Ethereum traffic overflowing, bringing Some public chains have performed brilliantly, such as Avalanche and Solana, but from the data performance point of view, Ethereum still occupies an absolute dominant position.

There is still a major prerequisite for financial composability, which is cross-chain information exchange. Now each public chain determines the price based on the ecological assets and information on its own chain, like a data island. Although there are oracles that can provide market prices, the current market and technology are not yet mature. The chain is full of crises, and security incidents almost never stop.

3.2a) Segmented Battlefield: Liquidity Waste

But for the financial market, the bottom layer of asset pricing is liquidity, and the premise of liquidity is information symmetry. The circulation of information is required before the flow of assets, and the effectiveness of the market is based on the extent to which market prices can respond to information that affects the market. Obviously, the market information on the style-based blockchain still has price deviations in the absence of effective communication channels.

Although there are a large number of tools and robots on the chain that can find cross-chain price asymmetry arbitrage to level the price difference, these are only short-term arbitrage based on profits, and do not really allow assets to flow between different chains. They are still different. There is no cross-chain asset transaction channel between the chains so that assets can circulate at both ends.

The multi-chain ecology leads to liquidity fragmentation, and each chain has deposited a certain amount of traffic and assets on the chain. However, the lack of communication channels between different public chains makes these assets unable to circulate. The same asset lacks become untradable assets due to different chain mapping methods, or assets with high transaction costs, and excessive transaction friction causes liquidity waste.

3.2b) Cross-chain communication: the first step in reconstructing the financial network

Blockchain technology is reconstructing a new generation of financial infrastructure, from exchanges that provide liquidity and capital lending markets, to interest rate hedging that provides risk management tools, options, futures markets, etc. are just part of the puzzle in the financial system . A complete financial market is a complete jigsaw puzzle. When assets can freely flow from the lending market to the currency market, or the higher-risk capital market, the financial system is considered to be formed. As for these circulation channels, the network constructed by Cosmos through the IBC protocol and bridge provides a channel for financial network circulation.

3.2c) Multi-chain Defi: application prospects

When assets between different chains can flow, we may discover new application scenarios:

1) Cross-chain lending: Borrowing is the lowest demand in the financial system, providing liquidity for traders to participate in various investment and income opportunities provided by the financial system, no matter what chain or standard it is based on Token. Current users can mortgage ETH on Ethereum, contact Atom on Cosmos, DEX on Gravity, decentralized exchanges, obtain fixed or even higher returns on investment, greatly increase the liquidity on different chains, and open new Trading opportunities.

secondary title

3.3) Multi-chain social: unified identity

In real life, we work in a company, get a loan from a bank, and go to an exhibition in a gallery. We may have different identities. In Web 2, each of us has a WeChat account, Alipay account, and Douyin account, but these are independent accounts. You need to remember these account information and your behavior on these applications cannot be used on other platforms. on display. For example, your friends on WeChat may not necessarily find out that you are a funny video blogger on Douyin.

In a multi-chain world, these behaviors can be recorded and displayed on the chain. These data can include financial assets, transaction behaviors, and participating activities. Different from the fragmented, scattered, and broken data storage in traditional society, you can see your identity, your interests, and your experience on the chain. You can find art lovers who collect the same NFT as yourself, and also Players can be found to play games with.

3.3a) Multi-chain social interaction: application prospects

In the social 3.0 era of Web 3, will there be other changes in the communication, cooperation and social interaction between people?

1) DID, Decentalized Identity Decentralized identity identification: a person can be not only a financial master in the defi world, but also a game king in gamefi, or even the creator of NFT, and all these identities can be passed through an ID reflect. All your social attributes, work skills, and artistic taste can be discovered and recognized through DID.

Summarize

Summarize

Programmers always dream of changing the world. Satoshi Nakamoto did it with Bitcoin, and Vitalik did it with Ethereum. Can Jae kwon, who proposed the Cosmos network, also do it with Cosmos?

The Cosmos network, which was conceived in 2014, can be said to be Right tech wrong time. The untimely Cosmos has returned to the spotlight after 8 years. Will it be right tech right time this time?

Technology is like this, maybe a certain inflection point has appeared, and then entered an explosive growth. This inflection point may happen very soon, or it may not happen until a few years later. We cannot judge when it will happen, just as we cannot imagine what kind of earth-shaking changes it will bring. But when we are in it, we may find that, looking back, some things are destined to happen.

Cosmos
DeFi
Web3.0
Welcome to Join Odaily Official Community