Cosmos Ecosystem Blog

Cosmos is the internet of blockchains - an ever-expanding ecosystem of interconnected, blockchain-based apps and services. Powered by the Interchain Stack, Cosmos boasts over 100 IBC-enabled chains.

Follow publication

A Beginner’s Guide to Ethermint

Interchain
Cosmos Ecosystem Blog
5 min readOct 27, 2017

--

Ethermint is the high speed implementation of Ethereum built on top of Tendermint. Part of Tendermint’s goal when we launch Ethermint together with the Cosmos Hub is to give developers the best of both worlds—the full capabilities of writing and executing smart contracts in Ethereum plus all the added performance benefits powered by Tendermint’s consensus engine.

Here’s a glance at the key features of Ethermint:

  • Web3 compatibility
  • Seriously high throughput
  • Horizontal scalability
  • Transaction finality

But first, an intro to Cosmos:

Go Ethereum (Geth) is fairly slow and doesn’t offer transaction finality due to Ethereum’s Proof-of-Work security model. Ethermint gives you the same ability to deploy smart contracts using the web3 RPC endpoints but those transfers run at 20x the speed because you can pack 20 times the transactions in a single block. Whereas a normal Go Ethereum process runs at ~12.5 transactions per second (TPS), Ethermint caps out at 200 TPS. We can do that because we are basing it on Tendermint PoS, which is much faster than Ethereum PoW.

Architecture: Hub & Spoke

Illustration: Cosmos hub & spoke architecture, where each zone can represent a different independent blockchain, or several of the same blockchains replicated for horizontal scalability

Tendermint Core & the Application Blockchain Interface (ABCI)

Tendermint consists of two chief technical components: a blockchain consensus engine and a generic application interface. The consensus engine, called Tendermint Core, ensures that the same transactions are recorded on every machine in the same order. The application interface, called the Application Blockchain Interface (ABCI), enables the transactions to be processed in any programming language.

Tendermint has evolved to be a general purpose blockchain consensus engine that can host arbitrary application states. Since Tendermint can replicate arbitrary applications, it can be used as a plug-and-play replacement for the consensus engines of other blockchain software. So one can take the current Ethereum code base, whether in Rust, or Go, or Haskell, and run it as an ABCI application using Tendermint’s consensus engine. Indeed, we did that with Ethereum and produced Ethermint, discussed here.

Another example of a cryptocurrency application built on Tendermint is the Cosmos network. Tendermint is able to decompose the blockchain design by offering a very simple API (ie. the ABCI) between the application process and consensus process.

Then, after we stand up our zones, we can have them communicate with each other over a protocol we’ve built, purposed for interoperability within the Cosmos network called the Inter-blockchain Communication (IBC).

Key Features

Full Web3 Compatibility

Ethermint is fully compatible with Ethereum’s web3 interface as well as the existing tooling around Ethereum clients via RPC endpoints. For a developer who, for instance, has built an awesome wallet UI on Ethereum, it would take a trivial amount of time to port that application and run it on Ethermint. It just requires a change of a single value in your code—the URL you’re pointing to.

There’s something called Truffle. Truffle allows you to deploy your smart contract, where it talks to the underlying Ethereum node. The thing is, it can substitute that Ethereum node with an Ethermint node, and like magic, you’ve deployed your smart contract in Cosmos. That’s part of the interoperability story, where it takes a developer 10 seconds or less to switch between networks.

An Order of Magnitude Higher Throughput

A major advantage of using Ethermint over using Go Ethereum is that Ethermint is indisputably faster, as it runs on Tendermint’s PoS engine. The effect of building on top of a consensus engine that allows much higher throughput is that it becomes cheaper to execute smart contracts. Because Tendermint can process up to 20 times the number of transactions as the Ethereum Virtual Machine (EVM), it means you would never experience the slowness of a backlogged network from a buildup of transactions which end up driving up fees. So executing a smart contract in Ethermint equates to something on the order of 20 to 50 times the savings in transaction fees.

Unlimited Horizontal Scalability

One of the major issues plaguing Ethereum currently is scalability. Ethereum can process ~12.5 TPS and that’s where the networks caps out. Ethermint currently caps out at 200 TPS.

However, let’s say that the Cosmos Hub is live and that the network reaches the 200 TPS cap. Due to the modular design of the hub and its peg zones, we can easily spin up a second Ethermint zone; now we get a throughput of 400 TPS. Add two more Ethermint zones and we get 800 TPS. This method of achieving horizontal scalability is unique to the Cosmos network. And it’s infinitely scalable.

Instant Transaction Finality

Neither Bitcoin nor Ethereum’s PoW consensus protocols make ‘final’ decisions, and blocks can theoretically be reorganized to some past block height given a 51% attack. A block is said to be ‘final’ when there is no chance of it being revised. Since Nakamoto consensus provides no such revision guarantees, it is not actually considered to be consensus safe.

In Ethereum’s current PoW construction, because blocks are never ‘final’, you have to wait 6 confirmations before you can be “certain” that your transaction has made it onto the blockchain. Typically, 6 confirmations in Bitcoin takes about 60 minutes, and it takes 2 minutes in Ethereum. In Ethermint, you get Tendermint’s property of transaction finality, where blocks are finalized within ~1 second on average.

How This is Made Possible on Ethermint

We can guarantee instant transaction finality due to the way Tendermint’s consensus mechanism works. In Tendermint, consensus nodes go through a multi-round voting proposal process first before coming to consensus on the contents of a block. When a supermajority of those nodes decide on a block, then they run it through the state transition logic. In Ethereum, the consensus process is inverted, where miners pick the transactions to include in a block, run state updates, then do “work” to try and mine the block.

Further Discussions

  • Ethermint on Twitter: @ethermint
  • Watercooler for developers on Matrix Chat Channel: #cosmos

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in Cosmos Ecosystem Blog

Cosmos is the internet of blockchains - an ever-expanding ecosystem of interconnected, blockchain-based apps and services. Powered by the Interchain Stack, Cosmos boasts over 100 IBC-enabled chains.

Written by Interchain

As stewards of the interchain, we advance the development of an interoperable, sustainable, and community-owned decentralized ecosystem. https://interchain.io/

Responses (6)

Write a response