Depth | Interpretation of blockchain interoperability: Cosmos vs. Polkadot (on)

Blockchain interoperability may be the next wave of innovation and will create tremendous value for the expansion of distributed networks.

Cosmos and Polkadot are the two main competitors in creating blockchain interoperability networks. This topic will explore the two projects' protocols, network design, security model, and technology stack.

This article is compiled exclusively by Encrypted Valley and will be divided into two journals. This is the first one.

What is blockchain interoperability?

Blockchain interoperability is complex, so let's try to explain it in the simplest and straightforward way.

Blockchain interoperability will send Ethernet and receive BTCs through blockchain protocols without the intervention of third parties such as exchanges. This is a simple wish, but it has not yet been implemented.

Both Polkadot and Cosmos are establishing protocols for blockchains for secure and reliable interaction. These protocols allow the creation of new blockchains and the ability to send transactions and deliver messages to each other.

The blockchain has a network effect. When everything is connected, it will bring more money, a better user experience, and more unconventional ways to improve the network.

Blockchain interoperability can significantly increase the scalability and speed of blockchains. For example, if you have a blockchain with an upper limit of 100 TPS, you can create a second block of the same block to reach 200 TPS and interact and trade with other blockchains. This way you can easily achieve 1000 TPS.

At the same time, it also allows the connection of private chains, public chains and alliance chains. Ultimately, the blockchain can even interoperate with legal banking systems such as SWIFT.

Why pay attention to Polkadot and Cosmos?

Polkadot and Cosmos are the most promising projects in the blockchain interoperability field. They all have strong technical teams, have a good reputation in a decentralized network community, have many years of experience, and have written a lot of blockchain code from scratch.

Image source: Cosmos Network Website and Polkadot Network Website

In solving blockchain interoperability, their strategies are similar, but there are subtle differences in protocol and design. These differences are trade-offs between security, privacy, efficiency, flexibility, and ease of use.

Now let's dive into the future of blockchain interoperability.

The Cosmo Network

Since the release of Tendermint in 2014, the Cosmos team has been working on blockchain interoperability. Tendermint is a Byzantine fault-tolerant consensus engine, as well as a peer-to-peer network gossiping protocol.

Image source: Cosmos Network Website

The Cosmos team is building The Cosmos Network, a blockchain based on Tendermint. It is important to note that both Tendermint and Cosmos belong to the InterChain Foundation.

The two figures below will briefly explain how they design the network.

The blockchain consists of three main components: a computer node network that communicates with each other, a consensus protocol that allows the node to agree on a new block, and an application layer with its own state (such as an Ethereum account to store Ether).

Tendermint is responsible for the network and consensus layers of the blockchain. This allows the blockchain to create an application of its own state on top of Tendermint. ABCI-application (application) interacts with Tendermint via the ABCI protocol.

  • Technical design and agreement

Tendermint (Consensus and Network): Tendermint is a practical Byzantine Fault Tolerant (PBFT) state machine. It requires a set of known Validators to agree and reach a consensus on the block. The Cosmo Network requires at least 2/3 of the people to reach a consensus. Assuming that less than a third of Validators are "byzantine", the network will never fork. Because Validators cannot submit conflict blocks at the same height. This stems from the fact that Tendermint tends to be safe rather than active.

Application Blockchain Interface (ABCI): ABCI is the interface that defines the boundary between the replication engine (Tendermint) and the state machine (blockchain). ABCI is the only way to update blockchain status, and only Tendermint can access the status change function of the blockchain. This design is a great security strategy because there is only one access port to change state.

The following figure shows the Tendermint stack, showing the nodes connected in a peer-to-peer network and the components of each node.

The five nodes make up a peer-to-peer network. Each node is a computer running Tendermint Core. Tendermint can connect to the blockchain via the ABCI protocol. The Light Client node in the lower left corner can be connected to any Tendermint node via an RPC call.

  • Cosmos interoperability

Inter-Regional Chain Communication (IBC): The Cosmos Network has an Inter Blockchain Communication (IBC) protocol that allows blockchains to interact with other blockchains. With the Cosmos network as the central hub, the blockchain network communicates through the IBC. The blockchain is connected to the Cosmos Hub via the Spoke model. The branches in the network are also called Zones, as shown in the following figure.

The Cosmos Hub is the main blockchain that connects all other blockchains built on top of the Cosmos network. Each Zone is its own blockchain, which together create a hub and branch model for the connection.

The technical terminology of IBC is "Chain Relay". Chain Relay allows blockchains to read and verify events in other blockchains. For example, a smart contract on chain A wants to know what is happening on chain B. To this end, the smart contract on chain B needs to use the block header of chain A and verify that it has reached consensus and is final.

Essentially, Cosmos is building a network system where it is easy to create new blockchains and interact with Chain Relay from the very beginning. Each blockchain will run on Tendermint as shown below.

