Ethereum Virtual Machine execution environment for Cosmos SDK
x/vm
module from cosmos/evm provides a fully compatible Ethereum Virtual Machine execution environment as a Cosmos SDK module.
Parameter | Type | Default | Description |
---|---|---|---|
evm_denom | string | "aatom" | Token denomination for EVM transactions (18 decimals) |
extra_eips | []int64 | [] | Additional EIPs to activate beyond hard fork defaults |
allow_unprotected_txs | bool | false | Allow non-EIP155 replay-protected transactions |
active_static_precompiles | []string | [] | Activated static precompile addresses |
evm_channels | []string | [] | IBC channel IDs for EVM-compatible chains |
access_control | AccessControl | Permissionless | Permission policy for EVM operations |
Fork | Default | Type | Opcodes/Features Added |
---|---|---|---|
homestead_block | 0 | Block | DELEGATECALL |
byzantium_block | 0 | Block | REVERT, RETURNDATASIZE, STATICCALL |
constantinople_block | 0 | Block | CREATE2, EXTCODEHASH, SHL/SHR/SAR |
istanbul_block | 0 | Block | CHAINID, SELFBALANCE |
berlin_block | 0 | Block | Access lists (EIP-2929, 2930) |
london_block | 0 | Block | BASEFEE, EIP-1559 |
shanghai_time | 0 | Timestamp | PUSH0 |
cancun_time | 0 | Timestamp | Transient storage, blob transactions |
prague_time | nil | Timestamp | TBD |
verkle_time | nil | Timestamp | Verkle trees |
Address | Contract | Gas Cost | Description |
---|---|---|---|
0x0000...0100 | P256 | 3000 | P256 curve verification |
0x0000...0400 | Bech32 | 5000 | Bech32 address encoding |
0x0000...0800 | Staking | Variable | Delegation operations |
0x0000...0801 | Distribution | Variable | Reward claims |
0x0000...0802 | ICS20 | Variable | IBC transfers |
0x0000...0803 | Vesting | Variable | Vesting account ops |
0x0000...0804 | Bank | Variable | Token transfers |
0x0000...0805 | Gov | Variable | Governance voting |
0x0000...0806 | Slashing | Variable | Validator slashing info |
from
addressKey Prefix | Description | Value Type |
---|---|---|
0x01 | Parameters | Params |
0x02 | Contract code | []byte |
0x03 | Contract storage | [32]byte |
Key Prefix | Description | Value Type | Lifetime |
---|---|---|---|
0x01 | Transaction logs | []Log | Per block |
0x02 | Block bloom | [256]byte | Per block |
0x03 | Tx index | uint64 | Per block |
0x04 | Log size | uint64 | Per block |
0x05 | Gas used | uint64 | Per tx |
Event | Attributes | When Emitted |
---|---|---|
ethereum_tx | amount , recipient , contract , txHash , txIndex , txGasUsed | Every EVM transaction |
tx_log | txLog (JSON) | When contracts emit events |
message | sender , action="ethereum" , module="evm" | Every message |
Event | Attributes | When Emitted |
---|---|---|
block_bloom | bloom (hex) | End of each block with EVM txs |
Method | Description |
---|---|
eth_accounts | List accounts |
eth_blockNumber | Current block number |
eth_call | Execute call without tx |
eth_chainId | Get chain ID |
eth_estimateGas | Estimate gas usage |
eth_gasPrice | Current gas price |
eth_getBalance | Get account balance |
eth_getBlockByHash | Get block by hash |
eth_getBlockByNumber | Get block by number |
eth_getCode | Get contract code |
eth_getLogs | Get filtered logs |
eth_getStorageAt | Get storage value |
eth_getTransactionByHash | Get tx by hash |
eth_getTransactionCount | Get account nonce |
eth_getTransactionReceipt | Get tx receipt |
eth_sendRawTransaction | Submit signed tx |
eth_syncing | Sync status |
Operation | EVM Gas | Cosmos Gas | Notes |
---|---|---|---|
Basic ops | 3-5 | 3-5 | 1:1 mapping |
SLOAD | 2100 | 2100 | Cold access |
SSTORE | 20000 | 20000 | New value |
CREATE | 32000 | 32000 | Contract deploy |
Precompile | Variable | Variable | Set per precompile |
Issue | Cause | Solution |
---|---|---|
”out of gas” | Insufficient gas limit | Increase gas limit or optimize contract |
”nonce too low” | Stale nonce | Query current nonce, retry |
”insufficient funds” | Low balance | Ensure balance > value + (gasLimit × gasPrice) |
“contract creation failed” | CREATE disabled or restricted | Check access_control settings |
”precompile not active” | Precompile not in active list | Enable via governance |