In this track: Cryptography with intuition
advanced · 4 MIN READ

Domain separation explained

Bind a digest to the intended protocol context.

LET’S PICTURE IT

The same form number should not grant permission in two unrelated offices.

SEE IT FOR YOURSELF
From exact bytes to a Keccak-256 fingerprintStep 1 / 4
From exact bytes to a Keccak-256 fingerprintUTF-8 texthelloExact spelling mattersA hash commits to bytes, not a visual interpretationFive input bytes68656c6c6fLiteral text 0x68656c6c6f would be a different text inputInput bytes68 65 6c 6c 6f5 bytesKeccak-256Deterministic calculation32-byte resultUse Keccak-256, not an interchangeable SHA3-256 assumption0x1c8aff95…36deac8Fixed output: 32 bytesSame input bytes → same outputA fingerprint does not prove that the input is truthful or safe

The text hello is a particular sequence of characters. Case or text normalization can change the encoded bytes.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Identify the reuse risk

Identical byte payloads can occur in different applications or actions. A signature accepted everywhere for that digest may authorize more than the signer intended.

Include explicit context

A domain can identify an application, version, chain or verifying contract. The exact fields depend on the signing standard and protocol.

Encode unambiguously

Adding context is useful only when the combined encoding has clear boundaries and the verifier checks the expected values. Ambiguous concatenation can undermine that purpose.

Keep replay control separate

Domain separation narrows the context but does not automatically prevent repeated use inside that same context. Nonces or other stateful consumption rules address that separate problem.

Inspect the distinction

context A + action bytes → digest A
context B + same action bytes → digest B

The verifier must enforce the intended context.

These are local teaching values, not a signature request or a live-chain lookup.

TURN UNDERSTANDING INTO PRACTICEOpen the Keccak-256 →
QUICK CHECK · NO PRESSURE

Does domain separation alone prevent every repeat use inside one contract?

Your progress stays in this browser.
Keep exploring the original referenceEthereum Improvement Proposals ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.