---
title: "Keccak-256"
description: "Keccak with its original padding. Ethereum addresses and function selectors and storage slots plus Tron and Monero"
canonical_url: "https://hashes.agntn.dev/algorithms/keccak256"
---
# Keccak-256

> Keccak with its original padding. Ethereum addresses and function selectors and storage slots plus Tron and Monero

<algorithm-facts name="keccak256">



</algorithm-facts>

What Ethereum calls `keccak256` and too many libraries call `sha3`. The permutation is SHA-3's. The padding byte is the one from before NIST changed it, `0x01` instead of `0x06`, and that byte is enough to make every digest different.

```ts
create("keccak256").hash("transfer(address,uint256)").digest;
// "a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b"
create("keccak256").hash("").digest;
// "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
```

The first four bytes of the first one, `a9059cbb`, are the ERC-20 `transfer` selector you've seen in a thousand transactions. An EVM address is the last 20 bytes of Keccak-256 over the 64-byte public key without its `04` prefix. Pass that key as bytes, not as hex text. The empty digest is the `codeHash` of every account without code.

HMAC works too, for whatever needs a keyed Keccak.


## Sitemap

See the full [sitemap](https://hashes.agntn.dev/sitemap.md) for all pages.
