Nonce (account)
An account nonce is a sequence value used to order transactions from an account and help prevent the same signed transaction from being replayed repeatedly.
✦ Key Insight
Nonce problems are a common cause of stuck or replaced transactions. Understanding nonces also helps explain replay protection, transaction ordering, and why sending two transactions with the same nonce can cause one to replace the other.
✕ Common Misconceptions
Do not confuse an account nonce with the nonce used in proof-of-work mining. Also avoid manually changing nonces unless you understand replacement behavior, because you can unintentionally cancel or supersede a pending transaction.
Detailed Explanation
Aliases and acronyms: Account nonce; transaction nonce; Ethereum nonce; sequence number
Plain-English explanation: On Ethereum, a traditional externally owned account has a transaction count used as its nonce. Each new transaction normally uses the next expected value. If a nonce is missing, later transactions can remain pending until the sequence is resolved.
Analogy: It works like numbered checks: check 42 belongs after check 41, helping the system distinguish one authorized instruction from another.
How it works: A sender signs a transaction containing a nonce. The network checks that the nonce matches the account's expected sequence under the relevant transaction rules. Once the transaction executes, the account's sequence advances. Account-abstraction systems may use more flexible keyed nonce designs.
FAQs
Q: Can two Ethereum transactions use the same account nonce?
A: They can be broadcast, but under normal account rules only one transaction for that nonce can ultimately take effect in the canonical sequence.
Q: Why is my later transaction stuck?
A: A lower nonce may still be pending or missing, causing later sequential transactions to wait.
Q: Is a nonce secret?
A: No. It is transaction/account state used for sequencing, not a password or private key.
Sources
In Practice
Dig Deeper
Confirmation
A confirmation indicates that a blockchain transaction has been included in a block and recognised by the network. Additional blocks built afterward can provide further confidence that the transaction will remain part of the accepted blockchain history.
Mempool
A mempool is a node's temporary pool of valid, unconfirmed transactions waiting to be included in a block.
Transaction
A transaction is an action submitted to a blockchain that changes or records blockchain state. Transactions can transfer cryptocurrency, swap tokens, interact with smart contracts, stake assets, vote, mint tokens, or perform other network operations.
