Crypto Wallets (or Accounts) can be created and represented in unique ways on different blockchains. For developers who interface with account types on a Cosmos EVM chain, e.g. during wallet integration on their dApp frontend, it is therefore important to understand that accounts in the Cosmos EVM are implemented to be compatible with Ethereum type addresses.
cosmos1...
). Addresses are also associated with messages to identify the sender of the message.
The PrivKey is used to generate digital signatures to prove that an address associated with the PrivKey approved of a given message. The proof is performed by applying a cryptographic scheme to the PrivKey, known as Elliptic Curve Digital Signature Algorithm (ECDSA), to generate a PubKey that is compared with the address in the message.
Account
type to implement a HD wallet that is compatible with Ethereum type addresses. It uses Ethereum’s ECDSA secp256k1 curve for keys (eth_secp265k1
) and satisfies the EIP84 for full BIP44 paths. This cryptographic curve is not to be confused with Bitcoin’s ECDSA secp256k1 curve.
The root HD path for EVM-based accounts is m/44'/60'/0'/0
. It is recommended to use the Coin type 60
to support Ethereum type accounts, unlike many other Cosmos chains that use Coin type 118
(list of coin types
The custom Cosmos EVM EthAccount satisfies the AccountI
interface from the Cosmos SDK auth module and includes additional fields that are required for Ethereum type addresses:
Addresses
/PubKeys
available by default on the Cosmos EVM:
eth_secp256k1
cosmos
cosmospub
EthAccount
can be represented in both Bech32 (e.g. cosmos1...
) and hex (0x...
) formats for Ethereum’s Web3 tooling compatibility.
appd debug addr <address>
can be used to convert an address between hex and bech32 formats:
appd keys
) only supports addresses and public keys in Bech32 format.keys show
command with the flag --bech <type>
to obtain different address formats:
eth_accounts
and personal_listAccounts
documentation.