In this track: Cryptography with intuition
Nonces and replay protection
A valid authorization may need to be usable only once.
A numbered ticket can be marked used after its first accepted redemption.
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 → rejectedThese are local teaching values, not a signature request or a live-chain lookup.
Should a replay-control nonce be bound by the signed message?
Otherwise the nonce can be changed independently of the signature.
Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.