> ## Documentation Index
> Fetch the complete documentation index at: https://cosmos-docs-cosmjs-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Address Derivation

> How EVM address derivation differs from standard Cosmos in CosmJS.

Standard Cosmos and EVM chains both start from a compressed secp256k1 public key
but diverge in how they compute the 20-byte raw address.

**Standard Cosmos** (`rawSecp256k1PubkeyToRawAddress`):

```text theme={"system"}
compressed_pubkey (33 bytes)
  → sha256(compressed_pubkey)
  → ripemd160(hash)
  → 20-byte raw address
  → bech32 encode with prefix
```

**EVM** (`rawEthSecp256k1PubkeyToRawAddress`):

```text theme={"system"}
compressed_pubkey (33 bytes)
  → decompress to uncompressed (65 bytes)
  → strip the 0x04 prefix byte (64 bytes)
  → keccak256(64 bytes)
  → take last 20 bytes
  → bech32 encode with prefix
```

The raw address derivation matches Ethereum's `address = keccak256(pubkey)[12:]`
convention. Despite producing Ethereum-compatible addresses, CosmJS wraps them in
Bech32 encoding (e.g. `cosmos1...`) — not the `0x`-prefixed hex format used by
Ethereum wallets.
