laitimes

Go language, CosmosSDK and custom blockchain network

author:bithomeAI

The vision depicted by Cosmos is to become the "Internet of Blockchains". (cosmosSDK modularly builds its own blockchain network, github: https://github.com/cosmos/cosmos-sdk)

一、Cosmos 2.0特性

On September 27, 2022, the Cosmos White Paper 2.0 was officially released at the Cosmoverse Conference, marking the official entry of Cosmos into the 2.0 era. The Cosmos 2.0 upgrade has become the biggest event in the blockchain industry this year after the ETH2.0 Merge, and the new and innovative applications brought about by the Cosmos 2.0 upgrade have also sparked a lot of discussion in the blockchain industry.

1.链间账户(Interchain Accounts)

Interchain accounts allow users to seamlessly interact with any IBC-enabled Cosmos appchain directly from their Cosmos Hub account. At present, since each Cosmos application is deployed on an independent sovereign chain, each application cannot interact directly with each other, and if the transaction takes place on different sovereign chains, it will cause a lot of inconvenience to users. For example, when you want to swap some tokens on Osmosis, but your funds are on another Cosmos sovereign chain, you need to bridge them to Osmosis before initiating a token swap, during which the assets need to go through multiple transactions and cross-chain transfers. This undoubtedly increases the cost and time of transferring funds.

The application of inter-chain accounts solves all of the above problems, allowing users to complete the process of multiple transactions in a single click, which not only increases the efficiency of the user experience, but also saves users a large amount of transfer gas fees, and users can interact with Cosmos applications through inter-chain accounts as easily and quickly as they do with L1 protocols such as Ethereum.

2.链间安全(Interchain Security)

Interchain security is one of the most anticipated upgrades, and security is always a fundamental issue for applications created on top of the Cosmos-SDK, and not a big issue for large application chains with a large number of users, such as Terra before. However, small appchains have concerns about this, as there is a risk of attack if a newly launched application is secured by a token staker with a market cap of less than the TVL on the chain. As a result, inter-chain security allows these appchains to rent security from Cosmos Hub for a percentage of transaction fees, and these appchains will be able to receive the security provided by Cosmos Hub's validators.

The new version of the white paper 2.0 mentions several future application directions for interchain security:

  • Rollup settlement
  • IBC routing, IBC relay contract market
  • Multiverse, my interpretation is the consumer chain
  • Chain Name Service, ENS on Cosmos

3.Interchain Queries(链间检索)

If inter-chain accounts and inter-chain security solve the problem of asset transfer and security guarantee on the blockchain of various applications in Cosmos, then the introduction of inter-chain retrieval aims to solve the problem of information exchange between application chains, which will open up a new world of possibilities and make the creation of cross-chain smart contracts possible.

For example, through inter-chain retrieval, users will be able to borrow against collateral on one Cosmos chain against another chain, and they will be able to retrieve the price in time to complete the liquidation when facing liquidation, instead of having to bridge funds to the application chain where you want to borrow to complete the liquidation.

The combination of these two new features will enable complex transactions across multiple blockchains, greatly simplify the user experience of interacting across Cosmos applications, and integrate the unique features of each chain to unlock the potential of the entire Cosmos ecosystem (such as the default private transfer function of the Secret Network).

4.ATOM2.0

As the only native token of Cosmos, ATOM has always been considered a MEME coin in the 1.0 phase, without much presence, and because the issuance of tokens in the 1.0 phase is uncapped and lacks value capture, the inflation rate has remained high for a long time, which has greatly hindered the construction of the Cosmos ecosystem.

(1) Enhance the value capture of ATOM with inter-chain security

In the new version, developers can choose to let HUB bear the security, and the GAS fee is borne by ATOM, so that the larger the ecology, the greater the value of ATOM, and even if there are some projects that are particularly strong, they do not use HUB as a security guarantee, but like ERC20 projects, use their own tokens, then HUB You can still receive tokens in the form of rewards, which is also beneficial to ATOM;

(2) Enhance the composability of ATOM with the help of inter-chain accounts

The inter-chain account opens up the entire Cosmos ecosystem, enabling assets on different chains in the ecosystem to be traded directly, improving the efficiency of asset transfer, and facilitating the interaction between different assets on different sovereign chains and ATOM, and enhancing the composability of ATOM.

(3) The liquid staking function improves the liquidity of ATOM

Current ATOM holders can earn interest by staking their tokens to validators, but doing so involves locking the tokens at an address on the blockchain and requires guarantees that they cannot be sold for a period of time, and while some third-party applications currently offer a "liquid staking" model that allows users to trade their collateral assets through derivative tokens representing their shares, this is not convenient for users to operate, and the introduction of third-party programs also introduces uncontrollable risks, which is a problem The Cosmos 2.0 phase will be resolved, and Cosmos Hub will soon support liquid staking, thereby increasing the liquidity of ATOM and making ATOM the collateral of choice for the Cosmos ecosystem.

(4) Token incentives help DAO community governance

In addition to Cosmos using ATOM as the on-chain transaction fee payment currency, users who hold ATOM also have governance voting rights, and users can participate in the governance of Cosmos Hub, initiate proposals and vote on the future direction of the ecosystem. In addition, Cosmos will also apply token incentives to community management, through one-time subsidies to the community, or set up incentives such as developer funding flows, so that the community can better provide services or suggestions for the Cosmos ecosystem.

(5) Token holders get more opportunities for airdrops of new projects

By staking ATOM tokens, token holders can get the opportunity to airdrop new projects, according to Cosmos officials, there will be about 200 on-chain IBCs in 2022 alone, and in the future, as the Cosmos ecosystem becomes richer, more and more new project airdrops will inevitably emerge, which also provides ATOM holders with more opportunities for new project airdrops.

5. Cosmos development stage and philosophy

Since its inception, Cosmos has been working to solve the following problems:

  • Scalability: Quickly build custom chains, and provide the Cosmos SDK to enable developers to focus more on the implementation of the application layer by separating the network layer, consensus layer, and application layer. It also allows different shard chains to use different personalization implementations.
  • Cross-chain communication: Message transmission between different chains is realized through the Inter-Blockchain Communication Protocol (IBC).
  • Sovereignty & shared security: Developers can master the rules of the application chain by themselves, and at the same time link with the central network through IBC, and only need to trust the central network between different chains to achieve independent sovereignty and shared security.
  • Boost speed: Increase block confirmation speed through POS, which in turn increases TPS.

Ethan Buchman, the original founder of Cosmos, explained the philosophy and goals of Cosmos in an article on September 23, and divided the development of Cosmos into three phases - Initiation, Integration, and Illumination.

The first phase, called Initiation, began in the summer of 2016 with the release of the Cosmos White Paper 1.0, and the story of Cosmos unfolded, with the Cosmos: Distributed Ledger Network white paper envisioning Cosmos as a network of many independent blockchains (i.e., Zones) powered by Tendermint BFT, a PBFT-like consensus engine, starting with the first Zone Cosmos Hub, which can also be extended by connecting to other Zones, which can communicate with each other via Interchain Communication Protocol (IBC). The release of the Cosmos Whitepaper 1.0 was well received by the community and generated some initial funding for Jae Kwon and Ethan Buchman to build Cosmos.

September 27, 2022 The release of the Cosmos white paper 2.0 marks the end of the 1.0 phase of Cosmos development and the beginning of the 2.0 phase What evolved from a loose consortium to a thriving ecosystem also set the stage for the subsequent Cosmos 3.0 phase.

The Cosmos 3.0 stage is called: Illumination, Chinese translated as "bright", when and in what way it will come, we do not yet know, but through the innovation and surprises brought to us by the Cosmos 2.0 stage, we have reason to believe that Cosmos 3.0 is worth our expectations, and it will light up the entire blockchain world in the future.

6. Difference between Cosmos and Ethereum

The Cosmos development team believes that the public chain should be composed of a network layer (node network), a consensus layer (consensus formation), and an application layer (application & persistent ledger), and that the three layers of the network are blended together in Bitcoin, making it impossible for users to create applications on the Bitcoin network. Ethereum only provides the EVM as a platform for smart contracts, which has many problems such as scalability (all applications compete for limited resources), ease of use (due to the limitations of the EVM itself and programming languages, developers cannot efficiently complete application development and usercase coverage), limited sovereignty (the application layer does not have sovereignty), and many other problems that are difficult to improve. Compared to the Bitcoin and Ethereum networks, Cosmos is built with a more ideal network base layer, and its emergence is like the emergence of computers from the standalone era to the network age, with unlimited prospects and powerful narratives.

(1) Functional differences

Ethereum and the Cosmos blockchain, often compared by some crypto enthusiasts, are not competitors or alternatives to Ethereum in terms of their features, the two are not in the same dimension, Cosmos can provide a free blockchain development framework that allows developers on the network to launch their blockchains. This is something that Ethereum can't do at the moment. While Cosmos won't be an Ethereum competitor, some of the blockchain open frameworks that Cosmos offers for free can help Ethereum's competitors, a prime example being Binance Chain, which is built with the Cosmos SDK to provide users with faster transactions on its platform and cheaper fees than Ethereum.

(2) Differences in user experience

Ethereum is a general-purpose blockchain where developers build sidechains and use smart contracts to make changes to Ethereum's blockchain. The problem here is that these smart contracts are all generic and have very limited functionality, and many times projects have to combine a large number of basic contracts to achieve the functionality they want, which will increase the gas price and lead to slower transaction times, and the user experience will be very poor. In addition to this, these projects must compete with each other to include their transactions in Ethereum's next block. This means that having more items results in higher gas fees.

The Cosmos Network is an ecosystem designed to build their own blockchains for project owners, tailored to their needs, while also being able to transact with other blockchains connected to the ecosystem. This significantly reduces the gas cost for all connected blockchains and does not limit transaction throughput. So in terms of user experience, Cosmos has an advantage over Ethereum.

(3) Differences in the ecological field

Cosmos will allow all blockchains to interact with each other, forming a complete blockchain network, in which all public chains can communicate with each other, the transfer of assets between chains is more convenient, and it even allows different tokens to exist, which ensures the diversity of public chains in the Cosmos ecosystem, and also provides a steady stream of innovation for Cosmos. Compared to Cosmos, Ethereum is more of an island from which separate bridges need to be built to other blockchains, which are also like islands that lack connection to each other. The high cost and lack of security will in turn further limit the interaction between chains in the Ethereum ecosystem, which will not only increase the cost of cross-chain transfer, but also make it difficult to effectively guarantee the security of cross-chain assets. In terms of innovation and convenience, Cosmos' ecosystem is undoubtedly superior to Ethereum.

The emergence of Cosmos may pose a threat to Ethereum, but the vision of Cosmos is to become the "Internet of Blockchains", which does not conflict with Ethereum's goal of becoming a "blockchain world computer", and the two can work together to create a blockchain interconnected world that can host a billion users.

2. The development status of the Cosmos framework

The Cosmos framework has attracted many developers and projects with its unique interoperability and modular architecture, and it can be said that these features have opened up new horizons for blockchain technology.

Next, we will explore the major changes, major technology updates, and highlighted new projects within the Cosmos ecosystem in 2023.

Since there are multiple chains in the Cosmos ecosystem, each chain has its own address, even if the seed phrase is the same. Currently, a wallet service called Keplr is used to integrate and manage them, but new wallet apps need to be leveraged to take advantage of each new chain that emerges on Web3, which creates huge fatigue and barriers to entry for users.

The Cosmos ecosystem recognizes this problem and is working on projects to address it. In this context, Metamask has introduced full support for Snap, allowing custom features to be added on Metamask. Thanks to Metamask, it is now possible to create transactions on Cosmos-based chains, and the Leap wallet is one such service.

Leap Wallet (https://cosmos.leapwallet.io/portfolio/overview)

In other words, the technical groundwork has been laid to make it easier for users familiar with EVM-based chains to be attracted to the Cosmos ecosystem.

Unfortunately, the Cosmos SDK does not support virtual machines for smart contracts. As a result, several projects have emerged to develop virtual machines that are validated and used in other blockchain protocols or standalone virtual machines that are unique to the Cosmos ecosystem. Attempts have been made to integrate various virtual machines such as EVM, WasmVM, SolanaVM, MoveVM, etc. with the Cosmos SDK, and support for some is highly appreciated. It will be easier for dApp developers to join the Cosmos ecosystem if more commonly used virtual machines are supported.

Here are some of the most interesting and compelling projects coming out of the Cosmos ecosystem in 2023.

The hottest project in the Cosmos ecosystem in 2023 is undoubtedly Celestia. Celestia is a representative modular blockchain project that roughly divides the functions of the blockchain into four parts:

Among these features, Celestia focuses on data availability. This, combined with the term "L2", sparked a rollup boom in the Cosmos ecosystem. To this end, a framework called "Rollkit" was created and supported, which supports ABCI between Celestia and the Cosmos SDK.

Celestia Rollkit ( https://docs.celestia.org/developers/rollkit )

It replaces Cosmos' consensus engine, Tendermint (or rather, CometBFT), and allows Celestia and the Cosmos SDK to communicate directly. This allows for sovereign aggregation by aggregating transactions in a single block and leveraging Celestia's consensus engine and data availability.

Skip Protocol is a project with a vision of "sovereign transaction infrastructure for sovereign blockchains". It helps improve the user experience of sovereign blockchains and makes the order in which transactions are processed transparent to prevent malicious MEV and improve the network qualitatively.

Among the user experience improvements, the project aims to solve the problem of the Inter-Blockchain Communication (IBC) protocol. IBC is a protocol for exchanging assets between different chains within Cosmos. In order to transfer assets through IBC, a communication "channel" must be created, and each channel needs to provide a unique ID for each chain it is connected to. The diagram below shows the channel connecting Axelar and Terra2 and represents an example of sending ETH from Axelar to Terra2.

Skip API ( https://api-docs.skip.money/docs/ibc-routing-algorithm )

Assets that are passed through IBC to another chain will have a new denomination.

It should be noted here that even if the same asset is sent to the same chain, if the value of the channel, or rather the value of the path, is different, its denomination will be completely different. In other words, even if the assets in ETH are the same, they will be recognized as different assets in Terra2. This is especially true when assets are delivered through complex paths, so it can be difficult to know which assets were delivered.

Go language, CosmosSDK and custom blockchain network

To solve these problems, Skip proposes an optimal routing algorithm to deliver assets within the Cosmos ecosystem and provide a better user experience by determining the denomination of the asset.

The Skip protocol also provides a variety of APIs that can be used to develop blockchains based on the Cosmos SDK, such as multi-chain transaction tracking and the Block SDK. Skip also proposed to the community to incorporate Skip's features into the Cosmos SDK to contribute to the development of the ecosystem.

Six

Sei is positioned as a chain specializing in transactions, with the goal of becoming a fast Layer 1 rather than a Rollup, which is also a major trend in the development of blockchain in 2023. Sei focuses on improving the performance of the chain by leveraging various technologies.

Injective

Injective is committed to building a blockchain ecosystem specifically for financial applications. Injective has partnerships with Figment and Binance, and supports various dapps such as Helix and Hydro to join the Injective ecosystem.

dYdX

dYdX is considered to be the most successful DEX and has successfully migrated to Layer 1 using the Cosmos SDK.

dYdX strengthens governance through its own token.

Stride

Stride is a liquid staking protocol similar to Ethereum Lido. In the Cosmos ecosystem, liquid staking is inherently difficult because assets are spread across multiple chains. Stride aims to enable multi-chain liquid staking in the Cosmos ecosystem by leveraging ICA (Interchain Account), ICQ (Interchain Query), and ICS (Interchain Security).

Coreum

Coreum is a Layer1 blockchain for enterprises that supports Wasm-based smart contracts, RWA tokenization, NeoBanking applications, and more.

While development activity on the Cosmos network remained healthy overall, Q2 saw the highest number of smart contract deployments (2,226) and the highest growth rate (21.4%). The number of core developers is gradually increasing, which is also a sign of the active construction of ecological infrastructure.

Meanwhile, the number of smart contracts deployed in Q2 and Q3 last year was 2,226 and 1,777, respectively, up from 1,701 in Q4. While it is true that development activity has slowed compared to the previous two quarters, we believe the level of activity is still sustaining, given the decline at the end of the fourth quarter.

The most striking aspect of the Cosmos network activity was that development activity in Q2 and Q3 translated into growth across the ecosystem in Q4. As shown in the table, TVL in the Cosmos ecosystem continued to decline in Q3 but rose significantly in Q4.

The explosive growth of TVL in the Cosmos ecosystem in Q4 can be attributed to a combination of two factors. The first is the influx of liquidity across Layer 1 themes in mid-October. During the 2H period, a large amount of liquidity flowed into the Layer 1 ecosystem, and Solana, Cosmos, and Avalanche drove the overall TVL with explosive performance.

In addition, a developer-friendly infrastructure environment, including the Cosmos SDK, and a vast network of blockchain connections built on top of the IBC ecosystem, also bring practical utility to users. A closer look at the TVL trend reveals that this is not just a temporary upswing, but a continuous trend. Satisfaction with the maturity of the protocol is likely to drive Layer 1 liquidity, facilitate the growth of Cosmos and reduce user churn.

The number of active wallets also increased by nearly 55% to 2,280,335 in Q4 compared to the lowest performing Q3 (1,470,050), reflecting a vibrant ecosystem. This is driven by the interoperability of the Cosmos IBC ecosystem, which has led to an increase in on-chain activity, such as user participation on each protocol and the use of tokens through DeFi.

In addition, judging from the TVL trend of key protocols in the IBC ecosystem, the continued hype of protocols based on the Cosmos SDK in the second half of the year has also played a role in revitalizing the ecosystem. In fact, we can see a slight increase in the protocol's TVL. Unlike projects such as THORChain, which started to grow from the beginning of Q4, the Injective protocol has seen explosive growth in TVL from the end of Q4 to the present. We can interpret this as the sequential flow of liquidity and trading activity within the Cosmos IBC ecosystem.

Cosmos currently has a total of 180 active validators. The top 9 validators hold 40.89% of the staked $ATOM supply. There are currently 2.44B $ATOM staked on Cosmos, which is about 65% of the total supply.

2023 is a milestone year for the Cosmos ecosystem, witnessing the development and significant changes of several projects. We believe that these changes show that Cosmos is not just a field of blockchain technology, but is driving innovation across the blockchain ecosystem.

Celestia, Skip Protocol, and other notable projects demonstrate the diversity and flexibility of the Cosmos ecosystem and how it is constantly evolving. These projects pioneer new use cases for blockchain technology and help create a more efficient, user-friendly blockchain environment.

The growth and development of the Cosmos ecosystem enhances our excitement about the future of blockchain technology. They open the door to new opportunities for developers, users, and investors, and pave the way for continued innovation in the years to come. We expect this positive trend to continue in the Cosmos ecosystem in the coming years, and new technological challenges and opportunities will continue to emerge along the way.

3. Build a public chain through CosmosSDK

Cosmos takes a step further on the basis of Ethereum, providing scaffolding for building the blockchain in the form of CosmosSDK, providing a general development framework, and the Cosmos SDK module, which greatly simplifies the development of the blockchain, and can add customized functions for developers to achieve expansion.

1.3a) Construction of public chains

First of all, all applications that solve specific application scenarios need to be built on the underlying public chain, specifically, the application layer that has the greatest impact on application development is the application layer at the upper level of the public chain, and the network layer and consensus layer that are more biased towards the bottom layer of the public chain provide the underlying performance of the application operation, and the specific underlying design will not have more impact on the application itself as long as the performance is guaranteed.

However, if you want to reach mainstream adoption, you may need the entire public chain to serve the application separately. For example, Axie, a chain game that exploded in 21 years, chose to develop its own sidechain Ronin to process a large number of transactions. If we continue to rely on Ethereum, which carries other Defi, NFT and other trading activities, it will not only be unable to handle the business of Axie games, but will also lead to congestion on the Ethereum network. After all, Ethereum's TPS is only 10. Therefore, in the long run, a large number of applications are piled up on a main chain, and sharing resources can not only meet the needs of applications, but also drag down the entire network. A single public chain cannot be optimal for every application scenario, and projects in different tracks should choose to build on their own public chain ecology, and Cosmos provides a modular blockchain, so that developers can more efficiently build a chain that adapts to application scenarios

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, such as the speed of confirmation time must have a greater impact on Gamefi projects than Defi projects. Ideally, each application should have its own blockchain for future usage scenarios. However, the development of the bottom layer of the public chain is neither necessary nor a waste of resources, and the design scheme of the current location public chain has been 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

Let's take a 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., the data is stored in a block and then connected in order through the chain structure, combined with the technology of timestamps 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: a unified way of bookkeeping, so that the decentralized nodes 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 of the operation of the blockchain

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

6. Application layer: user-oriented products

1.3c)Tendermint共识机制

Tendermint is actually the name of the company that founder Jae Kwon founded before he created Cosmos, and Tendermint Core is the actual software used, which consists of two main components: Tendermint Core, which provides a consensus mechanism, a consensus engine, and ABCI, an interface that adapts to most programming languages.

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 as the consensus layer, and the contract and application layer are classified as the application layer. For developers, the lowest layer of the network and consensus layer is not the key to what they want to develop, but the development of the application layer, which is responsible for the business logic to provide application scenarios. Tendemint provides a common network layer and consensus layer on which developers can build their own application layers.

As a general-purpose engine, Tendermint Core can securely and consistently record transactions on the chain, including the network layer and the consensus layer, the network layer uses the Gossip protocol, the network protocol that imitates the epidemic propagation mode to spread information in the P2P node network, and the consensus layer uses BFT+POS, we can look at the specific algorithm.

In fact, everyone has encountered a common problem, 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. Blockchain allows nodes to join or leave at any time, and even if there is a failure, the nodes in the network can still work normally. This relies on rules that are made in advance, and this set of rules is the consensus mechanism.

Satoshi Nakamoto was the first to incorporate Byzantine Fault Tolerance (BFT) into the design of Bitcoin, and began to introduce the fault-tolerant mechanism of academia to distributed computing like blockchain, thinking about building a reliable system in an unreliable environment. Jae Kwon was the first to actually propose the application of BFT research to PoS blockchains and created Tendermint to implement his idea.

1. BFT Byzantine fault tolerance mechanism

The question of Byzantine generals was first raised in 1982 by Lamport, Shostak, and Pease, a group of Byzantine generals besieging a city from different positions and needing to decide whether to attack or retreat. However, generals in different positions can only communicate with each other through messengers, and if there are traitors among these generals, then the traitors can send different messages to different generals, such as sending fake messages to generals who are inclined to retreat that other generals also intend to retreat, disrupting everyone's decision.

The ability of a mechanism that allows loyal generals to reach consensus 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 nodes that fail or commit evil is F, as long as N > = 3F + 1, the network can still reach consensus and make unanimous decisions.

A system in which participants in a network cannot be sure whether someone is lying or whether a message has been modified, and even if these issues exist, participants can reach a consensus together to make a decision is said to have Byzantine Fault Tolerance (BFT).

2. POS Proof of Stake

BFT describes the rules that run in the network to reach consensus, and POS describes the way to participate in the network, that is, the mechanism of mining. Proof of Stake, as a mining mechanism, requires the participating nodes of the consensus, known as validators, to hold and stake the native token of the blockchain, that is, the Atom token of Cosmos, and convert the cost of hardware computing power of POW into the cost of holding tokens, expecting to receive fees and block rewards in return. The staked tokens are used as collateral to gain voting rights, ensuring that the node is not a fake account to launch a Sybil attack. In the process of participating in consensus, the validator's deposit is locked to avoid disinterested issues caused by multiple votes by the validator, otherwise the deposit will be confiscated.

3. Consensus mechanism

The process of obtaining consensus is mainly for validators to get 2/3 of the votes in multiple rounds of proposals, pre-voting, and pre-submissions, and after success, start submitting information to add new blocks, increase the "height" (in fact, the number) of the blockchain by 1, otherwise start the whole process again. The preparatory stage of only participating in the proposal, pre-voting, and pre-submission is called a non-validator node, or a light client, to ensure that all nodes in the network can listen to the message, and the validator who participates in the whole process from voting to block generation is also called a full node, and the validator who starts each round of voting process is also called a proposer to ensure that the responsibility is implemented, and the greater the power obtained according to the staked tokens, the greater the probability of being selected. In other words, the more you invest, the better your chances of getting a return.

Of course, not every round will be successful in producing blocks, and the whole process will be restarted if the proposer may be disconnected or delayed.

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

Of course, not every round will be successful in producing blocks, and the proposer may drop or the information may not meet the criteria, and the whole process will be restarted.

4. Performance

Satoshi Nakamoto consensus and through POW allow everyone to join and become miners to obtain the right to keep accounts through the competition of computing power, that is, to generate blocks. At the same time, in order to prevent too many nodes from reaching consensus and slowing down, the upper limit of tendermint's nodes is 100, and the results obtained are final, 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 be at risk of forking.

Validators with a cap of 100 Tendermint may not be decentralized enough to be staked, however, decentralization should be a means in the blockchain, not a goal in itself. As long as the cost of compromising the system is high enough, and there are targeted defense and punishment mechanisms, even if the validators of Tendermint are fixed, it will not prevent a stable and definite consensus.

As a consensus engine that provides the network layer and consensus layer, Tendermint Core is a consensus mechanism that supports BFT. This means that even if 1/3 of the nodes fail, including hacking and malicious attacks, Tendermint's network will still be able to gain consensus and work properly. This means that a network using the Tendermint consensus engine will be able to operate securely in most cases, which is a prerequisite for any application to start using it on a large scale, and that it will be fast, with a block time of about 1 second, ensuring that the same transactions are recorded on-chain in the same order

2) ABCI interface: the interface that liberates developers

In the Cosmos blockchain network, each blockchain is used by Tendermint as the underlying common 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 through ABCI, Application Blockchain Interface, and they can build applications directly on the final transaction provided by the consensus mechanism provided by tendermint.

1. ABCI: flexible invocation mode

ABCI, the full name of Application Blockchain Interface, as a socket protocol is a call 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.

The Bitcoin and Ethereum we see are integrated ideas when designing blockchain networks, and each technology stack, that is, the various levels of the blockchain we just talked about, is an interlinked and dependent program, which cannot be disassembled separately.

This overall architecture is prone to two problems when developing.

1) The code is difficult to use. For example, a stack of bitcoin contains a pending transaction pool mempool, account balance, user permissions, etc., if you want to separate the mempool, it will become very difficult, even if it is forked, it is difficult to maintain, it becomes a noodle-like code, and it is as tangled and chaotic as noodles 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 the compiler and upload it to the blockchain before it can be operated, resulting in developers only using the languages supported by the EVM compiler, namely Serpent and Solidity.

