# Understanding Blockchain Nonce: Essential to Bitcoin Mining

## What Is the Nonce?

Nonce, short for "number used only once," is crucial in Bitcoin mining difficulty. It enables miners to generate a hash from a block header that must meet the network's difficulty target, facilitating the blockchain's integrity and security.

If the resulting hash (a hexadecimal number) adds up to a value of less than or equal to the network's difficulty target, the miner's block is added to the blockchain. Another is opened, and the process begins again.

### Key Takeaways

*   A nonce is a 32-bit number used in Bitcoin mining that changes with each attempt to create a valid block hash.
*   The nonce is part of the block header and, along with other elements, is hashed to meet Bitcoin's network difficulty target.
*   Miners adjust the nonce, extra nonce, and timestamp to find a hash below the difficulty target, ensuring blocks are mined approximately every 10 minutes.
*   The nonce increases by one with each failed attempt until it must roll over due to its 32-bit limit.
*   Finding a valid hash using the nonce requires significant computational power and is central to the competitive mining process.

## How Nonces Function in Bitcoin Mining

A Bitcoin nonce is a 32-bit (or 4-byte) number that miners use to attempt to generate a valid hash to produce a new block in the Bitcoin [blockchain](https://www.investopedia.com/blockchain-4689765). The nonce is one of the fields included in the block header, which also includes:

*   The software version
*   The previous block's hash
*   A [timestamp](https://www.investopedia.com/terms/b/block-time-cryptocurrency.asp)
*   The difficulty target
*   The [Merkle root](https://www.investopedia.com/terms/m/merkle-root-cryptocurrency.asp)

On the Bitcoin network, participants called miners compete to generate a hash that is less than or equal to the network target hash by repeatedly changing the nonce after each unsuccessful attempt.

Hashing refers to the process of applying a [cryptographic hash function](https://www.investopedia.com/news/cryptographic-hash-functions/) to information. The cryptographic hash function is a mathematical operation that takes block data and transforms it into a unique value, a fixed-length output of hexadecimal characters, by encrypting it.

This hash value serves as a cryptographic fingerprint of the block, ensuring that the block's contents remain unaltered. Miners can only change the nonce in the block header. Altering it changes the block's hash, allowing miners to find possible solutions.

For example, this is the previous paragraph sent through an SHA-256 hashing algorithm:

acd691b23cc47b03addf7329b0467c6190e758ee763d7d648af75b5c5ae73e3a

By adding a value of zero (the nonce) at the end of the paragraph, you get a different hexadecimal value:

> f4be24818264fdb8d120f7fe04b8b8f8d4359bc7b1a112412fa968aab7acb782

If you change that zero to a one, you'd get this:

> 9e3f30005b29927043ecfcec9edf815493326fe2060015fd56ed3213564c7200

This is how the nonce is used by the Bitcoin mining programming. The nonce value is increased by one with every attempt until a certain value is reached.

The first miner to find a valid hash wins the block reward. Their block is shared with the network, added to the blockchain, and the process restarts.

> **Fast Fact**
>
> The target difficulty is a measure of how difficult it is to find a valid nonce. It is adjusted periodically to maintain a consistent block generation rate.

## The Role of Extra Nonces and Timestamps

You'll find that nonces generally only go up into the billions in a block explorer. For example, the nonce for block 841,948 was 1,614,498,317. Block 841,949 had a nonce of 4,218,083,700. A modern mining rig can generate many more hashes than this in less than one second.

The nonce is a 32-bit number, limiting it to just over 4.29 billion. Due to the network's extreme hashing speed, it must roll over after reaching this limit. So, an additional method was created after Bitcoin ASIC miners began ripping through the blockchain. Another number, called the extra nonce, is randomly generated and used in the coinbase data field. This value is added to the coinbase transaction space, which changes the Merkle root.

The Merkle root is part of the block header, so the block header hash changes. Both the extra nonce and nonce help find the solution. If this fails, miners adjust the timestamp. The combination of these three values allows the blockchain to keep its target of mining one block about every 10 minutes.

## What Is the Meaning of the Phrase for the Nonce?

“Nonce” combines the phrase “number used once.” [It is used by the Bitcoin blockchain](https://www.investopedia.com/news/how-bitcoin-works/) to help generate a hashed value when mining a block.

## What Is the Concept of a Nonce?

A nonce, in blockchain terms, is a number used once. Regarding its use on a blockchain, it is a number that increases sequentially in every attempt to generate a hash that meets the network’s difficulty criteria.

## What Is an Example of a Nonce?

The best example of a nonce is a nonce used to mine a block. The nonce used in block 841,954 was 3,983,795,221. This doesn’t mean it only took the miner 3.98 trillion attempts—it likely rolled over several thousand times and was used in combination with the variable extra nonce and timestamp entries. As a 32-bit number, the nonce can only increase to slightly more than 4.29 billion.

## The Bottom Line

Bitcoin mining relies on finding a nonce that satisfies the network's difficulty criteria by leveraging computational power to repeatedly hash block header information. Each hashing attempt increments the nonce, aiming to produce a value beneath the network difficulty target.

Once reaching the 32-bit nonce limit, miners use an extra nonce and adjust timestamps to continue the process without interruption. This iterative method exemplifies blockchain's complexity and the substantial effort required to maintain a consistent block generation pace.

_The comments, opinions, and analyses expressed on Investopedia are for informational purposes only. Read our [warranty and liability disclaimer](https://www.investopedia.com/legal-4768893#toc-warranty-and-liability-disclaimer) for more info._  

> **Article Sources**
>
> 1.  Blockchain.com. “[Bitcoin Block 841,948](https://www.blockchain.com/explorer/blocks/btc/841948).”
>     
> 2.  Blockchain.com. “[Bitcoin Block 841,949](https://www.blockchain.com/explorer/blocks/btc/841949).”
>     
> 3.  O’Reilly. “[Mastering Bitcoin: Chapter 8. Mining and Consensus](https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch08.html#extra_nonce).”
>     
> 4.  Blockchain.com. “[Bitcoin Block 841,954](https://www.blockchain.com/explorer/blocks/btc/841954).”