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
What are the characteristics of the cross-chain duo Polkadot and Cosmos?
Polkadot生态研究院
特邀专栏作者
2022-04-18 11:01
This article is about 4845 words, reading the full article takes about 7 minutes
With the advent of the multi-chain era, cross-chain technology has become a rigid need in the blockchain field.

Polkadot Knowledge GraphPolkadot Knowledge Graph

"It is our entry-level article on Polkadot from zero to one. We try to start from the most basic part of Polkadot and provide you with a comprehensive understanding of Polkadot. Challenges, but we hope that through such efforts, everyone can correctly understand Polkadot, and people who don’t know Polkadot can easily and quickly grasp Polkadot-related knowledge. Today is the 42nd issue of this column. Let’s take a look at the cross-chain competition What are the similarities and differences between Polkadot and Cosmos, the two giants of Dow?

With the development of the blockchain industry, the future of Wanlian is gradually widely recognized, so cross-chain technology has become an urgently needed solution for the vigorous development of blockchain.

Cosmos, which is also the king of cross-chains with Polkadot, is known as the Internet of blockchains.Cosmos is developed based on Tendermint, featuring high performance, consistency, and Byzantine fault tolerance.

, Cosmos Hub (the trust center for cross-chain messages) realizes the cross-chain exchange of assets and data by establishing an IBC (inter-blockchain communication protocol) connection with compatible chains.

At the beginning of 2022, Cosmos, as a representative of the cross-chain track, has attracted a lot of attention. After the opening of the parallel chain slot Auction on Polkadot’s main network, it is also constantly exploring its own ecology. So what are the differences between Polkadot and Cosmos?

Both protocols are based on the premise that in the future there will be multiple blockchains that need to interoperate, rather than a single blockchain that exists in isolation.

Model

Model

Polkadot uses a sharding model where each shard in the protocol has an abstract state transition function (STF). Polkadot uses WebAssembly (Wasm) as a "meta-protocol".

As long as the validators on Polkadot can execute in the Wasm environment, the STF of the shards can be abstracted.Polkadot's shards are called "parachains".

Every time a parachain wants to make a state transition, it submits a block (a batch of state transitions) along with a proof of state that Polkadot validators can independently verify

When these blocks are finalized by Polkadot's relay chain, which is the main chain of the system, these blocks will be finalized as parachains.

Therefore, all parachains share state with the entire system, which means that a chain reorganization of a single parachain will require a reorganization of all parachains and the relay chain.Cosmos uses a bridge-hub model connecting Tendermint chains. The system can have multiple Hubs (mainly "Cosmos Hubs"), but each Hub is connected to a set of external chains, called "Zones".

Messages and tokens are sent between Zones through the Hub. The protocol used is called Inter-Blockchain Communication (IBC). Since the state is not shared between Zones, the reorganization of a Zone will not reorganize other Zones, which means Every message is bound by the recipient's trust in the sender's security.

architecture

architecture

Polkadot

Polkadot has a relay chain as the main chain of the system. All validators in Polkadot are on the relay chain.

Parachains have collators who build parachain blocks and make proposals for validators. Collectors do not have any security-related responsibilities and thus do not require a strong incentive system

Collators can submit a parachain block for the relay chain block every 6 seconds. After a parachain commits a block, validators perform a series of availability and validity checks before committing it to the final chain.

Parachain slots are limited, so parachain candidates participate in the auction to reserve a slot for up to 2 years.

Polkadot also has parathreads for chains that do not have funds for parachain slots or that need to execute with 6-second block times. Parallel threads are executed in a pay-as-you-go way, paying to execute blocks only when needed.

Cosmos

In order to interact with chains that want to use their own finalization process (such as Bitcoin), Polkadot has bridging parachains that provide two-way compatibility.

Cosmos has a main chain called "Hub", which connects to other blockchains called "Zones". Cosmos can have multiple Hubs, but this overview will consider one Hub.Each Zone must maintain its own state and thus have its own community of validators

. When a zone wants to communicate with another zone, it sends packets over IBC. The Hub maintains a multi-token ledger of token balances (non-transmitted messages are forwarded, but their state is not stored in the Hub).

Zone uses a light client to monitor the status of the Hub, but the Hub does not track the status of each Zone.

Cosmos can also interact with external chains through "peg zones", which are similar to bridged parachains.

consensus

consensus

Polkadot uses a hybrid consensus protocol, which consists of two sub-protocols: BABE and GRANDPA, collectively referred to as "Fast Forward"

BABE (Blind Assignment for Blockchain Extension) uses a Verifiable Random Function (VRF) to assign slots to validators, and uses a back-off round-robin pattern to guarantee that each slot has an author.

GRANDPA (GHOST-based Recursive Ancestor Deriving Prefix Agreement) votes on the chain rather than on individual blocks. BABE can author block candidates together to extend the final chain, while GRANDPA can complete them in batches (up to millions of blocks at a time).This isolation of tasks provides several benefits.

BABE has linear complexity, easily scales to thousands of block producers and has low network overhead. GRANDPA has quadratic complexity, but it can be reduced by a factor of latency (i.e. how many blocks are done in one batch).

Secondly,Secondly,

Having the ability to extend the chain with unfinished blocks allows other validators to perform extensive availability and validity checks to ensure that no invalid state transitions make it to the finalized chain

Block production and finalization are on the same path of the algorithm, meaning it produces and finalizes one block at a time. Because it is a PBFT-based algorithm (like GRANDPA), it has quadratic transfer complexity, but only finalizes one block at a time.

Pledge mechanism

Pledge mechanism

