Avalanche
Avalanche
Ready to call this in production?
Free tier covers personal projects. Pay-as-you-go scales without a card.
Avalanche
Free tier covers personal projects. Pay-as-you-go scales without a card.
web3_sha3 computes the Keccak-256 hash of hex-encoded input and returns it as a 32-byte hex value. Despite the "sha3" in the name, this is Keccak-256 — the original submission, not the later NIST SHA3-256 standard — which is exactly the hash function the Avalanche C-Chain EVM uses for event topics, function selectors, and storage slots. Since the C-Chain is EVM-equivalent (the chain where AVAX pays for gas under Snowman/Avalanche consensus), the hashes it produces match what your contracts compute on-chain. Send the request to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, 0xa86a).
Transfer(address,address,uint256) — to build the topics array for eth_getLogs filters against C-Chain contracts such as Aave or Trader Joe.eth_call.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | data | string | Yes | Arbitrary data to hash, provided as a 0x-prefixed hex string. Empty input (`"0x"`) is valid. |
| Type | Description |
|---|---|
| string | 0x-prefixed 32-byte (64-character) Keccak-256 hash of the input. |
Try it live in the Avalanche playground.
| Code | Message | Cause |
|---|---|---|
-32602 | invalid argument | Input is not a valid 0x-prefixed hex string. |
sha3 function will produce different output unless it specifically implements the Ethereum Keccak variant — make sure your local tooling uses the right one so it agrees with what the C-Chain computes.Parameters
0x-prefixed hex string