A comparison of two multi-chain platforms

Building a blockchain is difficult. Many early projects forked Bitcoin and built their blockchain using it, but that’s not an optimal approach to build a technology that will last decades. So, projects like Polkadot and Cosmos are attempting to solve this problem. Now, using these two platforms, anyone can build a blockchain!

Polkadot

The Polkadot Network is a proof-of-stake blockchain with a native token “DOT”. The idea of Polkadot came from Ethereum’s sharding, as the team behind Polkadot is Parity Technology (which works on Ethereum’s client implementation). Polkadot is a blockchain network which allows multiple blockchains to communicate with each other. Let’s understand Polkadot architecture:

Polkadot has a ‘Relay Chain’ as a base chain on which multiple ‘Parachains’ (Parallel chains) will be bonded (hosted). These chains can specialize in a particular area (as shown in image), and anyone can build a Parachain atop another Parachain, and so on. These Parachains will use GRANDPA consensus (Polkadot’s default consensus mechanism). But if any chain such as Ethereum wants to use its own consensus mechanism, it can connect with Polkadot using Bridge.

Polkadot Parachains will have their own local state, consensus, rule and block producers (collators), and Relay Chain will maintain a global state secured by validators.

Interoperability

Interoperability is the main value proposition for these networks. This means providing a communication mechanism between different public/private chains that have distinct state machines and consensus. Polkadot’s Relay Chain is responsible for inter-messaging between these networks. It will allow two types of communication between the chains:

1- Asset transfer

2- Arbitrary message passing (ex- smart contract calls)

This communication will happen through Relay Chain, but securing these communications is a big challenge in the case of chain reorganize/fork (while having assets on other chains and transactions getting excluded). Polkadot solves this by providing a shared security model (discussed in the next section).

Security

Security is a must-have requirement for a blockchain network. Many successful networks, like Bitcoin and Ethereum, bootstrapped it. Polkadot follows the shared security model (or pooled security), providing security to every Parachain as soon as it gets attached to the Polkadot Relay Chain.

In Polkadot, validators are responsible for verifying and adding blocks into Relay Chain, and Collators bundle Parachain transactions and produce blocks for validators.

Number of validators each Parachain = Total Validator / Total Parachains

Having uniform security enables a high-security blockchain (such as Ethereum) to trust a low-security blockchain (such as Ethereum Classic). To discard malicious acts (ex- censorship), validators get assigned to different Parachains randomly. This leads to the “data-availability problem”, where validators need Parachain data to validate the blocks. Solving “data-availability problem” efficiently is a big challenge.

Each Parachain has to run a few Collators to bundle transactions of their respective Parachain and produce blocks for Relay Chain validators. Other than Validators and Collators, Polkadot also has Fishermen — these are bounty-hunters monitoring malicious activity by any Validator.

You need to lease DOTs (Polkadot’s token) to get a spot on Parachain. This is a barrier to entry in the Polkadot network. However, through bonding DOTs, you achieve security by default.

Polkadot has the ability to upgrade runtime without needing to fork. This is because it stores WebAssembly on-chain. This forces nodes to use this WebAssebly in case of an older version client. Because of this, off-chain coordination is not needed, which is better for security purposes.

Governance, Scalability and Other Aspects

In Polkadot, DOTs play a major role in governance. Relay Chain has around 10–1000 Parachain slots. These slots will be auctioned to the highest bidder and they need to lock up DOTs for a given lease time in Polkadot’s Proof-of-Stake system. Once a lease is over, these DOTs will be returned (think of renting a flat in a building).

Other than on-chain voting, Polkadot will also have a 24 people council — which will include Validators, dApp, and Parachain team members fulfilling the role of passive DOT holders. These members will be elected through approval voting and will have the power to change the rules for Relay Chain (such as block time, block reward, or how many DOTs required to host a Parachain), but they can’t kick out a Parachain from the network until its lease expires.

As Polkadot is not “live”, but a Proof of Stake system hosting parallel chains, it will need higher transaction capabilities. Multichain systems need to scale in two ways.

1- Horizontal scaling — Hosting more blockchains.

2– Vertical scaling — Allowing each blockchain with more scalability features such as transaction speed.

Polkadot’s vision a future with multiple Relay Chains (each hosting hundreds of Parachains), attached to a single root Relay Chain forming a tree structure and supporting 1000x-10000x transaction speed (in comparison to existing systems)… but this is (at the time of writing) still far in the future.

Technology, Current Status, and Ecosystem

Polkadot is built using Substrate, which is a set of tools to “build your own blockchain”. Using Substrate you can spin off your own blockchain which need not be hosted on Polkadot. The Substrate supports any language that compiles to WASM (Web Assembly) such as C, C++, Rust, etc…, giving more flexibility to developers.

Polkadot’s MainNet is set to go live in Q3 2019, however the TestNet is already live. The project has also launched a pre-production Kusama network for developers to beta-test the tech and find any bugs before MainNet launch.

There are multiple teams who are building multi-chain identity, data storage, and other solutions on Polkadot… and there is also a PolkaDao (DAO = Decentralized Autonomous Organization) to fund creators to build on/with Polkadot 🚀.

Cosmos

The Cosmos project follows a vision of “Internet of blockchains”. Cosmos takes a modular approach for building blockchains; it provides basic building blocks of blockchain as modules. There are three main building blocks to build a blockchain: Application layer, Consensus protocol, and P2P networking. The Cosmos project is divided into two parts:

1- Tendermint Core — is a combined package of Consensus protocol (Tendermint PoS) and P2P networking (Gossip protocol).