2. Type of function

There are three main ABCI connection application layers and Tenderint consensus layers, including:

1) CheckTx: Validate 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:查询应用层的状态

The ABCI protocol includes several different message types. Tendermint core creates 3 ABCIs to connect to the application layer:

In computer science, monolithic architectures are generally not considered a good practice. Cosmos has transformed the original blockchain architecture that needs to be built from the bottom to a modular and freely combinable structure. Just like assembling a computer, you can assemble a memory module, monitor, keyboard, and mouse into a computer that needs to be considered and added specific configurations to drive on the road. The configuration of the application layer also provides tools, and the Cosmos SDK, a framework that allows developers to customize the configuration for the application case, provides a new development paradigm.

1.3d) Cosmos SDK: Modular development method

The essence of blockchain is a state machine that can be replicated, a logical model that simplifies the causal relationship of things, and can update the state given a certain condition. For example, Bitcoin is a ledger that can be downloaded by everyone, and when 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 on-chain to modify the state of the ledger.

1) SDK module design

Through the modular design, the SDK provides common application functions, and each function can be run and combined independently. Manage. Each module can also be seen as a separate state machine, and developers can customize the state and how to change the state, and save it in Multistory in the form of KVStore for later use. At the same time, as an open-source software, developers can quickly iterate through project practice.

