Press ESC to close

EIP-712 Explained: Readable Signatures Still Need Replay Protection

A wallet can show a neatly formatted signing request and still leave the user exposed to an overly broad approval. EIP-712 improves how structured data is encoded and presented, but the application determines what a signature authorises. This technical explainer follows a hypothetical signed order to show why readability, scope and replay protection need to work together.

TL;DR

  • EIP-712 gives structured messages a standard signing format.
  • Domain separation and single-use enforcement address different problems.
  • Readable labels need to match the authority the receiving application actually grants.

The message needs both meaning and context

The EIP-712 standard defines typed structured-data signing and domain separation. It explicitly leaves replay protection outside its scope. A domain can distinguish an intended application or contract context, while the application still needs rules governing repeated use of an otherwise valid message.

Imagine a seller authorising a marketplace to sell 50 fictional tokens for at least 500 units of a payment asset. A useful message would identify the assets, the amount, the intended recipient and the relevant conditions. A request labelled simply confirm could conceal how much authority the seller is granting.

The surrounding context matters as well. Approval intended for one marketplace should not silently become approval for another contract that interprets the same fields differently. The verifier must check the intended domain, not merely recover an address and assume that any signature from it applies to the current interaction.

MetaMask’s signing documentation treats the domain name, top-level type and field names as part of the user-facing security interface. That is a useful design principle: the labels are part of how people judge the request, so they should accurately describe what the code will accept.

One approved order should have one defined lifetime

Return to the hypothetical seller. They intend to sell 50 tokens once. If the marketplace accepts the same signed order repeatedly, a buyer might submit it again after the first execution. The signature remains mathematically valid even though another sale would exceed the seller’s intended instruction.

An application can give the order an identifier and record when that identifier has been consumed. If partial fills are supported, it needs a different accounting rule that tracks the remaining authorised quantity. Merely attaching a number called nonce to the message is insufficient unless the receiving system enforces its meaning.

The same applies to expiry. Suppose the seller intends the quote to last 30 minutes. The verifier must reject it after the agreed deadline. A time displayed by a webpage has no protective effect if the contract or service processing the order ignores it.

Cancellation creates another state transition. If the seller revokes an unfilled order, the system needs to record that decision in a form every relevant execution path respects. Deleting the order from a local list might stop the interface showing it while leaving a previously shared signature usable elsewhere.

The approval screen must explain the actual consequence

Readable data can help users notice an unexpected amount or recipient, but it cannot establish that the destination contract behaves honestly. A familiar project name in a field is also not independent proof of identity. Applications should make the intended context verifiable without assuming that branding alone provides assurance.

There is a practical tension between completeness and comprehension. A screen that dumps every internal field can overwhelm a user, while a screen that hides material conditions can mislead them. The useful middle ground explains the action and its limits, with technical details available for inspection when necessary.

For the seller, the essential questions are concrete: what can leave the account, what must be received, who can submit the order and when the permission ends. The application should answer those questions before requesting the signature and retain an understandable record afterward.

EIP-712 provides a common structure for presenting and verifying an approval. The complete protection comes from connecting that structure to clear application rules: the intended context, the permitted quantity, the lifetime and the record that prevents a completed or cancelled instruction from being used again.

Written by the News Desk and edited by Samuel Rae.

Leave a Reply

Your email address will not be published. Required fields are marked *