What is Nonce

Advanced
3m

A nonce is an arbitrary number that miners change to validate new blocks. It is a random or pseudo-random number.

Under the PoW consensus, the nonce is a part of the block header. The block header contains the following:

  • The blockchain version number
  • The previous block's hash
  • The Merkel Root
  • The timestamp
  • The difficulty target
  • The nonce

The mining program generates a random number, appends it to the hash of the current block header, then rehashes the value and compares this to the target, a 256-bit number that is the hash value of the block header. This process repeats until the resulting hash value meets the requirements (less than or equal to the target). Then the miner is considered to have found the solution and is "awarded" the block.

The nonce in a bitcoin block is a 32-bit (4-byte) field. Thus, it provides 2³² (=4,294,967,296) bits of search space.

However, as the search space of value is enormous, it's almost impossible to "guess" without computation. This iterative calculation consumes time and resources, making up the "work" in the so-called "proof of work." This process of calculation is also called "mining."

Block difficulty is kept the same across the entire network. Theoretically, all miners have the same chance of figuring out the correct hash. Cryptocurrency networks typically establish a target number of blocks they want to be processed during a specific period and occasionally adjust the difficulty to ensure this target is met. For example, Bitcoin's difficulty remains fixed for approximately two weeks. If the number of blocks processed does not meet this target, the difficulty will be reduced, with the reduction in difficulty set to how much time the process was over the limit.

Public Chain

Mining

What else do you want to learn?

Send

In This Article

delate
Use TokenInsight App All Crypto Insights Are In Your Hands
Open