This document defines the specification of the Ethereum Virtual Machine (EVM) as a Cosmos SDK module.

Since the introduction of Ethereum in 2015, the ability to control digital assets through smart contracts has attracted a large community of developers to build decentralized applications on the Ethereum Virtual Machine (EVM). This community is continuously creating extensive tooling and introducing standards, which are further increasing the adoption rate of EVM compatible technology.

The growth of EVM-based chains (e.g. Ethereum), however, has uncovered several scalability challenges that are often referred to as the trilemma of decentralization, security, and scalability. Developers are frustrated by high gas fees, slow transaction speed & throughput, and chain-specific governance that can only undergo slow change because of its wide range of deployed applications. A solution is required that eliminates these concerns for developers, who build applications within a familiar EVM environment.

The x/evm module provides this EVM familiarity on a scalable, high-throughput Proof-of-Stake blockchain. It is built as a Cosmos SDK module which allows for the deployment of smart contracts, interaction with the EVM state machine (state transitions), and the use of EVM tooling. It can be used on Cosmos application-specific blockchains, which alleviate the aforementioned concerns through high transaction throughput via Tendermint Core, fast transaction finality, and horizontal scalability via IBC.

The x/evm module is part of the ethermint library.


  1. Concepts

  2. State

  3. State Transitions

  4. Transactions

  5. ABCI

  6. Hooks

  7. Events

  8. Parameters

  9. Client

Module Architecture

NOTE:: If you're not familiar with the overall module structure from the SDK modules, please check this document as prerequisite reading.

β”œβ”€β”€ client
β”‚   └── cli
β”‚       β”œβ”€β”€ query.go      # CLI query commands for the module
β”‚    Β Β  └── tx.go         # CLI transaction commands for the module
β”œβ”€β”€ keeper
β”‚   β”œβ”€β”€ keeper.go         # ABCI BeginBlock and EndBlock logic
β”‚   β”œβ”€β”€ keeper.go         # Store keeper that handles the business logic of the module and has access to a specific subtree of the state tree.
β”‚   β”œβ”€β”€ params.go         # Parameter getter and setter
β”‚   β”œβ”€β”€ querier.go        # State query functions
β”‚   └── statedb.go        # Functions from types/statedb with a passed in sdk.Context
β”œβ”€β”€ types
β”‚Β Β  β”œβ”€β”€ chain_config.go
β”‚Β Β  β”œβ”€β”€ codec.go          # Type registration for encoding
β”‚Β Β  β”œβ”€β”€ errors.go         # Module-specific errors
β”‚Β Β  β”œβ”€β”€ events.go         # Events exposed to the Tendermint PubSub/Websocket
β”‚Β Β  β”œβ”€β”€ genesis.go        # Genesis state for the module
β”‚Β Β  β”œβ”€β”€ journal.go        # Ethereum Journal of state transitions
β”‚Β Β  β”œβ”€β”€ keys.go           # Store keys and utility functions
β”‚Β Β  β”œβ”€β”€ logs.go           # Types for persisting Ethereum tx logs on state after chain upgrades
β”‚Β Β  β”œβ”€β”€ msg.go            # EVM module transaction messages
β”‚Β Β  β”œβ”€β”€ params.go         # Module parameters that can be customized with governance parameter change proposals
β”‚Β Β  β”œβ”€β”€ state_object.go   # EVM state object
β”‚Β Β  β”œβ”€β”€ statedb.go        # Implementation of the StateDb interface
β”‚Β Β  β”œβ”€β”€ storage.go        # Implementation of the Ethereum state storage map using arrays to prevent non-determinism
β”‚Β Β  └── tx_data.go        # Ethereum transaction data types
β”œβ”€β”€ genesis.go            # ABCI InitGenesis and ExportGenesis functionality
β”œβ”€β”€ handler.go            # Message routing
└── module.go             # Module setup for the module manager

Last updated