Nonce
One-time value used to order transactions or make data unique.
A nonce is a number or other value intended to be used once within a defined context. In blockchain systems, it helps make messages unique, prevent replay, order transactions, or satisfy proof-of-work requirements. The exact meaning depends on the protocol, so an account nonce and a mining nonce solve different problems.
On Ethereum and similar account-based networks, each externally owned account has a transaction count. The next transaction uses the next available nonce, beginning with zero. Validators process transactions from that account in nonce order. This rule prevents the same signed transaction from being executed repeatedly and provides a predictable sequence when one address submits several actions.
If a transaction with a low nonce remains pending, later transactions from the same account may also wait. A user can often speed it up by resubmitting the same action with the same nonce and a higher fee. A cancellation is usually a replacement transaction, commonly sending zero value back to the same address. It only works if the replacement is accepted and confirmed before the original.
Bitcoin mining uses the term differently. Miners change a nonce and other block data while searching for a block header hash below the network target. This proof-of-work nonce is not an account transaction counter. Smart contracts may also maintain their own nonces for permits, orders, governance votes, or cross-chain messages so a valid signature cannot be replayed after use.
Nonces also appear in authentication and cryptography. An API can issue a fresh challenge that a client signs, proving control without sending a reusable password. Encryption modes may require a unique nonce for every message under the same key. Reusing one can seriously weaken security, even though the value itself does not need to be secret. Developers must follow the exact requirements of the chosen algorithm.
Common mistakes include manually assigning stale account nonces, sending parallel transactions without coordination, confusing pending and confirmed counts, or treating every nonce as random. Wallets should manage ordinary transaction sequencing automatically. High-volume systems need centralized or carefully synchronized nonce allocation, replacement monitoring, and recovery after restarts. A nonce is simple data, but correct scope, uniqueness, and ordering are essential to transaction reliability and replay protection.
Frequently asked questions
- On account-based networks such as Ethereum, later transactions generally wait when a lower nonce is missing. For example, nonce 12 cannot execute while nonce 11 remains pending. The sender can resubmit the missing transaction, replace it with a higher-fee version, or send a valid self-transfer using that nonce. Wallet behavior and replacement rules vary by network.
- A confirmed account transaction nonce cannot normally be used again on the same chain because the account counter has advanced. While a transaction is pending, the sender may submit a replacement with the same nonce and a sufficiently higher fee. Nonces used in signatures or APIs follow different rules, but reuse can enable replay attacks when uniqueness is required.
- First inspect the address on a reliable block explorer and compare its confirmed and pending nonces. Use the wallet's speed-up feature to replace the transaction with the same nonce and a higher fee, or cancel it with a higher-fee self-transfer if supported. Do not guess blindly, because replacing the wrong nonce can leave the queue blocked or execute an unwanted transaction.