The SDK module is a simple and practical development tool that developers can provide for other developers, so that developers can create more applications with their hands and feet.

How it works

Through Multistore The mechanism to define and maintain the state of the application layer, dividing the state of the application layer into different modules, can be regarded as an independent state machine, the built-in underlying basepp has an ABCI interface in the CosmosSDK, which can directly call the Tendermint consensus mechanism suitable for all application types, and submit it to the mempool transaction pool after the verification of CheckTX after the verification of non-attack, and the transaction is packaged on the chain after the validator reaches a consensus and successfully produces a block, and the state is successfully modified through DeliverTx, that is, the transaction is successful。

After receiving the transaction in the form of bytes through the function of DeliverTx, it decodes and extracts the message, verifies the information related to the transaction, such as whether there is a signature, and then pushes it to the corresponding module for processing, and finally updates the status. The updated state is saved by the Multistore function in the SDK, and the information can also be slipped to map to different modules.

2) SDK module function

Functionality provided by existing modules

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

Bank module: division transfer transaction

Staking :代

Slashing模块:司惩罚策略的slashing

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

Supply module: generated by the company's new coins

Gov module: on-chain governance

Basically, the necessary features of the application layer are covered, and developers can use these wheels directly to develop their own cars.

compatibility

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

The IBC protocol and the SDK are run independently, and the use of the Cosmos SDK module does not require binding to the consensus mechanism of Tendermint, and developers can choose the underlying consensus protocol according to their own requirements, while the IBC module introduced later links different consensus algorithms under certain conditions, such as Bitcoin and Ethereum, the two major public chains.

