What is Nonce?
Crypto Glossary Definition
A number only used once, which may have different meanings in contexts both in and outside of crypto. A cryptographic nonce is often used to ensure that old communications cannot be reused in replay attacks.
Why Nonce Matters
A nonce is an arbitrary number miners repeatedly change and re-hash while searching for a valid block hash under Proof of Work — "mining" is, mechanically, mostly just trying different nonce values as fast as possible.
Nonce in Practice
A miner's software is racing to find a valid block, and the core of that work boils down to repeatedly guessing a single number: the nonce. The software takes the proposed block's data — the list of transactions, a timestamp, a reference to the previous block — combines it with a candidate nonce value, and runs the whole thing through the SHA-256 hashing function. The output needs to be below a specific target threshold set by the network's current difficulty for the block to be considered valid; if the resulting hash doesn't qualify, the miner simply increments the nonce by one and tries again, repeating this billions of times per second across specialized hardware until, purely by chance, some machine somewhere finds a nonce that produces a qualifying hash. Because the nonce field itself is limited in size, once a miner exhausts every possible value without success, other elements of the block, like the timestamp or a fee-bearing coinbase transaction, are adjusted slightly to effectively reset the search space and continue trying. Outside of mining, nonces also show up in a completely different but related security context: a server issuing a one-time nonce value that a client must include in a signed request, ensuring that even if an attacker intercepts and replays an old message, the mismatched nonce causes it to be rejected.
Still have questions about Nonce?
Ask ARIA, our free AI crypto intelligence agent, for a deeper explanation.
Ask ARIA →