Skip to main content

How Signing Works

EVM wallets hash the serialized sign document with Keccak-256 before signing, whereas standard wallets use SHA-256:
The actual elliptic curve operation and signature format (64 bytes: r || s) are identical — only the pre-signing hash function differs.

Public Key Types

CosmJS represents public keys in two forms: Amino JSON and Protobuf. EVM chains use distinct types in each format to signal that the key requires Keccak-based address derivation. Amino JSON:
Protobuf (Any):
The underlying key bytes are identical (33-byte compressed secp256k1). The different type identifiers tell the chain how to derive the address from the key.

The Algo Identifier

The AccountData.algo field distinguishes EVM accounts from standard ones. Two naming conventions exist in the ecosystem:
  • "eth_secp256k1" — used by Keplr wallet, CosmJS wallets, and some chains
  • "ethsecp256k1" — used by Evmos, Cronos, and other EVM-compatible chains
CosmJS handles both through the isEthereumSecp256k1Account() utility:
The getAminoPubkey() function uses this check to select the correct encoding automatically. This is what SigningStargateClient calls internally when building transactions: