
A nonce is a number or counter used only once to ensure that a specific action is performed a single time and in the correct sequence. You can think of it as a queue number or a one-time verification code that becomes invalid after it’s used or expires.
In blockchain, nonce typically appears in three forms: sequential numbering at the account level (controlling transaction order from the same address), the constantly changing value in mining attempts (aiming to find a block hash that meets the network difficulty), and the challenge code in login signatures (preventing replay of old messages). Across these use cases, the main objectives are uniqueness and replay protection.
Without nonce, old transactions or signatures could be resubmitted, leading to replay attacks. A replay attack occurs when an attacker copies and resends a previously valid message, causing the system to repeat operations that should not happen again.
Nonce also enforces transaction order for a single address. Without this control, later transfers could be executed before earlier ones, breaking smart contract logic and potentially locking funds or causing strategic failures. Therefore, major blockchains use nonce at the protocol level to maintain consistency and security. As of 2025, this mechanism is foundational in EVM-based ecosystems, blockchain login standards, and PoW networks.
On Ethereum and compatible chains, each address has a transaction count starting from 0—this is the account’s nonce. The next transaction you send must use the current count; once it’s included in a block, your account’s nonce increases by one.
If you set a nonce lower than your current count, nodes will return a “nonce too low” error because that number has already been used. If it’s too high, the network waits for missing intermediate transactions, causing the process to stall. Wallets typically manage this count automatically to prevent manual errors.
Practical example: If your current nonce is 10, use 10 for your next transaction. If transaction #10 is stuck and hasn’t been mined, you can resend a similar transaction with the same nonce but higher fees to replace the unconfirmed one and speed up processing by miners or validators.
In Bitcoin’s Proof of Work, miners continuously adjust the nonce field in the block header to find a block hash that meets network difficulty requirements. Proof of Work is like “guessing a lock’s password”—the first miner to find a valid solution gets to propose the block and earn rewards.
Bitcoin’s block header nonce is 32 bits. After exhausting all possible values, miners modify other adjustable fields such as the timestamp or transaction order (affecting the Merkle root) to expand the search space for new hashes. This process is essentially “trying different numbers until one works.”
During wallet login or web signature processes, the server generates a random nonce and embeds it in the message to be signed. Once you sign, that nonce is marked as used; each subsequent login must use a new nonce, so even if an old message is copied, it cannot be validated again.
For instance, Ethereum-based login standards commonly include fields like “nonce”, “domain”, and “expiration time” in messages, creating one-time challenges. Many DeFi authorizations and order signatures also use nonce to mark single-use instructions or version numbers, allowing revocation of old commands or preventing duplicate execution.
You usually don’t need to manually set your nonce—wallets handle it automatically. However, understanding how to check it can be valuable for advanced scenarios.
Step 1: Enter your address on a blockchain explorer to view the latest confirmed transaction’s index and check for pending transactions in the queue. Most explorers display each transaction’s nonce, helping you deduce the next value to use.
Step 2: In your wallet’s advanced settings, check your current account nonce. Some wallets temporarily allow “custom nonce”; use this feature cautiously to avoid conflicts with pending transactions. On Gate’s Web3 wallet or related services, nonce is managed automatically and can be viewed in settings or transaction details.
Step 3: If you need to manually set your nonce (such as replacing a stuck transaction), always confirm the transaction queue status to avoid skipping necessary intermediates. Incorrect settings may block subsequent transactions for extended periods.
Common errors include “nonce too low,” “nonce too high,” and “stuck transactions.” Here’s how to approach them:
Step 1: For “nonce too low,” that number has already been used or there’s an unconfirmed transaction with the same nonce. Check your wallet’s pending list and explorer for stuck transactions; avoid sending different content with an already-used nonce.
Step 2: For “nonce too high,” there are missing intermediate numbers. You can wait for previous transactions to be mined or send placeholder empty transactions in order (an advanced technique—consider fees and risks).
Step 3: If a transaction is stuck, resend an identical function transaction with the same nonce but a higher fee to replace the old one and speed up inclusion. After confirmation, your account nonce will advance.
Risk warning: Incorrect nonce settings can block all subsequent transactions or disrupt asset management. Always review transaction queues and fee settings before manual overrides to avoid financial risks from mistakes.
Transactions from the same address must be executed in nonce order, but priority for inclusion depends on the fee you’re willing to pay. Higher fees increase your chances of faster processing; sending a new transaction with the same nonce can replace an old one (“speed up”).
In practice, two dimensions work together: intra-account order is constrained by nonce, while cross-account competition is determined by transaction fees. If your fee is set too low, transactions with certain nonces may remain pending for extended periods, blocking all subsequent activity.
Nonce underpins transaction sequencing, mining operations, and signature security—it ensures uniqueness and proper ordering. Incrementing nonces prevent replay and out-of-order execution in accounts; variable nonces in Bitcoin mining help search for hashes that meet difficulty; random nonces in login signatures defend against message replay. In practice, let wallets manage nonces automatically whenever possible; if manual intervention is needed, always check queues and fee settings, especially when using Gate’s Web3 wallet or compatible tools, to minimize stuck transactions and asset risk.
Resetting your nonce invalidates previously sent but unconfirmed transactions. It’s recommended to wait until all pending transactions are confirmed or rejected by miners before resetting. If a transaction is stuck, you can replace it by increasing gas fees and resending with the same nonce—this will overwrite the original transaction.
Nonce mismatches are usually due to multiple confirmed transactions with an unsynced local counter or out-of-order sending. To fix this, check your account’s confirmed transaction count on Gate or a blockchain explorer; your next transaction’s nonce should equal this number. If your wallet shows errors locally, try clearing cache or re-importing your account.
Concurrent transactions require consecutive nonces. For example, if your current nonce is 5: use 5 for the first transaction, 6 for the second, 7 for the third, etc. All will execute in nonce order even if sent simultaneously. Miners typically sort by nonce, so you don’t need to worry about out-of-sequence execution.
For offline signing, you must specify nonce manually—it cannot be fetched automatically. Steps: first check your current account nonce on an online device → enter this value into your cold wallet signing software → broadcast the signed transaction from an online device. Using an incorrect nonce will result in network rejection; always verify accuracy before offline operations.
Yes—each blockchain maintains its own independent nonce counter. Sending 10 transactions (nonces 0–9) on Ethereum mainnet doesn’t affect your count on Polygon, which will start again from 0. Each chain manages its own account state. When using Gate for cross-chain operations, remember that switching networks resets the nonce calculation—avoid confusion by checking after each change.


