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

Nonces and replay protection

A valid authorization may need to be usable only once.

LET’S PICTURE IT

A numbered ticket can be marked used after its first accepted redemption.

SEE IT FOR YOURSELF
Expected next nonce 4One fictional account
An account must consume transaction nonce four before five and sixNonce 4ReadyPayment ANonce 5Not submitted—Nonce 6Not submitted—

Nonce 4 is ready. Try submitting nonce 5 before including it.

A simplified local queue for ordinary account transactions. This model omits fee and other admission checks, and never signs or sends anything.

Define the replay boundary

Decide whether a message is single-use, limited-use or intentionally reusable. This is application behavior rather than a property inferred from the signature’s byte length.

Include the nonce in the signed data

The verifier checks the expected nonce or unused identifier. A nonce supplied outside the signed authorization can be changed without invalidating the signature.

Consume consistently

Mark the authorization used as part of the same successful state transition. Account for reentrancy so a callback cannot redeem the same permission before consumption is effective.

Separate nonce namespaces

Transaction nonces, order identifiers and application signing nonces can be different systems. Document which signer and domain owns each sequence or used-message set.

Inspect the distinction

signed action includes nonce 7
verifier requires nonce 7 unused
success consumes nonce 7
repeat submission → rejected

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

Should a replay-control nonce be bound by the signed message?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

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