โ† Cosmos

๐Ÿ—๏ธ Address from Key

Derive an address from a secp256k1 public key โ€” the standard Cosmos way or the Ethereum-style (ethsecp256k1) way.

How it works

secp256k1 (most Cosmos chains): address = RIPEMD-160(SHA-256(33-byte compressed public key)).

ethsecp256k1 (Injective, Evmos, Cronos and other Ethermint chains): address = last 20 bytes of Keccak-256(64-byte uncompressed public key without its 0x04 prefix) โ€” the same bytes as the account's Ethereum 0x address.

Both kinds are shown as bech32 with the chain's prefix. Uncompressed keys are compressed automatically for the Cosmos form.