A Deep Look Into Cosmos — the Internet of Blockchains

A Brief History of Decentralized Applications

Blockchains enable decentralized applications (dApps) to execute autonomously. The first of these blockchains is Bitcoin, which is a simple application that enables people to transfer value to other Bitcoin users. We quickly discovered that blockchains enable a wide range of possibilities — markets for file storage, prediction markets, decentralized autonomous organizations, and so on. However, back in 2013, the only way to build these things was to build a new blockchain from scratch which served their intended purpose. Developers had two options: write the entire application, networking and consensus layer from scratch, or fork the Bitcoin codebase (messy, hard-to-read C++ code) and adapt it to their intended purpose.

Tendermint Consensus Algorithm

A consensus algorithm is ways for nodes in a distributed system to come to agreement about some state of the world. In public-blockchain-land, we are only concerned about algorithms that can tolerate malicious behavior, i.e “Byzantine Fault Tolerant”, or BFT. Within this class of algorithms, we have seen two families of consensus protocols — classic consensus protocols such as Paxos or PBFT, and Nakamoto Consensus like Proof-of-Work.

From Emin Gun Sirer’s Avalanche Presentation
  1. Finality
    Unlike Proof-of-work chains, blocks in Tendermint are final once there have been 2/3 signatures from the validators — they cannot be reversed or reverted. In Nakamoto chains like Bitcoin, we say that transactions are “final” after 6 confirmations, because the probability of a block being reversed via a chain reorganization is very small after 6 confirmations. However, as Kevin Sekniqi showed, the number of confirmations for a 10⁻⁵ guarantee of transaction reversion depends on the amount of mining power an adversary has. Attackers have used this fact to double spend exchanges, profiting in millions of dollars. Instead, by using a consensus algorithm with finality, we can be sure that transactions will not get rolled back after a single block.
  2. Safety over Liveness
    Assuming a blockchain network splits into two (e.g Chinese Firewall), PoW chains will fork into two. Eventually, the chain will reorganize to select the longest chain as the canonical chain, and all the transactions on the other fork will get reversed. In Tendermint however, when there is a network partition, the protocol will choose to make no progress until 2/3 of the validators come to agreement once again. This tradeoff ensures that there is always “one source of truth” and the blockchain is always consistent.
  3. Partial Synchrony
    A synchronous network has a known upper-bound of message delivery time. In Bitcoin, this bound is set to be approximately 10 minutes, imposing an artificial time delay in the network for all network participants to listen for a new block. On the other hand, Tendermint operates under a partial synchrony assumption, meaning that it does not rely on some fixed timing assumptions to make progress. This means that the bottleneck in the progress of the chain is the real network speed, not an artificial time delay set by the protocol — making this protocol faster than most Proof-of-work protocols.

Cosmos SDK (Software Development Kit)

After developing and testing Tendermint, Jae and Ethan built the Cosmos SDK — a software development kit for developers to quickly and simply build blockchains using the Tendermint consensus algorithm and pairing it with a sybil resistance mechanism using Proof-of-Stake. Using the Cosmos SDK, developers can easily build and deploy blockchains without worrying about the consensus layer and networking layer, only needing to focus on writing their application logic directly.

Taken from Sunny Agarwal’s Presentation

Cosmos Network

Naturally, an important question to ask is how these Tendermint-chains can communicate with each other. In the Ethereum ecosystem, holding the base currency ETH allows users to interact with various smart contracts. However, some dApps on Ethereum like Numerai have their own currency NMR, which a user needs to hold to use some Numerai-specific operations like Staking. The best way to do this is to swap ETH for NMR in a decentralized exchange, then spend the NMR within the Numerai contract. This is even harder for cross-chain communication. If I own BTC and want to use a contract within Ethereum, I will need to send BTC to a centralized exchange (1 hour for confirmation), exchange it for ETH, withdraw ETH to a wallet, then spend it on the smart contract. There have been some specific implementations of bridges between two blockchains like the BTC Relay, but this is specific to only Bitcoin-Ethereum interoperability. Building a general protocol for all blockchains to interoperate is a much more Herculean task.

Example of the Cosmos Network

Cosmos Hub

The centerpiece of the Cosmos Network is the Cosmos Hub. The Cosmos Hub keeps a record of the total number of tokens in each zone. Because of this, zones can send tokens between each other seamlessly without the need of an exchange. The more projects that build on Cosmos and connect to the Cosmos Hub, the more useful the hub becomes since it will facilitate all communication between zones.

Macro view of the Cosmos Network, Cosmos Hub, and Tendermint

Concluding Thoughts & Current State of Cosmos

As of September 2018, the Cosmos team has proven that Tendermint consensus works, launched the Cosmos-SDK, and are on track to launch the Cosmos Hub by the end of 2018. However, this launch will be without the IBC, meaning that other Tendermint-chains cannot connect to the Cosmos Hub just yet, to ensure that the Hub works first. Soon after launch, they will be rolling out the IBC and Ethermint, allowing Ethereum developers to port over to Cosmos with ease. The team also already has a specification for making Cosmos interoperable with Proof-of-work Ethereum, but that will be rolled out a few months after the IBC is released.

  • Proliferation of Tendermint-based blockchains
  • Reliability and effectiveness of Cosmos Validators
  • Speed of deployment & out-executing the competition

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Julian Koh

Julian Koh

building @ribbonfinance, previously @coinbase