Keccak-256 hash, 4-byte function selector and 32-byte event topic from a Solidity signature
chain_selectorCompute the Keccak-256 hash of a Solidity function or event signature and derive the 4-byte function selector and the 32-byte event topic. Normalises the signature first — strips parameter names, expands uint to uint256 and the other aliases, flattens tuples — so a signature copied from source code produces the same selector as the canonical form. Also hashes arbitrary text or hex bytes with Keccak-256. Price: $0.05 per successful call, paid over x402 (USDC on Base).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Alternative to signature: raw data to Keccak-256 hash. Accepted: at most 8192 characters. | |
| kind | No | function (default), event or error. Accepted: function, event, error. | |
| encoding | No | Encoding of data: utf8 (default) or hex. Accepted: utf8, hex. | |
| signature | No | Solidity function, event or error signature, e.g. transfer(address to, uint amount). Accepted: at most 1024 characters. |