Account Structure
In the Cosmos SDK, an account designates a pair of public key (PubKey) and private key (PrivKey). The derivation path defines what the private key, public key, and address would be. Cosmos blockchains support creating accounts with mnemonic phrases using hierarchical deterministic key generation (HD keys). HD keys generate addresses by combining the mnemonic phrase with a derivation path.EVM Accounts
Cosmos EVM defines a customAccount type implementing an HD wallet compatible with Ethereum addresses using:
- Ethereum’s ECDSA secp256k1 curve (
eth_secp265k1) - EIP84 for full BIP44 paths
- Root HD path:
m/44'/60'/0'/0(Coin type60for Ethereum compatibility)
AccountI interface with additional Ethereum-specific fields:
SetCodeHash functionality.
Address Formats
Bech32 and Hex Representations
EthAccount can be represented in both Bech32 (cosmos1...) and hex (0x...) formats for compatibility with both ecosystems.
Bech32 (default for Cosmos SDK):
Address Types
BIP-0173 defines Bech32 format with human-readable prefixes: User Accounts (eth_secp256k1):
- Address:
cosmosprefix, 20 bytes - Pubkey:
cosmospubprefix, 33 bytes (compressed)
eth_secp256k1):
- Address:
cosmosvaloperprefix, 20 bytes - Pubkey:
cosmosvaloperpubprefix, 33 bytes (compressed)
ed25519):
- Address:
cosmosvalconsprefix, 20 bytes - Pubkey:
cosmosvalconspubprefix, 32 bytes
Address Conversion
Convert between formats using the CLI:Querying Accounts
Query accounts via CLI, REST, or JSON-RPC: CLI:eth_accounts, personal_listAccounts
Related Documentation
- x/vm Module - Ethereum account implementation details