2- Cosmos — responsible for building application layer building blocks such as Cosmos SDK.

Architecture

Cosmos follows the “Hubs and Spokes” model. Cosmos call Spokes “Zones”. Here, a hub is responsible for inter-blockchain communication, and Zones are sovereign blockchains. There can be multiple hubs and each hub can have multiple zones.

Tendermint Core (“Tendermint”) is a consensus engine which will be used by every hub and zone. Remember, these hubs are also independent blockchains, and Cosmos Hub (Hub managed by Cosmos team) is the Cosmos blockchain. In these Hubs and Zones, only application layer will differ, which can be a State Machine (like Ethereum), or a UTXO dataset (like Bitcoin), or a completely private chain.

Tendermint exposes an interface called ABCI. The ABCI is an implementation of Tendermint socket protocol. ABCI is available in multiple languages, which means you can write an application in any language and connect with Tendermint’s consensus engine.

Cosmos’ modularity allows one to create a completely private blockchain (private chains are not possible on Polkadot) and yet be able to connect it with Hubs to send & receive tokens from other public/private blockchains.

For connecting blockchains like Ethereum and Bitcoin (which are already live), Cosmos has Peg Zones (similar to Polkadot’s bridges). Cosmos created Ethermint, which is an Ethereum State Machine sitting on Tendermint.

Interoperability

Cosmos uses the IBC protocol (Inter-Blockchain Communication protocol) for communication among blockchains to transfer tokens between blockchains. In the future, it may allow arbitrary message passing but currently optimized for token transfer. IBC protocol works with Tendermint consensus and is implemented as Basecoin plugin. In IBC, a blockchain works as a light client for another blockchain.

Security

As Cosmos prioritizes sovereignty, each Hub and Zone is responsible for its own security. Unlike Polkadot, Cosmos does not follow the shared security model; every hub and zone needs its own validator. Also, you don’t need to deposit ATOMs (Cosmos token) to connect to the hub.

IBC is still a work in progress; you don’t need any permission to connect with the hub. As Cosmos doesn’t have a shared security model, you need to trust other zones but IBC will address the issue of “can a zone be trusted or not?”.

Currently, 2 Hubs are live: Cosmos hub and Iris hub. As Tendermint PoS is optimal BFT (Optimal Byzantine Fault Tolerance), with accountability, anyone controlling 1/3rd of the nodes can halt the network, and 2/3rd nodes to fork or control the network. It’s a way to determine liability. Unlike Polkadot, Cosmos prioritizes safety over liveness.

Governance, Scalability and Other Aspects

Unlike Polkadot, in Cosmos, every blockchain is sovereign and has independent governance. So, when we are talking about Cosmos governance, we are talking about the Cosmos Hub (Cosmos blockchain) governance. It follows regular stake-weighted voting: anyone can submit a text proposal (some minimum number of Atoms required for this) and then there will be a 2-week voting period where validators or delegators can vote one of 4 choices (“Yes”, “No”, “No with Veto”, “Abstain”). After 2 weeks there will be a tally based on questions (shown in the image below), which will decide if the proposal gets implemented or rejected.

Tendermint PoS has instant finality, can have a block time on the order of 1 second, and handle thousands of transactions per second. For now, Cosmos is focused on providing a robust Tendermint implementation and scaling is not a priority for now.

Cosmos sovereign-first approach gives you more control and independence — with a security trade-off, however, some hub might provide security as a service in the future.

Technology, Current Status, and Ecosystem

Cosmos 🌌 is live and a lot of projects such as Binance Chain are building on it. Cosmos provides a development kit named Cosmos-SDK, which is currently available only in the GO language. So for now if you want to create a new blockchain on Cosmos, you need to use GO. Or, if you already have a blockchain in another language, then you can use a respective ABCI implementation and run it using Tendermint (ex- Ethermint).

Conclusion

Remember: building, securing, and maintaining a blockchain project is no simple task. These projects follow different approaches with the goal of helping developers to build blockchains in a more efficient way and enable next-generation use cases.

In 1999–2000 everyone wanted a .com; in 2008–09 everyone wanted a mobile app; in 2017–18 everyone was racing to build a token. In future, there might be a time where everyone wants to build their own blockchain. 😃

About QuikNode

QuikNode is building infrastructure to support the future of Web3. Since 2017, we’ve worked with hundreds of developers & companies, helping scale dApps and providing high-performance Ethereum nodes. We’re working on something interesting from the past few months and will be launching soon, so subscribe our newsletter for more updates!! 😃

Sources

https://medium.com/@davekaj/blockchain-interoperability-cosmos-vs-polkadot-48097d54d2e2

https://tendermint.com/docs/introduction/introduction.html

https://blog.chorus.one/an-overview-of-cosmos-hub-governance/

https://blog.cosmos.network/understanding-the-value-proposition-of-cosmos-ecaef63350d

https://blog.cosmos.network/a-tour-of-cosmos-for-developers-7517ba1b4045

https://medium.com/@juliankoh/5-differences-between-cosmos-polkadot-67f09535594b

https://github.com/tendermint/basecoin/blob/master/docs/guide/ibc.md

https://medium.com/polkadot-network/announcing-polkadao-fund-your-project-1891e6d895a

https://medium.com/polkadot-network/polkadot-the-foundation-of-a-new-internet-e8800ec81c7

https://medium.com/polkadot-network/everything-you-need-to-know-to-prepare-for-polkadot-32d08b929735

https://www.parity.io/substrate/

https://medium.com/polkadot-network/everything-you-need-to-know-to-prepare-for-polkadot-32d08b929735