Polkadot uses Nominated Proof-of-Stake (NPoS) to select validators using the sequential Phragmén algorithm.

The size of the validator set is set by governance (1000 validators are planned), and stakers who do not want to run the validator infrastructure can nominate up to 16 validators. Phragmén's algorithm chooses the optimal allocation of stakes, where optimality is based on having the most even set of stakes.

All validators in Polkadot have the same weight in the consensus protocol

That is to say, to get more than 2/3 of support, more than 2/3 of validators must commit to it, not 2/3 of the stake.This incentivizes nominating validators with lower stakes as they will receive higher stake rewards

picture

picture

The Cosmos Hub uses Bonded Proof of Stake (a variation of Delegated PoS) to elect validators. Stakers must bind funds and submit a delegation transaction with the amount of tokens to delegate for each validator they wish to delegate to. The Cosmos Hub plans to support up to 300 validators.In Cosmos, both consensus voting and rewards are stake-based.

In the case of consensus voting, more than 2/3 of the stake must commit, not 2/3 of the validators. Likewise, validators who hold 10% of the total stake will receive a 10% reward

Finally, in Cosmos, if a staker does not vote in a governance referendum, validators will assume their voting power. Because of this, many validators in Cosmos are commission-free in order to gain more control over the protocol.

In Polkadot, governance and staking are completely disconnected; nominating a validator does not assign any governance votes to the validator.

messaging

Polkadot uses the Cross Consensus Messaging format (XCM) to let parachains send arbitrary messages to each other. Parachains open connections with each other and can send messages through the channels they have established.The collector is the full node of the parachain and the full node of the relay chain, so the collector node is a key component of message passing

. Messages do not go through the relay chain, only proofs of publishing and channel operations (opening, closing, etc.) enter the relay chain. This enhances scalability by keeping data at the edge of the system.

In the case of a chain reorganization, messages can be rolled back to the reorganization point based on the proof of publication in the relay chain. Shared state between relay chains means messages are not bound by trust; they all operate in the same environment.

Polkadot has an additional protocol called SPREE that provides shared logic for cross-chain messaging. Messages sent using SPREE carry additional guarantees about the provenance and interpretation of the receiving chain.

However, Cosmos does have a new specification for passing arbitrary data. Still, since the chains do not share state, the receiving chain must trust the safety of the source of the message.

governance

governance

Polkadot has a multi-chamber governance system with multiple paths for passing proposals. All proposals ultimately go through a referendum, and the majority of tokens can usually control the outcome.For referendums with low turnout, Polkadot uses adaptive quorum bias to set the pass threshold.

Referendums can contain various proposals, including the allocation of funds from on-chain treasuries. Decisions are made on-chain and are both binding and autonomous

Polkadot has several on-chain, permissionless institutions. The most important is the council, which consists of a group of accounts elected in the Phragmén fashion.

The Council represents the interests of a minority, so proposals passed unanimously by the Council have a lower bar for passage in referendums. There is also a technical committee to make technical recommendations (e.g. emergency runtime upgrades to fix bugs).

All token holders can vote, however, if a delegator abstains, the validators they delegate will assume their voting power. Validators in Polkadot do not receive any voting power based on their nominators.

picture

picture

upgradeUsing the Wasm meta-protocol, Polkadot enables chain upgrades and successful proposals without hard forks.

Anything in STF, transaction queue or off-chain workers can be upgraded without forking the chain

Since Cosmos is not based on a meta-protocol, it has to work out upgrades and proposals through the normal forking mechanism.

Development Framework

Cosmos and Polkadot are designed so that each chain has its own STF, and both provide support for smart contracts in Wasm and the Ethereum Virtual Machine (EVM).

Polkadot provides an advanced Wasm compiler and an interpreter (Wasmi) for execution, while Cosmos only executes smart contracts in the interpreter.Cosmos chains can be developed with the Cosmos SDK written in Go language.The Cosmos SDK contains about 10 modules (e.g. staking, governance, etc.) that can be included in the chain's STF

. The SDK is built on top of Tendermint."The main development framework for parachains is Substrate written in Rust. Substrate comes with FRAME, which is a set of about 40 modules (called "

pallets"), which can be used in the chain's STF.

Polkadot can support STF written in any language as long as it compiles to its meta-protocol Wasm. Again, it can still use Substrate clients (database, RPC, network, etc); it just needs to implement primitives on the interface.

postscript

postscript

Polkadot is designed on the principle that scalability and interoperability require shared verification logic to create a trustless environment. As more blockchains are developed, their security must be cooperative, not competitive.

Therefore, Polkadot provides verification logic and security processes shared across chains so that they can interact knowing that their interlocutors are executing in the same security context

The Cosmos network uses a bridge-hub model to connect chains with independent security guarantees, which means that inter-chain communication is still constrained by the trust of the receiving chain in the sending chain.Although in the first few years of development, Cosmos did not seem to have caused any splashes, but after several years of exploration,

The blockchain industry has entered the era of multi-chain, and the demand for cross-chain has also increased, and the ecological development of Cosmos has once again radiated new vitality

Welcome everyone to join our Telegram of Polkadot Ecological Research Institute: https://t.me/polkadot_eri

Welcome everyone to join our Telegram of Polkadot Ecological Research Institute: https://t.me/polkadot_eri

Welcome everyone to visit the Mirror address of Polkadot Ecological Research Institute: https://mirror.xyz/0x9A259b3a2316281Cc948cE2Cf1Ac610a79844f05

Cosmos
Polkadot
Cross-chain
Welcome to Join Odaily Official Community