Object-Capability Model支持对象模型

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

This logical control, called keeper, can be hidden behind the scenes, isolating different code, and ultimately improving the security of the system. For the architecture of the application, 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, the consensus layer is the network layer, and developers can choose the validators of the network layer to build their own communities and economic systems. If you use the default consensus layer, Tendermint Core, developers can choose their own validators across multiple cosmos blockchains. The public chain built based on the Cosmos SDK already has Binance Chain, Terra, Kava and other large public chains to provide services.

Josh, who developed the Keplr wallet, once concluded that using smart contracts is renting a house, and using CosmosSDK to develop is to build your own house.

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

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

IBC, the full name of Inter Blockchain Communication, unifies the standard of 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 principal researcher of Tendermint, IBC is the standardization of containers for transporting goods to achieve global economic trade.

1) Cross-chain protocol design

The functions and scenarios provided by a single public chain are limited, so cross-chain is needed to meet more needs, such as paying through Alipay after ordering takeout on Meituan. Cross-chain is essentially a way to transfer data securely and trustedly to another chain and achieve the desired effect.

Referring to the history of the Internet, ARPANET (Advanced Research Projects Agency Network) was the first network to realize remote communication between computers, but it can still only transmit information in a limited number of specified nodes. It wasn't until the TCP/IP protocol, or Internet Protocol Suite, the network transport protocol of the Internet Protcol Suite/IPS, that provided a standard mechanism for how information was communicated and received between different computers, that the Internet we use today was formed. In addition to 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

