eth_hash
Compute Ethereum hashes: raw keccak-256, EIP-191 personal sign, or EIP-712 typed-data digests. Accepts text, hex, or base64 input, outputs hex or base64.
Instructions
Compute an Ethereum hash: raw keccak-256, EIP-191, or EIP-712 typed-data.
Returns {kind, hash}. For kind=eip712 the result also carries {domain_separator, struct_hash}, the two EIP-712 component hashes. Note keccak-256 is the pre-NIST Ethereum variant, not hashlib's SHA3-256.
Example: eth_hash("keccak256", "hello", "text") -> hash="0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Hash flavor: 'keccak256' (raw Ethereum keccak-256), 'eip191' (personal_sign prefixed message), or 'eip712' (typed-data digest). | |
| data | Yes | Polymorphic: for keccak256/eip191 it is the message bytes decoded per input_format; for eip712 it is the typed-data JSON object (a JSON string or already-parsed dict with types/primaryType/domain/message) and input_format is ignored. | |
| input_format | No | How to decode `data` to bytes for keccak256/eip191 (ignored for eip712); hex is 0x-prefixed or bare. | text |
| output_format | No | Digest encoding: 'hex' is 0x-prefixed, or 'base64'. | hex |