eth_hash
Compute an Ethereum hash: keccak-256, EIP-191, EIP-712, or EIP-7702.
Instructions
Compute an Ethereum hash: keccak-256, EIP-191, EIP-712, or EIP-7702.
Returns {kind, hash}. For kind=eip712 the result also carries
{domain_separator, struct_hash}, the two EIP-712 component hashes. For
kind=eip7702 data is the authorization tuple {chainId, address, nonce} and
the result carries the preimage that was hashed, 0x05 || rlp([chain_id,
address, nonce]) — the 0x05 keeps a signed authorization from ever being
replayed as a transaction. A chainId of 0 is not a missing value there: it
authorizes the delegation on every chain. 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 |
|---|---|---|---|
| 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; for eip7702 it is the authorization object {chainId, address, nonce}. | |
| kind | Yes | Hash flavor: 'keccak256' (raw Ethereum keccak-256), 'eip191' (personal_sign prefixed message), 'eip712' (typed-data digest), or 'eip7702' (delegation authorization tuple). | |
| 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 |