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

EIP-712 typed structs

Type definitions participate in the signed digest.

LET’S PICTURE IT

A form’s field labels and types matter alongside the filled-in values.

SEE IT FOR YOURSELF
From a public address to a verified signatureStep 1 / 4
From a public address to a verified signaturePublic address0x0000…0001Share to receiveAnother personCan read the addressCannot sign for youPublic identifier ≠ secret authorizationLocal signerPrivate key stays hereSign the chosen requestSigned requestMessage + signatureSecret key not includedThe moving packet represents a signature, not a keySignatureCheck the exact messageCheck the signing contextVerificationAuthorization checkedIntent still mattersValidity and safety are different questionsWallet interfaceReads public dataRequests authorizationNetwork stateBalances and recordsIndependent verificationNo wallet is connected in this local illustration

An address is public receiving information. It is not the private key that authorizes actions.

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

Declare the primary type

A typed message identifies a primary struct type and its field definitions. A uint256 count and a string text are distinct typed fields, not unlabeled concatenated values.

Use standard field hashing

Dynamic strings and bytes are hashed under the typed-data procedure, and nested structs have their own structured hashes. Ordinary abi.encode of a raw object is not a complete implementation.

Preserve exact meaning

Changing a field’s type, order or struct definition can change the digest. Two wallet displays that look similar can still represent different typed schemas.

Compare independent fixtures

Keep the schema, domain and message together in test vectors. Check the verifier and signer produce the same digest before relying on a recovered signature.

Inspect the distinction

Note(uint256 count,string text)
values: count = 7, text = hello
digest with the previous domain: 0xf4184aa7249f3a4ee3caca75f9d9491ec1822f186e774158ab53e869d73255ab

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 the typed struct definition affect the digest?

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.