Ελληνικά

What is a nonce?

In short

A nonce is a numerical value whose role differs by blockchain: on Bitcoin it changes during mining, while on Ethereum it counts the transactions an account sends.

By the Cryptonomy editorial team · Updated · 2 min read

How can a number help with Bitcoin mining and also determine the order of transactions on Ethereum?

The word nonce comes from “number used once.” In crypto, however, its function depends on the network. It isn’t a password or some secret number of your wallet.

On Bitcoin, the nonce is a field in the block header. Miners change its value and recompute the digital fingerprint (hash) of the header. The goal is to find a hash whose numerical value is below the threshold set by the mining difficulty.

Think of trying different combinations on a lock. Each change gives a different result, without you knowing in advance which combination will work. In practice, miners also change other data in the candidate block, not just the nonce, so they can keep trying.

On Ethereum, the nonce of a regular user account works like a sequence number for outgoing transactions. The first has nonce 0, the next 1, and so on. It is like numbered invoices: the network knows which transaction comes first and doesn’t allow the same signed transaction to be executed again on the same network.

Why it matters

On Bitcoin, the nonce is part of the Proof of Work mechanism through which miners search for valid blocks. On Ethereum, it directly affects how you use your wallet: a transaction with a higher nonce waits for the earlier ones to be processed. So one pending transaction can hold back the ones after it.

What to watch out for

If your wallet offers to speed up or cancel a transaction on Ethereum, it usually tries to replace it with another one that has the same nonce and a higher fee. Replacement isn’t guaranteed and doesn’t undo a transaction that has already been confirmed. We suggest not changing the nonce manually unless you understand which transactions are pending, because you may cause further delays.