EVM Module
Native EVM execution, address association, receipts, pointers, and precompile integration on chain ID 125.
Paxeer-X-Network/modules/evm/Overview
The EVM module (modules/evm/) provides full Ethereum Virtual Machine execution on Paxeer. It runs as a Cosmos SDK module and integrates with the execution engine to process EVM transactions with chain ID 125.
The module handles:
- EVM Transaction Processing: Execute Ethereum-format transactions
- Address Association: Map Cosmos bech32 addresses to EVM hex addresses
- Receipt Generation: Create transaction receipts with logs and status
- Pointers: Link ERC-20 tokens to native Cosmos denoms
- Precompiles: Expose Cosmos modules via EVM precompiled contracts
Message Types
The EVM module handles MsgEVMTransaction, which wraps a standard Ethereum transaction:
- Legacy transactions (type 0)
- EIP-2930 access list transactions (type 1)
- EIP-1559 dynamic fee transactions (type 2)
Transactions are submitted via the JSON-RPC eth_sendRawTransaction endpoint or the Cosmos SDK MsgEVMTransaction message.
Address Association
Paxeer-X-Network/engine/deps/xevm/keeper/address.goPaxeer addresses exist in two formats:
- Cosmos:
pax1...(bech32) - EVM:
0x...(hex, 20 bytes)
The EVM module maintains a bidirectional mapping between these formats. When a Cosmos account sends an EVM transaction, the module associates its pax1... address with the derived 0x... address. This allows:
- Cosmos accounts to interact with EVM contracts
- EVM accounts to interact with native Cosmos denominations
- Unified balance queries across both address formats
State Management
Paxeer-X-Network/engine/deps/xevm/keeper/state.goThe EVM module stores:
- Accounts: Nonce, balance (via bank module)
- Code: Contract bytecode (
keeper/code.go) - Storage: Contract storage slots (
keeper/state.go) - Receipts: Transaction receipts and logs (
keeper/receipt.go)
EVM state is stored in the module's KVStore. Account balances are managed by the bank module to maintain consistency with native token operations.
Transaction Execution Flow
When an EVM transaction is submitted:
- RPC receives
eth_sendRawTransactionor SDK receivesMsgEVMTransaction - Ante decorators under
modules/evm/ante/validate signatures, nonces, and transaction fees - Msg server routes to EVM module
- Module calls engine executor with
ExecuteTransactionFeeCharged - Executor runs EVM bytecode against state DB
- Module generates receipt (
keeper/receipt.go) with logs, gas used, status - Module emits events for indexing
Receipts
Paxeer-X-Network/modules/evm/keeper/receipt.goTransaction receipts include:
- Status: 1 (success) or 0 (revert)
- Gas Used: Total gas consumed
- Logs: Event logs emitted during execution
- Contract Address: For contract creation transactions
- Bloom Filter: For efficient log filtering
Execution stages receipts in a transient store and flushes them to the configured receipt store. GetReceipt delegates to that store; JSON-RPC exposes them through eth_getTransactionReceipt.
Pointers
Pointers are a Paxeer-specific feature that links ERC-20 token contracts to native Cosmos denoms. A pointer allows:
- ERC-20
transferto move native tokens via bank module - Native token transfers to appear as ERC-20 events
- Unified balance view across EVM and Cosmos APIs
Pointer contracts are deployed via the pointer precompile.
Precompile Integration
Paxeer-X-Network/engine/deps/xevm/keeper/precompile.goThe EVM module registers custom precompiled contracts that expose Cosmos SDK modules to EVM callers. Paxeer-specific addresses are registered by the precompile package, including bank at 0x1001 and address conversion at 0x1004. Standard Ethereum precompiles occupy a separate address range.
See Precompiles documentation for the full list of Paxeer precompiles (bank, staking, oracle, IBC, etc.).
Fee Collection
Paxeer-X-Network/engine/deps/xevm/keeper/fee.goEVM transaction fees are:
- Charged in PAX (native gas token)
- Reported using receipt gas usage and the effective gas price; estimation and charge settlement depend on the configured execution path
- Sent to the fee collector module
- Distributed to validators and stakers
EIP-1559 dynamic fees are supported with baseFee and priority fees.
Coinbase
Paxeer-X-Network/modules/evm/keeper/coinbase.go, keeper.goThe EVM block context sets COINBASE to the fee collector module’s associated EVM address through GetFeeCollectorAddress.
Chain ID
Paxeer uses EVM chain ID 125. This must match the chainId field in EIP-155 transaction signatures for replay protection. The Cosmos chain identifier is hyperpax_125-1.
Configuration
Paxeer-X-Network/modules/evm/types/params.go, types/config.go, keeper/params.goEVM module parameters include:
- Native units: PAX is the display currency; the implementation retains
uhpxas its Cosmos base denomination and converts it to 18-decimal EVM units - Fee bounds: Minimum and maximum fees per gas, target block gas, and dynamic adjustment parameters
- Storage gas: The default SSTORE set cost is 20,000 gas. Query the network’s EVM parameters when calculating costs for a deployment
- Chain Config: Fork activation times, including Cancun and Prague, and a configurable SSTORE cost
Genesis
Paxeer-X-Network/engine/deps/xevm/keeper/genesis.goGenesis state for the EVM module includes:
- Module parameters
- Pre-deployed contract code and storage
- Address associations
Logging
Paxeer-X-Network/engine/deps/xevm/keeper/log.goEVM event logs are emitted during transaction execution via the LOG0, LOG1, LOG2, LOG3, LOG4 opcodes. Logs are included in receipts and indexed for querying via eth_getLogs.
Deferred Operations
Paxeer-X-Network/engine/deps/xevm/keeper/deferred.goSome EVM operations (like balance updates from precompiles) are deferred and batched for commit. This avoids redundant state writes during execution and improves performance.