
There has been a lot of discussion about the differences between Cosmos and Polkadot, two projects that focus on cross-chains. If you're not familiar with these two projects, this tweetstorm explains them very well and provides some resources for learning them.
secondary title
Why develop a new blockchain?
There are two main reasons why people prefer to develop application-specific blockchains from scratch, rather than existing applications in the form of smart contracts on existing platforms.
First, existing smart contract platforms may not provide the flexibility and customizability your application requires. For example, if your application requires a custom hash function, it would be expensive to write it on Ethereum, since the function needs to be executed on the EVM (Ethereum Virtual Machine) every time it is called.
One option is to suggest that the ethereum protocol incorporate this hash function as a precompiled contract, but unless this function is also widely used in many other applications, this proposal may not be approved. Writing your own blockchain from scratch gives you the freedom and flexibility to design the core logic of the blockchain to meet the specific needs of your application.
The second reason is autonomy. Developing applications on a smart contract platform forces your application to abide by its rules and governance. This may include factors that affect user experience, such as block times and gas prices, as well as state change decisions such as rollbacks of on-chain operations.
Of course, independent, autonomous blockchains give up the ability to communicate seamlessly with other applications, since they exist on separate blockchains with different state machines. Cosmos and Polkadot try to solve this problem; the former uses a Hub-and-Zone model, and the latter uses a Relay Chain/Parachain model.
secondary title
Difference 1: Local Security vs. Global Security
Cosmos and Polkadot operate under two very different security models.image description
Polkadot network architecture
Parachains are blockchains in the Polkadot network. These chains have their own state machines, their own rules, and their own local block producers (collators). Each parachain is essentially an independent state machine that can use any type of unique functionality, consensus algorithm, transaction cost structure, etc.
In the Polkadot network, all parachains are child chains of the parent chain of the relay chain (Relay Chain), which contains a certain representation of the "global state" of all parachain combinations.
The relay chain has its own consensus algorithm GRANDPA, which quickly determines the blocks on the parachain chain. Through this model, parachains in Polkadot operate in a "shared security" mode - if the relay chain has 1000 validators to provide a high degree of security, then any parachain can obtain strong security guarantees as long as it is connected to the relay chain . This allowsSubchains have autonomy over their state machines and local rules, as well as strong security guarantees shared with hundreds of other chains.
The downside of this model is that validators in the relay chain have the final say on state changes in either parachain.For example, a validator could keep rejecting blocks from a chain's collator for some reason and permanently prevent that chain's progress from being included in the global state.
Polkadot attempts to reduce this by shuffling validators so that they validate random parachains, which reduces the likelihood of a specific validator censoring a specific chain. Polkadot also has another class of validators called Fishermen, who constantly check validators for malicious behavior.
image description
Cosmos network architecture
In the Cosmos network, instead of using a local/global model for security, each blockchain is independent and self-protecting. Each blockchain runs its own consensus algorithm, and the validators of each blockchain are solely responsible for the security of the blockchain.
The Cosmos network uses a hub-and-zone model to achieve interoperability, where zones (independent blockchains) can pass through hubs (also independent blockchains)"send tokens"to other zones. This protocol is called IBC (Interchain Communication), and it is a protocol for sending messages between chains to represent token transfers. The IBC protocol is still under development. The first solution is token transfer, and eventually any type of message can be transferred between blockchains.
Comparing this model with Polkadot, the biggest difference here is that the state of each zone is only secured by its validators.If a zone wants to have strong security, it needs to do it itself and recruit its own validators, which can be difficult for small applications. Still, it's a strong selling point for certain apps that need more control.
For example, Binance built their DEX themselves by using their own nodes as validators for the Binance Chain as a starting point. This way, they can have full control over the chain as they test the DEX and roll out new features.
secondary title
Difference 2: Governance vs Membership
The second major difference between Polkadot and Cosmos concerns governance and membership.In the Polkadot network, there is a single relay chain and some parachains that the validators of the relay chain can support. The current estimate is that there will be 100 parachains, but this number can be reduced or increased in the future.
The Polkadot network allocates time to become a parachain through an auction mechanism - the highest bidder is able to guarantee the existence of a parachain for a fixed period of time by locking DOT (Polkadot's native cryptocurrency) in the PoS system.on the other hand,
on the other hand,The Cosmos network has no fixed membership rules - anyone can set up a hub or zone.The Hub itself is an autonomous blockchain, where the function of connecting other blockchains is designed. Two examples are the Cosmos Hub, which was recently launched by the Tendermint team, and the Iris Hub, a hub that plans to connect blockchains operating primarily in China and other parts of Asia.image description
Hub makes the connection of multiple chains more efficient
Closely related to membership is the difference in the governance processes of the two networks.In the Polkadot network, governance decisions are determined by the number of DOTs held by voters. There will be a formal on-chain voting mechanism, but it hasn't been finalized yet. In addition to normal weighted voting, Polkadot employs committees as passive stakeholder representatives. The committee consists of a group of people, starting with 6 people and increasing by 1 person every two weeks until 24 people.
Each member is elected by voting consent. Although the exact details of this governance process have not been finalized, the likely outcome is that there are multiple ways to change parameters in the relay chain, such as block time, block reward, etc., and multiple ways to change the parachain's membership. For example, the Polkadot governance process may change the number of DOTs required or become a parachain's auction mechanism.
A common misconception is that DOT holders can vote to kick certain parachains at will, but in reality DOT holders can only change the membership process.on the other hand,
on the other hand,The Cosmos network does not have a single "governance" process. Each hub and zone has its own governance process, and there is no supreme rule that applies to the entire blockchain network.When people talk about "Governance of Cosmos", they are referring to the governance of the Cosmos Hub, launched by the Tendermint team.
secondary title
Difference 3: Interchain Communication
Another difference between Polkadot and Cosmos is the structure of their interchain communication protocols and their design goals.The goal of Polkadot is to pass arbitrary messages between parallel chains (parachains). This means Parachain A can call smart contracts in Parachain B, can send tokens between chains, or do other types of communication.
On the other hand, Cosmos focuses on the transfer of assets between different chains, which is a simpler protocol. At present, neither of these two communication protocols is fully determined, nor has it been developed yet. Details in this regard can refer to IBC (Interchain Communication) and ICMP (Interchain Messaging in Parachain).
The biggest challenge of inter-chain communication is not how to represent data on one chain on another chain, but how to deal with the situation where data on the chain comes from a fork and is reorganized to exclude transactions.This is due to the difference between Cosmos and Polkadot in terms of structural design.
Polkadot uses two different mechanisms to secure interchain communication.First, the existence of a shared security model makes exchanging messages easier. A by-product of shared security is that all parachains have a uniform level of security, so each chain can trust each other.
To understand this, let’s use the example of Ethereum (high security) and Verge (low security) interoperating. If we wanted to represent Ethereum on Verge, we could lock up ETH and mine some ETH-XVG tokens on the Verge blockchain.
However, due to the low security, an attacker can perform a 51% attack on the Verge chain and send a double-spending transaction to the Ethereum blockchain, which allows the attacker to withdraw more ETH than he actually owns. therefore,Chains with high security have a hard time trusting chains with low security when sending messages to each other.This becomes even more complicated when messages are delivered to multiple different chains with different security levels.
In theory, unified shared security is a great way to secure interchain communication. However, in order to achieve this goal, the protocol must be able to frequently and randomly shuffle the validators assigned to each chain. This leads to the classic "data availability problem", where each validator must constantly download the state of each parachain assigned to it. This is one of the hardest problems in the field today, and it's not clear that Polkadot will be able to solve it.
Second, Polkadot uses the concept of Fishermen, which are "bounty hunters" on the Polkadot network who observe malicious behavior on Parachains. In a sense, this is a "second line of defense" against malicious behavior.
In the event that a validator responsible for a particular parachain makes an invalid block irreversible, Fishermen can commit proof to the relay chain and effectively roll back the entire state of the Polkadot network and all the parachains within it. During the interchain communication phase, our biggest concern is one chain reorganization and the other running as usual, but Polkadot ensures that if an invalid block is found, everything will be rolled back.
Cosmos takes a completely different approach to interchain communication.Since each blockchain has its own validators, it is entirely possible for colluding validators to "mutate" zones. This means that when a zone wants to communicate with another zone, zone A needs to trust the Cosmos Hub (in order to find a connection route) and the validators in zone B.
but,
but,Even if people trust a chain, it can still be taken over by malicious actors and cause problems.image description
A Cosmos network that uses tokens in multiple zones
For example, these little red dots represent an ETM token (the native currency of the Ethermint zone). Users in zone A, B and C want to use ETM for some applications inside these zones, and they trust Ethermint zone, so they send IBC message to deliver ETM to these zones. Now suppose Ethermint validators collude, initiate double spend transactions, spend tokens at will, etc.
This will have an impact on the rest of the network, as ETM tokens also exist in different zones. However, the only people who will be affected by this are those who hold ETM tokens within Ethermint or other zones. It is impossible for a malicious validator in Ethermint to destroy other zones except itself at will. This is what the universe was designed for -Ensure malicious behavior does not affect the entire network.
secondary title
Difference 4: Consensus Algorithm
The Polkadot relay chain uses a consensus algorithm developed by the GRANDPA team.This algorithm allows the relay chain to quickly determine the final state of many blocks across all parallel chains, and also accept a large number of validators (over 1000).
In simple terms, this is because not all validators need to vote on every block - instead, validators can vote on the highest block they think is valid, and the algorithm can pass that vote on to that All ancestors of the block.
Through this process, the consensus algorithm finds the set of blocks with the most votes and decides that it is finally valid. GRANDPA is still in development and we don't know how it will work in practice.
on the other hand,
on the other hand,Every blockchain in the Cosmos network can use any consensus algorithm that complies with the specification called ABCI.This specification was created to standardize communication between chains. Currently, only the Tendermint algorithm conforms to this specification, but there are some other attempts.
At a high level, the Tendermint algorithm works by allowing each validator to discuss with each other to agree/reject a block, thereby determining its irreversibility on a per-block level. This algorithm is fast, and in "Game of Stakes"The project was stress-tested in a live environment with 200 validators and a 6-second block time.
The Cosmos team also provides a software development kit in which the Tendermint algorithm can be used out of the box. The biggest disadvantage of Tendermint is the high communication cost between validators. This means that while it can work fairly quickly with less than 200 validators, it will be much slower with 2000 validators. However, the tradeoff here is that you gain safety by going asynchronously.
This means that in a network partition, instead of having two transaction histories that will eventually merge (and 1 history that will be discarded in the process), the network will stall. This is important because if you see a transaction that "finalizes the state", it won't be reversed even under the worst network conditions.
secondary title
Difference 5: Substrate vs Cosmos SDK
Both Polkadot and Cosmos offer a software development kit called Substrate and Cosmos SDK, respectively. They are all designed to make it easy for developers to start building their own blockchains, and include various out-of-the-box modules, such as governance modules (voting systems), staking modules, identity verification modules, and more.
in conclusion
in conclusion
Although this article is very long and detailed, it still does not cover everything. The difference between Cosmos and Polkadot is not well understood, and there are many things that I may have missed. It's hard to get a full picture of both projects, and sometimes their development documents change daily.
Both projects are still in their infancy and will hit full steam next year - some of the issues I raised may not be there anytime soon.
Anyway, I'm starting to believeThe advantages of Polkadot over Cosmos are as follows:
1. Application developers do not need to build their own security mechanisms
2. Inter-chain messaging under shared security is easier if they can address data availability
3. They seem to have very high expectations for Substrate (WASM, more out-of-the-box consensus algorithms and modules)
4. Focus on better enabling any type of messaging for cross-contract calls (not sure about use cases yet)
on the contrary,
on the contrary,Compared with Polkadot, the advantages of Cosmos are as follows:
1. Cosmos is officially running. Polkadot has not yet.
2. Polkadot's parachain membership is limited and may cost very high
3. More customization for specific projects (eg, Binance)
4. Malicious validators of the parachain chain may cause corruption of the entire network. Cosmos limits corruption only to zones and corresponding assets
5. Cosmos SDK has been used by many projects
author:
-END-
author:Julian Koh
Translator profilestatement:
statement:Original link:
Original link:https://medium.com/@juliankoh/5-differences-between-cosmos-polkadot-67f09535594b