Cosmos Hub interacts with four other running blockchains on top of Tendermint. They can easily read and operate on each other through the IBC protocol. As long as the new blockchain follows the IBC protocol, it can join the network, including the public and private chains.

Peg Zones: Peg Zones allows The Cosmos Network to connect to an active blockchain network, such as the Ethereum main network. Being able to connect to an active blockchain is a major requirement for any blockchain interactive network. Peg Zones are complex, but we try to explain how they work in simple terms.

First, you must have a shared security model where the certifier of the Cosmos Peg Zone is also running the Ethereum main network node. This special Validator will approve the interaction between the two chains. To build this complex infrastructure, you also need to trust the team running Peg Zone.

The actual asset exchange requires the Taifang main network smart contract to lock Ether, which will create a new token in the Peg Zone that can represent “Cosmos-Ether”. Cosmos-Ether can be passed through the IBC in the Cosmos network. From Cosmos's point of view, the Validator will lock Atoms, and Atom will create a sendable ERC-20 Atom token in the Ethereum main network. This will give full interoperability of assets between Cosmos and the Ethereum main network.

Interoperability between the two chains: Any interactive network requires at least two blockchains that can exchange messages and transactions. Ethermint is Cosmos's first solution to interact with Cosmos Hub.

Ethermint is the blockchain that the Cosmos team plans to launch in the fourth quarter of 2018 after the Cosmos Hub main network was released. Simply put, the Ethermint Ethereum blockchain replaces the PoW algorithm with the Tendermint consensus engine. This allows the blockchain based on the Ethereum virtual machine to easily interact with the Cosmos network via IBC.

The subtlety of the Ethermint design is the “hard spoon” of the team's plan. They will take a snapshot of all Ethereum accounts at some point in time and use this status to create a new Ethermint zone. This will allow them to guide the existing Ethereum developer network and provide everyone with new tokens and faster transaction speeds.

Choose to create Ethermint first, not Peg Zone to the Ethereum main network because it is technically easier to implement. However, the blockchain network must have Peg Zones.

For Cosmos or Polkadot, there is a huge momentum behind BTC and Ethereum, and ignoring them is a very risky move.

The Cosmos Hub: Cosmos Hub is the central connector for all blockchains in The Cosmos Network. It is a Tendermint-driven, multi-asset proof PoS blockchain. The main token of Cosmos Hub is Atom, which is mainly used for mortgage and governance of blockchain. Cosmos Hub will have 100 certifiers at startup and will increase year by year.

An Atom holder can be either a verifier or a voter. The certifier sets up a complete node for maintaining the network and processing transactions. The voter will judge the verifier's trustworthiness and node's ability to run, and delegate its Atoms to its processing.

The certifier gets the Atoms proxy and gets Atom as a reward from each block. These rewards will be given to the voter, and a small amount of the fee will be deducted as the cost of the operation verification node.

In order to ensure honesty, a penalty mechanism is set. Verifiers who post incorrect data to the blockchain will lose their Atoms. This mechanism is called "slashing". These game theories are used to stimulate good behavior in the PoS blockchain.

Token also represents governance. An Atom can be used as a ticket for any proposal on the web, for example, a software upgrade. Cosmos's governance agreement is very simple. Voters can vote on their own or transfer voting rights to the verifiers they delegate. The verifier must vote for each proposal or they will be punished ("slashed").

In mid-March 2019, the Cosmos main network was officially launched, and cross-chain interaction became a reality. Previously, the development team went through a lengthy test network phase.

Once the main network is stable, they will implement IBC and then make an Ethereum “hard spoon” for Ethermint.

  • Cosmos developers

Developers can develop on top of the Cosmos Network in two ways. Build a new blockchain of IBC interactions and create smart contracts in Cosmos Zones. The Cosmos team created The Cosmos SDK to make it easy for developers to launch new blockchains on the Cosmos Network.

Cosmos SDK: Enables developers to design their own blockchains on the network in a simple, modular way. The SDK is used to build the Cosmos Hub, which is also available for developers to build their own blockchain when the main network is launched. Cosmos Hub built the underlying application running on the Cosmos Network and then added the appropriate modules for mortgage, governance and IBC.

This will allow developers to easily publish interactive blockchains, which is an exciting opportunity. Because it will create a new distributed platform for developers, not just the eBay model that is popular around the world.

The SDK is written in Golang and is expected to support other languages ​​in the future.

Building dApp on Cosmos: Ethermint will be your first step in building a dApp on the Cosmos Network. Because it is an EVM-based blockchain, smart contracts can be written in Solidity. Cosmos Network's trading speed will also increase, as the Tendermint consensus can handle more transactions per second than the Ethereum main network PoW consensus.

– END –

Author of Dave Kajpust

DUANNI YI translation

Edited by Sonny Sun

Roy typesetting