Nonce
On account-based blockchains such as Ethereum, a nonce is a counter that orders the transactions sent from an address, so each is processed once and in sequence. In Bitcoin mining, a nonce is the number miners change while searching for a valid block.
A nonce is a number that is used once. In Bitcoin mining it is the value miners change while hunting for a valid block. On Ethereum it is a counter on each account that puts transactions in order. Traders meet it most when a transaction gets stuck or needs replacing.
- Category
- Cryptocurrency and Blockchain
- Reading time
- 4 min
- Also called
- Number used once, Transaction nonce, Block nonce
- Updated
Nonce in plain words
On Ethereum, every transaction carries a nonce: a counter that goes up by one with each transaction an account sends.1
Each nonce can be used only once per account, so a signed transaction can't be broadcast again and replayed.2
In Bitcoin mining the nonce means something else: miners keep changing it until the block's hash meets the difficulty target.3
How an account nonce works
Start at zero
A new account has sent no transactions yet.
Count each send
Read the nonce as the count of transactions this account has sent so far.2
Sign with the next number
Your wallet attaches the next unused nonce to each new transaction.
Process in order
A transaction with a higher nonce waits until all lower ones are included.
Block replays
Remember only one transaction per nonce can ever go through.2
Replace if stuck
Send a new transaction with the same nonce and a higher fee to replace a pending one.
Worked examples
Example 1 — Next nonce
Nonce 14A hypothetical wallet has already sent 14 transactions starting from nonce 0.
| Nonces used | 0 to 13 |
| Next nonce | 14 |
The nonce counts transactions sent from the account, so the next one is 14.2
Example 2 — A stuck queue
3 trades stuckA hypothetical trader sends nonce 20 with a low fee, then nonces 21 and 22 to buy a token.
| Pending | 3 transactions |
| Executed | 0 until nonce 20 clears |
Because the counter is sequential, the later trades wait behind the stuck one.1
Example 3 — Mining nonce search
About 8.3 minutesA hypothetical miner tries 2 billion nonces a second, and a valid block needs about 1 trillion tries on average.
| Seconds needed | 1,000,000,000,000 ÷ 2,000,000,000 = 500 s |
| Minutes | 500 ÷ 60 ≈ 8.3 min |
Miners increment the nonce until the block's hash has the required zero bits, so more tries per second finds blocks faster.3
Account nonce vs block nonce
| Aspect | Account nonce (Ethereum) | Block nonce (Bitcoin) |
|---|---|---|
| Purpose | Order transactions and stop replays | Search for a valid block hash |
| Who sets it | The sender's wallet | The miner |
| How it changes | Goes up by one per transaction | Changed over and over while mining |
| When traders notice it | Stuck or replaced transactions | Rarely; it is a mining detail |
Where the nonce matters for traders
Unsticking orders
Replace a low-fee Order by reusing its nonce with a higher fee.
Fee planning
Underpriced Trading Fees and Commissions can block a whole queue.
Fast markets
In Volatility spikes, a stuck nonce can mean missed entries and Slippage.
Bot trading
Automated Day Trading tools must track nonces to avoid clashes.
Advantages and disadvantages
Advantages
- Stops the same signed transaction running twice.
- Keeps transactions in a clear order.
- Lets users replace a stuck transaction.
Disadvantages
- One stuck transaction blocks later ones.
- Gaps in nonces stall the queue.
- Using two wallets on one account can cause clashes.
- The word means different things on different chains.
Going deeper
Read as far as you need. Each level builds on the one before it.
A simple counter
Beginner
Ethereum's nonce is simply a running transaction count for the account.1
Nonces and contract addresses
Intermediate
It also determines contract addresses, which are derived from the creator's address and its transaction count.2
The mining nonce
Advanced
Block headers include fields that are easy to change, such as the nonce, so miners can generate fresh hashes without waiting for new transactions.4
Common mistakes
Sending more after a stuck one
New transactions just queue behind it.
Skipping a nonce
A gap stops everything after it.
Confusing the two meanings
Account and mining nonces do different jobs.
Cancelling without a higher fee
A replacement needs a better fee to be picked up.
Check your understanding
Test yourself before moving on. Each answer comes with an explanation.
Key points to remember
- A nonce is a number used once.
- Ethereum accounts use it as a transaction counter.
- It blocks replays and keeps order.
- Bitcoin miners change a block nonce to find a valid hash.
- A stuck low nonce holds up later transactions.
Frequently asked questions
How do I fix a stuck Ethereum transaction?
Is the nonce secret?
Does Bitcoin use account nonces?
Further learning
- Trading Fees and Commissions
Why fees decide inclusion.
- Order
Order types and queues.
- Slippage
Cost of delayed execution.
- Settlement
When a transfer is done.
Sources
This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.
- ethereum.org. Transactions (opens in a new tab) Checked .
- ethereum.org. Ethereum accounts (opens in a new tab) Checked .
- Satoshi Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System (opens in a new tab) Checked .
- Bitcoin Project (developer.bitcoin.org). Block Chain developer guide (opens in a new tab) Checked .
Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. We are not affiliated with any publisher linked above. Last reviewed . Report an error or request a source credit.