What Is Nonce?
Also known as: Number Used Once
In short
A nonce (number used once) is a number used only once in cryptography. In blockchains it has two meanings: the number changed to find a valid hash in Proof of Work mining, and the counter that tracks transaction order on account-based networks like Ethereum.
In Bitcoin mining, the block header contains a 32-bit nonce field. Miners keep changing this value, recompute the block header's hash, and look for a result that falls below the network's difficulty target. The 32-bit field offers about 4.3 billion possibilities; because these run out very quickly with today's high hash power, miners also change other values, such as the timestamp or the extra field in the coinbase transaction (extra nonce).
On Ethereum, each account has a transaction nonce, and this value shows the number of transactions sent from that address. The first transaction is sent with nonce 0, and the value increases by one with each new transaction. This mechanism prevents the same transaction from being processed again (replay) and ensures transactions are executed in order. A user can speed up or cancel a pending transaction by sending a new transaction with the same nonce and a higher fee.
Poor nonce management can cause problems. On Ethereum, if the next nonce in the sequence is missing, later transactions get stuck. Reusing the one-time random value used in cryptographic signatures (the k value in ECDSA) can make it possible to compute the private key; in the past, such mistakes caused loss of funds in some wallet applications.
Last updated: · This content is for information purposes only and is not investment advice.

