What is Nonce?

A nonce (number used only once) is a number added to a block hash that, when retried, meets the difficulty limits. The nonce is the number that blockchain miners are dealing with.

Blockchain is the foundation of cryptocurrency. To keep the blockchain secure, data from previous blocks is encrypted or has been chopped into a series of numbers and letters. This is done by processing the block input through a function, which produces a fixed length output. The function used to generate the hash is deterministic, that is, it will produce the same result each time the same input is used; can produce an efficient hash input; makes identifying inputs difficult (resulting in mining); and making small changes to the input results in a very different hash.

What is Nonce?

Adding transactions to the blockchain requires significant computer processing power. Individuals and companies that process blocks are called miners. Miners are only rewarded if they are the first to generate a hash that meets a certain set of requirements, known as the target hash.

The hash guessing process begins in the block header. It contains the block version number, timestamp, hash used in the previous block, the hash of the Merkle Tree, the nonce, and the target hash. Successfully mining a block requires a miner to be the first to guess the nonce, which is a sequence of random numbers. This number is added to the block’s hash, and then retried. If the hash meets the requirements set out in the target, the block is added to the blockchain. Going through solutions for guessing nonce is known as proof of work (POW) and miners can find the value awarded blocks and paid in coins.

Determining which sequence to use as the nonce requires a significant amount of trial and error, since it’s a random sequence. The miner has to guess a nonce, append it to the hash of the current header, retry the value, and compare this with the target hash. If the resulting hash meets the requirements, the miner created a solution and was awarded the block. It is highly unlikely that a miner will successfully guess the nonce on the first attempt, meaning that the miner could potentially test a large number of nonce options before doing it correctly. The greater the difficulty – a measure of how difficult it is to generate a hash that is smaller than the target – the longer it takes to generate a solution.

The block difficulty is kept the same across the entire network, which means that all miners have the same chance of finding the exact hash. Cryptocurrency networks typically set a target number of blocks that they want to process within a specific time period and periodically adjust the difficulty to ensure that this goal is met. If the number of blocks processed does not meet this goal then the difficulty is reduced, with the difficulty reduction set to the amount of time that exceeds the processing time limit.


Bitcoin Magazine

Follow the Twitter page | Subscribe to Telegram channel | Follow the Facebook page


Please enter your comment!
Please enter your name here