The IBC protocol serves as the foundation of cross-chain, on top of which true cross-chain interoperability can be achieved, including:

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

2.) Information cross-chain: Obtain information from other chains and use it, such as staking assets on the Ethereum chain and borrowing on Cosmos

The value of cross-chain is not only reflected in the value of the token, but also in the real Internet of blockchain, just like the Internet we use now

2. Safety

The fewer features there are, the less likely it is that there will be a security vulnerability that can be exploited. Moreover, IBC assumes that different chains do not trust each other, and the security of the IBC protocol comes from the finality of the Tendermint consensus, while the security of BFT and the verification function of light nodes discussed above can give sufficient security, and no other trustworthiness assumptions are introduced.

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 the user. Therefore, when a technology is adopted, it may not be the best technology to choose, but the technology with the most user base. Similar to the development of Internet technology, after TCP/IP network technology was proposed, there were also solutions with better performance, but none of them were adopted by the entire network. The same is true for blockchain, in addition to the research of technology, the technology that needs the needs of users can be accepted.

The IBC protocol only puts forward the minimum requirements for the application layer from a general point of view, which is conducive to the wide deployment of the IBC protocol, and the more blockchains join the IBC standard, the more likely it is that IBC will become a true cross-chain standard.

4. Compatibility

As a common standard, IBC needs to accommodate various types of blockchains that are not trusting each other. Ensuring that the result of the blockchain as a state machine is deterministic, i.e., irrevocable, is the only way to ensure the correct execution of the communication. This means that blockchains must have a consensus mechanism that provides finality to be compatible, which is not currently supported by POW's Bitcoin and Ethereum, but cross-chain can also be achieved through the Gravity Bridge introduced below.

2) Cross-chain protocol content

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

In the IBC protocol, the IP address of the positioning computer is the channel ID, the port of the positioning application is the port ID, and the synchronization information of the client constitutes a standardized way of communicating information. The concise protocol reduces the burden of cross-chain communication on the chain itself, and does not overly restrict the applications involved in cross-chain communication, making it more flexible.

Port ID

Each modular application has a specific port, called a Port ID

Channel 通道

First of all, each module needs to propose a channel that uses the IBC communication protocol, and multiple channels can be established to avoid overloading the information of each channel. When initializing a channel, it is also possible to reject the channel if it encounters an error return.

At the same time, the channel can ensure the orderliness of the transaction, and theoretically can also support the disordered channel to facilitate the verification of validity.

Port

Each module can be bound to any number of ports, and different port IDs can be used when establishing channels with other modules, which can adapt to the information of different application scenarios.

Light client

Light clients need to synchronize each other's block header information, track each other's validator collection in real time to verify the validity and legitimacy of transactions, and support homogeneous blockchains built using CosmosSDK

Handshake 握手连接

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

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

2) After Realy receives the request from OpenInit, the request to construct OpenTry is sent to the B chain.

3) After receiving the OpenTry request, chain B agrees and confirms that the OpenACK packet will be generated, and the Relayer will send it to chain A in the same way.

4) Chain A uses OpenACK packets to determine whether the handshake is successful, and if it is successful, it sends OpenConfirm and returns the packet containing the information to chain B to successfully transmit the information, otherwise the handshake fails

Packet packets

It defines the necessary information for cross-chain communication, including the channelID, portID, sequence sequence of the sender and receiver, as well as the timeout mechanism of TimeoutHeight and TimeoutTimestamp. Transactions are guaranteed to be completed before a certain time, otherwise they can be returned, preventing funds from being frozen for a long time.

Cross-chain transactions

If a user needs to transfer 100 ATOM from Chain A to Chain B, then the transaction process is

1) Verify that the light client verifies whether the asset is legal and valid

2) The A-chain sends proof that the ATOM has been locked

3) B-chain verifies the proof of A-chain

4) Chain B creates a voucher voucher of 100 AMT, which can be circulated and used until it is returned to Chain A to unlock the original 100 ATOM

In reality, a cross-chain transaction is simply an exchange of ownership of assets on both chains, with BTC still on the Bitcoin blockchain and ETH on the Ethereum blockchain. BTC loses value when it leaves the Bitcoin blockchain, and transactions actually transfer BTC as the value of an asset, and in the Cosmos model, the asset itself can be transferred on-chain.

1.303) Vs. Polkadot X KIND

XCMP protocol

XCMP, the full name of Cross-Chain Message Passing, cross-chain messaging protocol, parachain inserted into the relay chain of Polkadot becomes one of the chains in the multi-chain network, and other parachains connected to the same relay chain through this protocol communicate across chains.

