
This article comes fromorange bookThis article comes from
(ID: chengpishu) Author: Dave Kajpust, translation: orangefans Eric, reproduced with authorization.
Blockchain interoperability may be the next wave of innovation and will bring enormous value to the popularity of the decentralized web. Cosmos network and Polkadot network are two top projects implementing blockchain networks respectively. This article will discuss the advantages and disadvantages of these two projects from the aspects of network protocol, network design, security model and technology stack. But first we need to understand what blockchain interoperability means at a higher level.
first level title
What is Blockchain Interoperability?
Blockchain interoperability allows sending ETH or receiving BTC only through the blockchain protocol itself, without the need for third-party institutions (such as exchanges) to intervene. This wish is simple, but it has not yet been fulfilled.
Both Polkadot and Cosmos are working on building network protocols between blockchains for safe and secure interactions. New blockchains based on these protocols can send transactions and pass messages between chains.
first level title
Why is it so important?
Blockchain networks can improve decentralized networks through network effects. When all blockchains are connected, it leads to more capital, better user experience, and better brainstorming to improve the state of the network. Blockchain interoperability can significantly improve blockchain scalability and transaction speed. For example, if a chain is capped at 100 TPS, a second identical chain - up to 200 TPS - can be created to facilitate interaction with other chains. In this way, we can easily achieve a transaction speed of 1000 TPS.
It also allows access to private chains, public chains and alliance chains. Eventually, blockchains could even interact with fiat banking systems like SWIFT.
Why focus on Cosmos and Polkadot?
They take similar strategies when it comes to solving blockchain interoperability problems, but there are subtle differences in protocols and designs. These differences manifest themselves in the trade-offs between security, privacy, efficiency, flexibility, and ease of use.
So now, let us uncover the mystery of the future interactive blockchain!
first level title
Cosmos network
The Cosmos team is building a Tendermint-based Cosmos network. Both Tendermint and Cosmos are affiliated with the InterChain Foundation. The following two figures will briefly explain how they designed the network.
Technical Design and Protocol
first level title
Tendermint (consensus and networking)
Tendermint is a Practical Byzantine Fault Tolerant (PBFT) state machine. It requires a set of known validators to reach a consensus to generate blocks. In the Cosmos network, at least 2/3 of the verifiers need to reach a consensus. Assuming that less than 1/3 of validators are perpetrators, the network will never fork because validators cannot submit conflicting blocks at the same height. This strategy is rooted in the principle that security takes precedence over liveness in Tendermint.
Application Blockchain Interface (ABCI)
ABCI is an interface that defines the boundary between the replication engine (Tendermint) and the state machine (blockchain). ABCI is the only channel for blockchain state updates, and only Tendermint has the blockchain state change function. This design is a great security strategy because there is only one access channel to change state.
The diagram below explains Tendermint's stack design, showing how nodes are connected in a peer-to-peer network, and the components of each node.
Cosmos Interactivity
Interchain Communication (IBC)
The Cosmos network can realize the chain-chain interaction function based on the IBC protocol. With the Cosmos network as the central hub, the chains in the network communicate through IBC. The blockchain is connected to the Cosmos Hub in the form of branches, and the branches in the network are called "Zones", as shown in the figure below.
Peg Zones
The technical term of IBC is also called "Chain Relay". Chain Relay allows blockchains to read and verify events on other chains. For example, if the smart contract on the A chain wants to know what happened on the B chain, the smart contract on the B chain needs to adopt the block header of the A chain and verify whether it reaches a consensus and finality.
Essentially, Cosmos is building a network system in which new blockchains can be easily created and interact through Chain Relay from the beginning. Each chain will run on Tendermint, and as long as the new chain follows the IBC protocol, it can join the network, including public chains and private chains. As shown below.
Peg Zone allows real-time blockchain networks (such as the Ethereum mainnet) to be connected to the Cosmos network. Being able to connect to a live blockchain is a major requirement for a blockchain interoperable network. Peg Zone is complicated, but we can try to explain how it works in simple terms.
You must have a shared security model, and the Cosmos Peg Zone validators are also running Ethereum mainnet nodes. Special validators approve the interaction between the two chains. It's a complex and cumbersome infrastructure, and you also have to trust the team that runs Peg Zone.
The actual asset transaction requires the smart contract on the Ethereum mainnet to lock the corresponding ETH, and at the same time create a new token representing "Cosmos-Ether" in the Peg Zone, which can be sent in the Cosmos network through IBC. From the perspective of Cosmos, the validator will lock the Atom, and at the same time create a sendable ERC-20 Atom token in the Ethereum main network. In this way, full interoperability of assets between Cosmos and the Ethereum mainnet is achieved.
To achieve interoperability between the two chains
Any interoperable network requires at least two blockchains that can exchange information and generate transactions. Ethermint is the first solution proposed by Cosmos to interact with the Cosmos Hub.
The genius of Ethermint's design lies in the "hard spoon" the team plans to achieve. They will take a snapshot of all Ethereum accounts at some point in time and create a new Ethermint partition with that state. This will help them bootstrap the existing network of ethereum developers, while issuing new tokens to everyone and providing faster transaction speeds.
Cosmos Hub
Ethermint was chosen instead of Peg Zone to "map" the Ethereum mainnet because it is technically easier to implement. However, for the blockchain, the existence of the Peg Zone is crucial. Whether for Cosmos or Pokaldot, there is so much momentum behind Bitcoin and Ethereum that it would be extremely risky to ignore them.
first level title
In the Cosmos network, the Cosmos Hub is the main chain and acts as a central connection point for all other blockchains. It is a Tendermint powered multi-asset proof-of-stake blockchain. The main token of Cosmos Hub is Atom, which is mainly used for staking and chain governance. The Cosmos Hub will start with 100 validators and will increase year by year.
Atom holders can be both validators and delegators. Validators need to set up a full node to maintain network security and process transactions. Delegators can entrust tokens to verifiers based on their judgment on the verifier's trust and node operating capabilities. Validators will delegate Atom assets and receive Atom rewards for each block produced. These rewards will benefit delegators, but a small portion will be withheld for the day-to-day operation of validator nodes.
To keep validators honest, malicious validators who publish incorrect data to the blockchain lose their Atom tokens as a financial penalty. This mechanism is called "slashing". These game theory rules are all meant to incentivize good behavior in proof-of-stake blockchains.
Tokens can also be used for governance. An Atom can be used as a vote for any proposal on the network, such as a software upgrade. Cosmos' governance protocol is fairly simple. Delegators can vote themselves, or transfer their voting rights to the validators they delegate. Validators must vote for each proposal, or they will be penalized.
Current Status of Mainnet Launch
The Cosmos team is currently testing the testnet with partial functionality, but they are very close to testing a fully functional version of the software. The team will release the real-time mainnet at some point in Q3 2019. However, the Cosmos team will freeze transactions until the mainnet is running stably. Once the mainnet is live and running stably, the Cosmos team will implement IBC and carry out Ethereum’s “hard spoon” for Ethermint. For a more in-depth look at the Cosmos roadmap, click here.
Cosmos SDK
Development builds on Cosmos
Developers have two methods for development projects based on the Cosmos network: building a new blockchain for IBC interaction and creating smart contracts in the Cosmos Zone. The Cosmos team created the Cosmos SDK so that developers can easily launch new blockchains on the Cosmos network.
The Cosmos team released the "Cosmos SDK", which allows developers to design their own blockchains on the Cosmos network using a simple, modular approach. The SDK is being used to build the Cosmos Hub, so when the mainnet launches, the SDK will also be available for developers to build their own blockchains. Cosmos Hub can build basic applications running on the Cosmos network, and then add corresponding modules for equity agency, governance and IBC.
This will allow developers to use the SDK themselves, choose basic blockchain applications, add modules such as governance or equity proxy, and even create their own modules and publish interactive blockchains. This is an exciting opportunity because it will create a whole new decentralized platform for developers, not just the token model that took Ethereum by storm.
The SDK is written in Golang language and will support future languages. But around the first year, the blockchain in the network had to be written in Go.
Building dApps on Cosmos
Polkadot is another project led by a strong technical team and dedicated to solving the interoperability between blockchains. Polkadot is developed by Parity, a member of the Web3 Foundation. They are best known for their Ethereum client Parity (written in Rust).
consensus
Technical Design and Protocol
As Cosmos does, Polkadot separates the consensus architecture from the state program. According to its white paper, Polkadot's consensus engine was actually inspired by Tendermint and HoneyBadgerBFT.
However, in a recent Youtube video, the Polkadot team mentioned that they plan to use a hybrid consensus mechanism of Aurand and Tendermint for PBFT. Aurand allows random selection of verifiers to generate blocks without the need for consensus of 2/3 members. The design of the hybrid consensus engine makes consensus formation faster, but blocks may also be recycled if validators behave maliciously.
image description
Parachain
Interoperability with Polkadot
The strategies of Cosmos and Polkadot to achieve interaction are also very similar. The Polkadot network has a "Relay Chain", which is a central connector that functions similarly to the Cosmos Hub. It also has blockchains connected to "Relay Chains" which are called Parachains. Cosmos Zone and Parachain serve the same purpose. Polkadot will also be equipped with a Bridge that connects to the real-time blockchain, which is also similar to the Cosmos Peg Zone.
Bridges
Both Parachain and Cosmos Zone use chain relay to realize the interaction between blockchains. But there are differences between the two in terms of specific implementation. The biggest difference is how to connect to the chain and achieve safe sharing. In Polkadot, network security can be pooled and shared. This means that a single chain can use collective security to enhance its attractiveness and trust, without having to start from scratch.
This solution is implemented by binding Dots to create a new Parachain, or unbinding Dots to remove useless Parachains. Cosmos does not require Atoms to be bound to create a new chain. They use governance methods to determine whether the central Cosmos Hub should be connected to the Cosmos Zone.
Bridge and Peg Zone function the same in their respective networks. They can all be connected to a live blockchain network, such as the Ethereum mainnet. Both Cosmos and Polkadot hope to connect quickly to the Ethereum mainnet at launch.
To achieve interoperability between the two chains
As mentioned earlier, the first chain to interact with the Cosmos Hub is Ethermint. In all likelihood, Polkadot will also create a chain similar to Ethermint. In this regard, the Polkadot team should be able to easily deal with it, after all, they have accumulated considerable experience on the Ethereum Parity client.
Polkadot Network
The Polkadot network is a proof-of-stake blockchain whose native token is "Dots". Dots can provide governance and incentivize token holders to act honestly by theoretical rules. The central part of the network is the "Relay Chain", which is similar to the function of the Cosmos Hub in the Cosmos network. The Polkadot network has four main stakeholder groups: Validators, Nominators, Collators, and Fishermen. Polkadot also punishes misbehavior through "slashing".
Validators on Polkadot have the same role as validators in Cosmos, and nominators are similar to delegators in Cosmos. The diagram below, from the Polkadot whitepaper, shows how each stake staker is related to each other.
Validators do not maintain fully synchronized databases on all Parachains because the amount of data stored is too large. Therefore, validators delegate the task of storing and validating new Parachain blocks to third parties, whom we call "Collators". The main task of a proofreader is to generate valid Parachain blocks. They must maintain a full node. Collators also perform zero-knowledge proofs of unencapsulated blocks and provide them to one or more validators responsible for submitting Parachain blocks to the Relay Chain. Proofreaders and validators receive a fee for these tasks.
Fishermen, like freelance bounty hunters, seek out big rewards. Predictably, their mere presence makes mischief rare. Because verifiers and proofreaders know that once they do evil, they will be caught by fishermen and punished. Fishermen send evidence of any illegal activity by validators or collators on the Polkadot network.
Governance is divided into several layers, mainly through Dots voting on the network. The Polkadot team also plans to set up a council of 12-24 accounts to vote on proposals that have not received the attention of equity stakeholders. This is a fallback solution to low voter turnout proposals. They also promise to incorporate adaptive quorum bias and give votes different voting weight metrics, such as giving more voting weight to long-term holders or validators, or even dApp development teams that have contributed to the network for a long time. However, these ideas are currently only at the conceptual stage.
Current Status of Mainnet Launch
Substrate
The Polkadot team's first proof of concept (proof of concept) has been able to verify blocks and achieve state transitions. They have implemented sending Dots tokens through the test network. The proof of concept was written in Rust, with support for WebAssembly later. They plan to release the mainnet in Q3 2019 and have been saying that they are working hard to achieve this goal.
Development builds on Polkadot
Substrate is a technology stack for building blockchains. It is very similar to the role of the Cosmos SDK in Cosmos. The Polkadot network is built on Substrate, just like the Cosmos network is built on the Cosmos SDK. You don't have to worry about consensus or networking, but just focus on the blockchain application itself.
Substrate is written in Rust, but the core functionality of the state machine will be compiled into WebAssembly. It can use compiled Rust code directly, or run it through the WebAssembly translator. See the figure below for details.
Create dApps on Polkadot
Comparing Cosmos and Polkadot
consensus protocol
Let's take a look at the main components of the two networks, and how they stack up against each other. This is the most valuable part of this article, you can compare the differences between the two projects and judge for yourself which network may be more successful in the future.
consensus protocol
They both use Tendermint for PBFT consensus, although Polkadot promises to use a hybrid consensus protocol that complements Aurand. The hybrid consensus scheme speeds up the formation of consensus, but it also leads to the possibility of block recycling. Both schemes still need to be tested in real-time blockchain networks. Of course, both consensus protocols are also much faster than the PoW consensus of the Ethereum and Bitcoin networks.
Polkadot also mentions on their website that "Optimistic BFT Proof of Authority" will be used, but it's unclear what exactly they mean. The Web3 Foundation recently stated that "Polkadot is designed to be completely open and public, and does not need to be maintained by any particular organization or trusted authority". Judging from the overall design proposed by Polkadot in the white paper, it is clear that the PoS proof of Dots will dominate the consensus. Even if PoA proof (Proof-of-authority) will be used eventually, it may only be a secondary role.
They both have tokens for governance and equity proxy. Both networks have validators who secure the network, and delegators/nominators who delegate tokens to validators. Collators (to help with Parachain) and Fishermen (to keep tabs on the network for bad actors) are also added to the Polkadot network. Both projects have punishment measures for perpetrators, and when the mainnet is launched, the corresponding punishment indicators may be adjusted and tested. In summary, Polkadot's PoS consensus design is more subtle, but also more complex.
governance
The advantage of Cosmos is that they will release the mainnet first, and the relatively simple design also makes it easier for equity stakeholders to organize and create a stable decentralized network. The advantage of Polkadot is that the configuration of four equity stakeholders can make the network more decentralized. It is difficult to say which of the two projects is better, but time will tell.
governance
Cosmos' protocol for governance is uncomplicated as it relies solely on validators, delegators and a written constitution.
PoS governance in live blockchains is largely untested. We can expect that both project teams will be able to come up with corresponding solutions to adjust the governance protocol at the beginning of testing. Both design models are clean enough to transition to a more robust decentralized governance system through small iterations and improvements. It is not advisable to impose a bunch of systems and rules from the beginning. It is better to start simple and gradually increase the complexity. This is also the brilliance of these two projects.
safety
The network also needs to be sufficiently decentralized to prevent some malicious validators from controlling the entire network. Thankfully, this will allow them to avoid the problems they faced when the EOS mainnet launched: the network was too centralized due to the low limit of 21 BP nodes.
safety
Polkadot allows Parachain and Relay Chain to share "pool security", while Cosmos uses Zone to protect its own network security. This means that to start a new Parachain, it is necessary to accumulate a large number of Dots and pledge these tokens in order to connect the Parachain to the Polkadot network. Therefore, the security of each Parachain is rooted in Dots itself, thus creating a shared security model in the entire network.
Cosmos allows Zone to manage its own security model, which is the so-called "Sovereign Zone". This means that the Cosmos Hub will use governance to decide which Zones can access the Cosmos Hub. This scheme works in theory, however, if a malicious Zone successfully tricks validators into believing they are legitimate, then it can indeed access the network. Once a malicious Zone is connected to the network, it may have multiple ways to attack the central Cosmos Hub and extract Atoms from the Cosmos network.
With Cosmos' Sovereign Zone, each connected Zone must create a secure decentralized network by itself. So, if the Cosmos Hub has 5 fully available Zones, there may be 100 Cosmos validators, and 5*100 Zone validators. This is a more decentralized model than Polkadot. If it works properly, it should work fine.
It is conceivable that 100 Polkadot validators can protect the Relay Chain and 5 Parachains, while the Cosmos network requires 100 Hub validators and 500 Zone validators. This also makes it relatively easier to create new Parachains in the Polkadot model, but it also means that power will be concentrated in the hands of Dots owners. While Cosmos is a more decentralized security model, it is also more difficult to implement.
However, the Cosmos team also announced that they plan to support a shared security model shortly after mainnet launch. Once they implement this plan, it will give developers great flexibility. Because developers can share Atom-based security on Cosmos, or create their own tokens and security systems. The trade-off between the two security models is adding the Sovereign Zone to the network through governance, which also opens up the possibility, although unlikely, for a malicious Zone to connect to the network.
speed and scalability
interoperability
Developer
Both networks are connected to a central hub via chain-relays. They are all connected to the Ethereum mainnet via Peg Zones/Bridges and are working on making this connection even faster. In addition, they can all run EVM Zone/EVM Parachain on their respective networks quickly and easily. Cosmos will release Ethermint after the mainnet is stable, and Polkadot may have similar plans.
Developer
Both the Cosmos SDK and Polkadot Substrate are designed for developing platforms. They make it easier for developers to create their own blockchains on the network. Both teams are committed to building a new developer-friendly development platform, just like Ethereum did with smart contracts and tokens.
The main difference between developing on these two platforms is that Polkadot uses WebAssembly and Rust languages, while Cosmos uses Golang language.
Polkadot supports WebAssembly with a vision to better future-proof it. WebAssembly is backed by Google, Apple, Microsoft, and Mozilla and is likely to be widely used within the next decade. Rust has also been working hard to become one of the main languages that compiles into WebAssembly. Looking ahead to the next 5 years, Polkadot appears to be making the right move in terms of long-term developer appeal.
However, as we have seen with Ethereum, sometimes it is important to be first to market. There are other blockchains that support smart contracts that allow writing smart contracts in other languages, but Ethereum covers almost all smart contract activities. It is precisely because they built an ecosystem around Solidity and EVM that they captured the hearts of many early developers.
Cosmos will be the first to market. The main way to develop on Cosmos is through the Golang language in the Cosmos SDK, and Lotion-JS, a Javascript implementation tool that can create new chains based on Ethermint. However, the Lotion-JS website also stated that the Lotion-JS code has not passed the security audit, and if you want to ensure security, you must use the Cosmos SDK.
Currently, Cosmos does not support WebAssembly related work. But we can trust that Golang will soon add support for compiling to WebAssembly. They have made considerable progress. Finally, Golang is an easier-to-learn programming language and has more developers globally than Rust.
Mainnet launch
Cosmos seems to have an advantage here, but Polkadot also has a chance to learn from the mistakes Cosmos made.
Summarize
first level title
Summarize
It's hard to say which network will be more successful right now. But it’s safe to say which network will grow the fastest and capture the largest market share, whichever network attracts more developers.
While there is ultimately only one winner between Cosmos and Polkadot, it’s worth noting that there may be areas in which they co-exist and are interconnected. For example, if both networks create Peg Zones/Bridges on the Ethereum mainnet, you can use Dots’ ERC20 tokens to trade Atom’s ERC20 tokens. This allows secure interaction of the two networks. This could potentially create a huge network of interwoven blockchains where Ethereum, all Parachains and Zones are interoperable. Of course, the Plasma chain of Ethereum can also be connected to it.
source
[1] Chain Interoperability— Vitalik Buterin, September 2016
[2] Tendermint Whitepaper
[3] The Cosmos Network Website
[4] Understanding the Value Proposition of Cosmos — Cosmos Network Blog
[5] Cosmos Whitepaper
[6] A Beginners Guide to Ethermint — Cosmos Network Blog
[7] The Internet of Blockchains — How Cosmos Does Interoperability, Starting with the Ethereum Peg Zone — Cosmos Network Blog
[8] Latest in Cosmos Critical Community Update May — Cosmos Network Blog
[9] Introducing the Hard Spoon — Cosmos Network Blog
[10] Polkadot Network website
[11] Polkadot Whitepaper
[12] EH18 Gavin Wood — Tech Talks: The Energy Blockchain — Tech Update
[13] Polkadot Lightpaper
[14] How Polkadot Tackles the Biggest Problems Facing Blockchain Innovators — Polkadot Network Blog
[15] Gavin Wood Edcon 2018 Polkadot Presentation
[16] Now Live — Polkadot Proof of Concept — Polkadot Network Blog
[17] WebAssembly Wikipedia