How does XCMP work

The nodes that collect transactions on the parachain and submit them to candidate blocks are called collators, and the nodes that complete transactions in candidate blocks provided by the validators on the relay chain are called validators, and collators can send and receive messages from other parachains through the XCMP protocol.

If a parachain, Chain A, needs to send a message to another Chain B, then:

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

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

2. When the collator of chain B transmits a message through the network of the Gossip mechanism, it will find this message and put it in the input queue, and this message will be stored in the validators of chain A and chain B to ensure that it is valid and legal

3. The collator of Chain B submits the message to the validator of the relay chain, and after the validator confirms, the information is put 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, which means that cross-chain interoperability of assets and information can be supported, such as cross-chain calls to the cross-chain of contracts.

However, according to the current multi-chain ecology, a large number of cross-chain transactions can be expected, and every time you use Polkadot's XCMP cross-chain, you need to stake 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 necessary to wait for the actual effect to be seen after it is launched

Polkadot's XCMP protocol maintains global security through the relay chain, while the concise Cosmos IBC protocol is designed to reduce the cost of cross-chain, and the IBC protocol is more like the WTO's global trade agreement, where any country can freely establish multilateral trade agreements and open global trade.

The Cosmo team likes to compare the IBC protocol to a container standard, where standardized containers can be traded at any port in the world, while Cosmos' IBC protocol standardizes cross-chain information, so that the blockchain in Cosmos' network can also communicate and trade. And in this economically integrated network, the Cosmos Hub is the hub of this network.

1.3f)Cosmos Hub:价值枢纽

Cosmos' network uses a hub-and-spoke model, with the Hub acting as the central hub within the network and connecting to other blockchains known as Zones. The zone can be connected to the hub and record the status of each public chain as a zone, and when exchanging information, the hub and the two sides of the interaction will leave a record in the three independent blockchains.

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

1) Hub: Transportation hub

The IBC protocol allows each public chain to be connected to each other, but this approach is not scalable. If there are 10 chains in the network, each of which is interconnected with other chains, there will be 45 links, and if there are 100 chains, the two-by-two chain will produce 4950 links. Clearly, this practice is not sustainable.

To put it another way, if you connect all the chains in series, then you only need 9 links for 10 chains, and 99 links for 100 chains. While the level of complexity has decreased significantly, the risk of trust has increased. When A is linked to B and B is linked to C, then if you go from chain A to chain C, you must trust both chain A and chain B to ensure the security of the assets received by chain C, which is very complex and prone to security risks.

We can also find solutions to the same problems in the real world, such as flight planning. Theoretically, you can fly from any airport and get to your destination, but in terms of cost, benefit, and benefit, you will eventually see major hub airports emerge as transit points. The Cosmos Hub is the hub of the network.

How it works

Cosomos Hub adopts a hub-and-spoke model, where each blockchain communicates directly with the Hub as a partition zone, and the Hub will synchronously 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, which means that the Hub records the balance and transaction records of each blockchain as a ledger, avoiding the problem of double spending. When Zone 1 wants to transfer money across chains to Zone 2, Zone 1 sends the transfer message to the Hub, and the Hub will prove to Zone 2 that the transfer message is correct, and Zone 2 verifies that the message is legitimate through the block header stored on the Hub.

Upgradable

When a new version of the network emerges or a configuration update is required, all validators need to be transferred to the upgraded blockchain at the same time, which can lead to a hard fork in other blockchain networks. In the blockchain of the Cosmos network, that is, partitions, users of existing partitions only need to be transferred to the new partition by connecting to the Hub to successfully upgrade.

The Hub + Zone model allows Cosmos to securely scale the network, allowing even 100 or more blockchains to interoperate.

2) Hub: Value Hub

The security of the blockchain

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, security is provided by miners providing hash power, and only 51% of the computing power of the entire network can be used to launch attacks to tamper with data, also known as 51% attacks. 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 high.

However, if a small chain has less computing power, then the possibility of attack will be high, and the network will be very insecure. In the same way, networks that use PoS consensus also face the same problem, but the security guarantee has changed from computing power to collateral for stake. In a PoS network, validators gain the right to validate the output block by staking a pledge while providing security. The more assets you stake, the more secure you are. If the scale of a chain is small and the funds pledged by the node are small, then the cost of the node to do evil and the cost of the attacker will also be reduced, and the security of the network will be greatly reduced.

The need for cross-chain security

As mentioned above, Tendermint, as a BFT-based POS consensus mechanism, requires 2/3 of the validators of the total pledged assets on the chain to reach a consensus, in other words, if the attacker wants to launch an attack, the cost of the attacker is 2/3 of the total staked assets on the chain. For example, if a validator on a chain stakes a total of $10 million, if 50 million funds are gathered on the chain, then the rationally thinking validator will choose to steal 50 million funds, and only need a minimum of 7 million dollars to get 50 million - 7 million confiscated = 43 million returns.

The practice of providing security increases the cost of doing evil**,** and there are two ways to do it

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

2) Allow chains with more staked assets, such as Hubs, to allocate assets to other chains with fewer staked assets to provide security.

**Each chain offers different use cases and is limited in the amount of TVL that can be captured. But for the interoperable Cosmos ecosystem, ensuring the security of each partition is the only way to ensure the security of the entire network,** so it makes sense for the entire network to provide the cost of pin by allocating capital to chains with less staked funds.

The partitioned chain can add the Hub's pledged assets on the basis of the native token of its own chain, and the node's evil cost will change from the original chain assets to the sum of the original chain assets and the Hub's assets.

The value of cross-chain security

The main value that cross-chain security, which will go live in February 2022, brings to Cosmos:

1) Guarantee the Hub's minimalism: Streamlined features come with increased security, as there are fewer security vulnerabilities that could be exposed. In addition, the simple function can serve the target users more accurately, avoiding serving users with different needs at the same time. For example, Defi users like features that don't necessarily make Gamefi users happy. At the same time, the modular design can disassemble the modules that provide a certain application function into a blockchain that runs independently and uses the same set of validators, so that even if it is attacked, the hub can operate normally and avoid downtime

2) Lower the threshold for developing and operating public chains: The first thing to ensure in public chains is security. When the security of assets and data can be guaranteed, users will begin 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: **Through the sharing of validators, the Hub binds the partitioned blockchain in Cosmos to the Hub, turning it into a community of interests. **The barrel principle is also applicable to the network of Cosmos that links various partitions, the network security of Cosmos depends on the weakest partition, and the cross-chain security ensures that the weakest partition can also lease the security of the Hub, in fact, the security of the hub completes the weaker blocks, ensuring the security of the entire network. Regardless of the economic value that the partition use case can provide, as a participant in the Cosmos network will actually be the beneficiary of the entire network security.

It is worth mentioning that the function of acting as a central ledger in the Cosmuo Hub network may affect decentralization, but everyone can run their own hub, and different partitions can also form a LAN and run independent hubs, not necessarily through the official cosmos hub.

The network does not require permissions, and anyone can create a hub blockchain or partition, and have the right to reject the connection of other blockchains to form their own local area network. At the same time, the local area networks of the partitions can also communicate with each other to ensure that the internal communication is not affected by the external network. The Cosmos network can be a testing ground for developers and users alike to experiment with different social and economic shapes.

2) Atom: Value Capture

The native token of Cosmos Hub is Atom, and to become a validator, you need to stake Atom on the Hub as a margin to obtain the right to mine, and receive fees and transaction income. Validators on the Hub can not only earn rewards for Hub blocks, but also apply to harvest additional rewards for other partitions. Once a node is evil, the Hub will confiscate the Atom through the Slashing penalty mechanism

Provide a way to provide cross-chain security

The partitioned chain can request validation from the Hub at any time, providing the expected transaction fee as a corresponding reward, and each validator on the Hub can apply to validate the partitioned chain and stake Atom to start working on the Hub. Validators can run multiple nodes at the same time, one responsible for validating transactions for the Hub, and the remaining nodes can produce blocks for other partitions.

Economic model

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

With an initial supply of 200 million Atoms, Atom adopts an inflation model, with additional issuance of 7% in the first year for rewards such as nodes, and then the annual issuance ratio will fluctuate from year to year: if the total pledged Atom is less than 2/3 of the total supply, the inflation rate will rise to 20%, and if the total stake is greater than 2/3 of the total supply, the inflation rate will decrease to at least 7%.

At present, the total circulating supply is 286 million $ATOM, with a total market capitalization of US$8.4 billion, and a maximum market capitalization of US$11.9 billion was recorded on January 21. The value of Atom is a large part of the cost of node cheating (staking amount * token value), and the appreciation of Atom provides a certain guarantee for Cosmos's network security by increasing the cost of evil.

As more and more blockchains join the Cosmos network, different information, assets, and transactions are traded through the Cosmos Hub, and Atom is the currency of the Hub as a transportation hub and a value hub, and it is the way to capture the growing transaction size on the Hub.

Governance mechanisms

Blockchain network, as a software iteration, upgrade is inevitable, and how to make changes and applications requires a governance mechanism. The Cosmos team's Hub Governance Mechanism in Cosmos Process explains the independent governance mechanism:

The real world is a mix of various economic systems, companies, governments, countries, and each participant may have a different purpose, and the same is true for blockchain. Differences over philosophical or political ideas have led to Bitcoin forks, and the Ethereum community has sometimes struggled to reach a consensus, and in some cases even affected Ethereum's upgrades.

Cosmos believes that there is no one-size-fits-all set of 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 governance proposals for the Hub or Zone, which can be software updates, block fees, or even security policies and other mechanisms to change, and Zone or Hub validators and introductors can vote on the proposals, providing users and developers with the freedom to experiment without constraints.

1.3g) Heterogeneous chain communication: compatible with Ethereum

In addition to the homogeneous public chain using CosmosSDK, other heterogeneous public chains can also be connected to the Cosmos ecosystem, and among the existing blockchains, Cosmos is the first to communicate with Ethereum

Obviously, as the ecosystem with the largest number of developers, Ethereum's compatibility can allow more developers to join the Cosmos ecosystem and attract more users.

Classification of Blockchain:

1. Deterministic chains: The state on the blockchain is deterministic, that is, the transaction is irreversible, such as a blockchain based on Tendermint consensus. At any given moment, each block starting from the genesis block can be replicated.

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

As mentioned earlier, the premise of the IBC cross-chain protocol is a definite transaction, after all, you can only trade with someone else after the transaction has been confirmed on your own chain. So when connecting to other non-deterministic blockchains, such as Ethereum, Cosmos provides Gravity Bridge to bridge Ethereum's native token, plus EVMOS to support the operation of Ethereum's smart contracts.

1.3g1)Gravity Bridge:Cosmos与以太坊的跨链桥

A cross-chain bridge is a way to allow the transfer of assets and data between blockchains with different consensus mechanisms, token standards, and governance models, keeping assets on the original chain, and releasing assets on the destination chain, and defining the conditions for custody and unlocking assets. Gravity Bridge, successfully deployed on January 19, 2022, bridges Ethereum and Cosmos, supporting the transfer of assets between chains based on the Cosmos SDK and Ethereum through the IBC protocol.

As a member of the Cosmos developer ecosystem, the Althea team is developing a permissionless cross-chain bridge, Gravity Bridge, based on the Cosmos whitepaper, Peg Zone, a proxy bridge that connects Cosmos and other blockchains that do not have finality. 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 ecosystem, and has an independent token to incentivize users and validators. Gravity Bridge will have its own independent validator responsible for the maintenance and security of the network, and through the shared security of Cosmos, validators who hold Atom can also provide services for Gravity Bridge block generation.

In terms of the design of cross-chain bridges, they can be divided into:

1) Trust-based bridge, introducing trusted checkers to execute: For example, Avalanche Bride's cross-chain bridge requires trusted witnesses to use MPC technology, and Secure Multiple-Party Computation is a multi-party security calculation in privacy computing to ensure the validity and legitimacy of transactions, turning cross-chain transactions into an ordinary on-chain transaction process.

2) Trustless bridge: Gravity Bridge first locks the assets to be transferred on the original chain, and after verifying the validity of the assets, the assets are mapped 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 a DAO, a decentralized organization, and the DAO will hold half of the tokens for airdrops, ecological development, and liquidity mining in the future

1.3g2) EVMOS: Cosmos' EVM hub

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

EVMO: Ethereum Hub

As an EVM-compatible blockchain, Evmos can be used as a hub to connect Ethereum chains for specific application scenarios in the Cosmos ecosystem, such as chains that support Defi decentralized finance, or chains that support NFTs, so that each application scenario can get the greatest support in an independent blockchain.

Both EVMO and IBC will support Ethereum's token model, ERC20, which means that other non-EVM-compatible chains that communicate through IBC within the Cosmos ecosystem can also interoperate with the Ethereum ecosystem. In other words, the Cosmos ecosystem and the Ethereum ecosystem can be interoperable

In addition, the upgrade of the Cosmos SDK, which will be upgraded this year, will allow Evmos-compatible chains to obtain cross-chain security, and EVMOS will be able to provide security for other EVM-compatible partition chains as a hub.

Economic model: community shared value

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

  • 质押奖励(验证者 + 委托者):40%
  • Team Ownership: 25%
  • Rewards: 25%
  • Community Prize Pool: 10%

At the same time, it also rewards behaviors that generate value in the ecosystem, including:

  • User fee rebate
  • Liquidity Mining Rewards
  • Smart contract revenue sharing
  • IBC Repeater Rebates

2.55: Cosmos vs Polkadot vs

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

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

Various merchants settle in, bringing various types of traffic and users, and ultimately leaving behind a thriving interconnected blockchain ecosystem. There may be a better solution for technology, but the one that will eventually be adopted must be the one that meets the actual needs.

If you just hope that one blockchain can meet all the needs or technical scenarios, then there is a high probability that this hope will be disappointed. In fact, there is not necessarily only one winner in a multi-chain network, and Polkadot and Avalanche can also be used as a partition ecology of the Cosmos ecosystem, giving monthly developers and users more choices. However, COSMOS is still a relatively young attempt, and it is still a framework protocol that runs on light nodes, more like the HTTP communication protocol of the network, and has not yet been tested by network attacks or user influx. Perhaps given enough time, Cosmos is following its own roadmap to realize his vision step by step.

3. The inevitability of multi-chain: the premise of Web 3.0

A single public chain cannot support large-scale applications and mainstream users. Only with enough public chains and large enough application scenarios can we truly provide a decentralized and user-sovereign Web3.0

3.1) Multi-chain world: infinitely scalable modular blockchain

The traffic carried by the public chain is limited, and it is unrealistic to implement all application scenarios on one public chain. When the mainstream crowd adopts blockchain as the underlying technology, we may need different chains to design for different application scenarios, and modular blockchains make it easy to build blockchains

3.1a) Blockchain Design: Impossible Triangle

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

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

2) Scalability: What is the data throughput, which is mainly measured by the number of transactions per second in TPS and Transaction Per Second.

3) Security: Whether it can be lower than cyber attacks, including Sybil attacks, DOS, etc

All public chains are designed to try to achieve these three goals on a main chain at the same time, and they can only go to two of these three, such as public chains such as Ethereum before modularization, which can only sacrifice scalability while ensuring decentralization and security. And most of the blockchain design is designed in an integrated way, that is, a monolithic blockchain, which is difficult to provide a certain performance without affecting other functions, until the modular blockchain design that can be disassembled and composed.

The modular design frees the blockchain from this impossible triangle, allowing different modules to be responsible for different goals, and accomplishing goals by combining modules, rather than requiring one module to complete all goals. When the blockchain is composable and scalable, more and more blockchains can provide more application scenarios and support more and more people to use the blockchain, and the underlying blockchain technology may support the future Web 3.0

3.1b) Blockchain design: specialization

Whether it's decentralization, security, or scalability, these features 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 an agreement, 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 a confirmation of the transaction.

2. Data availability: When the node completes the consensus and gets the result, there is enough space on the chain to save it and make it available to everyone, which can be understood as the liquidation of the transaction.

3. Execution: Complete the required functions and put new results on the chain, the speed of execution determines whether the blockchain can scale to support more transactions. It can be understood as the settlement of the transaction.

While most blockchains put the three functions on the same chain for execution, Ethereum has begun to explore Layer 2, that is, adding a separate settlement layer while retaining Ethereum's consensus and smart contract layer. This is actually the division of labor design of the blockchain.

As early as the 18th century, Adam Smith, the father of economics, proposed that the basis of the modern economy is the division of labor, and the same applies to blockchain. The modular design splits the blockchain into different components, each of which can be optimized and then combined into a blockchain. Since then, blockchain design has entered the era of modularity, and building blockchain can also be like building blocks, and we may usher in exponential efficiency growth.

3.2) Multi-chain Defi: A complete financial system

The successive outbreaks of DeFi Summer in 2020 and NFT Summer in 2021 have brought a large amount of capital to the crypto ecology rapidly, and the leading public chain Ethereum cannot carry the rapid inflow of large funds, resulting in a large amount of Ethereum traffic overflow, bringing some outstanding performance of public chains, such as Avalanche and Solana, but from the data performance, Ethereum still occupies an absolute dominant position.

There is another major premise for the composability of finance to be completed, that is, cross-chain information exchange. At present, each public chain determines its price according to the assets and information of its own ecological chain, such as data silos. Although there are oracles that can provide market prices, the current market and technology are not yet mature. On-chain crises abound, and security incidents almost never stop.

3.2a) Divided Battles: Waste of Liquidity

However, for the financial market, the bottom of asset pricing is liquidity, and the premise of liquidity is information symmetry. The flow of information is required before the flow of assets, and the effectiveness of the market is based on the extent to which the market price can respond to the information that affects the market. Obviously, there is still a price bias in the lack of effective communication channels for market information on style-based blockchains.

Although there are a large number of tools and robots on the chain that can find cross-chain price asymmetric arbitrage and parity spreads, these are only short-term arbitrages based on profits, and do not really let assets flow between different chains.

The ecology of multiple chains leads to the fragmentation of liquidity, and each chain has precipitated a certain amount of traffic and assets on the chain. However, the lack of communication channels between different public chains makes these assets uncirculating. The same asset becomes a non-tradable asset due to the mapping method of different chains, or an asset with too high transaction costs, and too high transaction friction causes a waste of liquidity.

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

Blockchain technology is reshaping a new generation of financial infrastructure, from exchanges that provide liquidity and lending markets for capital, to interest rate hedging, options, futures markets, etc., which provide risk management tools, are just one piece of the puzzle in the financial system. A complete financial market is a complete puzzle, and a financial system is formed when assets can freely circulate from the lending market, to the money market, or to the higher-risk capital market. And these channels of circulation, and cosmos provides a channel for the circulation of the financial network through the network built by the IBC protocol and the bridge.

3.2c) Multi-chain Defi: Application prospects

When assets can flow between different chains, we may be able to discover new use cases:

1) Cross-chain lending: Lending is the lowest requirement in the financial system, providing traders with liquidity to participate in the various investment and income opportunities provided by the financial system, regardless of the chain or the standard token. Current users can stake ETH on Ethereum, contact Atom on Cosmos, DEX on Gravity, decentralized exchanges, and obtain fixed or even higher investment returns, greatly increasing liquidity on different chains and opening up new trading opportunities.

2) Credit score: When users leave partial records on different chains, such as lending on Ethereum and deposits on Cosmos, then the behavior on different chains is only a part of the records that make up the user's credit. When all the lending information and transaction information can be summarized and analyzed, it can help different financial institutions to provide different solutions for users with different risk appetite, financial strength and trading strategies

3.3) Multi-chain socialization: unified identity

In real life, we work in a company, take out a loan in a bank, visit an exhibition in a gallery, and we may have different identities. In Web 2, each of us has a WeChat account, Alipay account, and Douyin account, but these are all independent accounts, and you need to remember these account information, and your behavior on these apps cannot be displayed on other platforms. For example, your friends on WeChat may not necessarily find out that you are a funny vlogger on Douyin.

In a multi-chain world, these behaviors can be recorded and displayed on-chain, and these data can include financial assets, transaction behaviors, and participation activities. Different from the fragmented, scattered, and fragmented data storage in traditional society, you can see your identity, your interests, and your experience on the chain, and you can find art lovers who have the same NFT as yourself, and you can also find players who play games together.

3.3a) Multi-chain social: application prospects

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

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

2) DAO, Decentralized Autonomous Organization: The decentralized governance of DAO allows people to truly participate in the formation, governance, and production of the community, and the process is transparent, giving community members the right to participate. The members are both the users of the community's products and the team that shapes the community, which attracts more people who want to participate.

summary

Programmers always dream of changing the world, Satoshi Nakamoto did it with Bitcoin, vitalik did it with Ethereum, and Jae Kwon who proposed the Cosmos network can also do it with cosmos?

The Cosmos network, which was conceived in 2014, can be said to be the right tech wrong time, and the untimely Cosmos is back in the spotlight after 8 years, will it be the right tech right time this time?

Technology is like that, maybe there is an inflection point, and then it enters an explosive growth. This inflection point can happen very quickly, or it may happen years later, and we can't tell when it will happen, just as we can't imagine what kind of drastic change it will bring. But when we are in the midst of it, we may find that in retrospect, some things were destined to happen.

Read on