DEFINITION of 'Nonce'

A nonce ("number only used once") is a number added to a hashed block that, when rehashed, meets the difficulty level restrictions. The nonce is the number that blockchain miners are solving for.

BREAKING DOWN 'Nonce'

The blockchain is the cornerstone of cryptocurrency. In order to keep the blockchain secure, data from previous blocks are encrypted or “hashed” into a series of numbers and letters. This is done by processing the block input through a function, which produces an output of a fixed length. The function used to generate the hash is deterministic, meaning that it will produce the same result each time the same input is used; can generate a hashed input efficiently; makes determining the input difficult (leading to mining); and makes small changes to the input result in a very different hash.

Adding transactions to the blockchain requires substantial computer processing power. The individuals and companies who process blocks are called miners. Miners are compensated only if they are the first to create a hash that meets a certain set of requirements, called the target hash.

The process of guessing the hash starts in the block header. It contains the block version number, a timestamp, the hash used in the previous block, the hash of the Merkle Root, the nonce, and the target hash. Successfully mining a block requires a miner to be the first to guess the nonce, which is a random string of numbers. This number is appended to the hashed contents of the block, and then rehashed. If the hash meets the requirements set forth in the target, then the block is added to the blockchain. Cycling through solutions in order to guess the nonce is referred to as proof of work, and the miner who is able to find the value is awarded the block and paid in cryptocurrency.

Determining which string to use as the nonce requires significant amount of trial-and-error, as it is a random string. A miner must guess a nonce, append it to the hash of the current header, rehash the value, and compare this to the target hash. If the resulting hash value meets the requirements, the miner has created a solution and is awarded the block. It is highly unlikely that a miner will successfully guess the nonce on the first try, meaning that the miner may potentially test a large number of nonce options before getting it right. The greater the difficulty - a measure of how hard it is to create a hash that is less than the target - the longer it is likely to take to generate a solution.

Block difficulty is kept the same across the entire network, meaning that all miners have the same chance of figuring out the correct hash. Cryptocurrency networks typically establish a target number of blocks they want processed during a specific time period, and periodically adjust the difficulty in order to ensure that this target is met. If the number of blocks processed does not meet this target then the difficulty will be reduced, with the reduction in difficulty set to the amount of time over the limit the processing time was. 

RELATED TERMS
  1. Hash

    A hash is a function that converts an input of letters and numbers ...
  2. Target Hash

    A target hash is a number that a hashed block header must be ...
  3. Difficulty (Cryptocurrencies)

    Difficulty is a parameter that bitcoin and other cryptocurrencies ...
  4. Merkle Root (Cryptocurrency)

    A Merkle root contains information about every single transaction ...
  5. Block Header (Cryptocurrency)

    A block header is the unique identity of a particular block on ...
  6. Block Time (Cryptocurrency)

    Block time is the average time for a new block to be generated ...
Related Articles
  1. Tech

    What is a Distributed Ledger?

    Blockchain technology has come a long way from the obscure corners of the web it was once confined to. But what is it? And what about nonces, hashes and ledgers?
  2. Tech

    How Do You Mine Ethereum?

    Mining for ethereum is a profitable, essential, and oftentimes confusing process. Here's the basics of how to do it.
  3. Tech

    What Is a USB Bitcoin Miner? How Does It Work?

    Here’s how a USB bitcoin miner works.
  4. Tech

    How Does Blockchain Work?

    Blockchain technology supports the cryptocurrency space and many other promising applications.
  5. Tech

    How to Choose a Cryptocurrency Mining Pool

    Here are some selection criteria cryptocurrency miners should consider before joining a crypto mining pool.
  6. Tech

    Are Large Mining Pools Bad For Cryptocurrencies?

    Cryptocurrency mining are being done on expensive mining pools run by large firms. Is this bad for cryptocurrencies?
  7. Tech

    Is Apple Planning to Use Blockchain?

    Apple filed a patent application for a timestamp system that uses blockchain technology.
  8. Tech

    How Do Cryptocurrency Mining Pools Work?

    Here's how cryptocurrency mining pools work.
  9. Tech

    What Is Bitcoin?

    We know, bitcoin isn't exactly straightforward. If miners, hashes, keys, blocks and wallets have you scratching your head, this infographic is for you.
  10. Tech

    Bitcoin Cash Broke $1000: Where Will It Go Next?

    The surge in Bitcoin Cash’s mining profitability and high trade volume propelled its price to near $1,000 over the weekend.
RELATED FAQS
  1. What Does the Bitcoin Blockchain Record?

    Read about the bitcoin blockchain, a public ledger shared among all bitcoin users that records the information of every single ... Read Answer >>
  2. What is the metals and mining sector?

    Learn about the mining sector and the many ways that mining companies profit from the location and extraction of minerals ... Read Answer >>
  3. What criteria classify a company as a junior gold miner?

    Learn about junior gold miners, companies that exclusively mine for gold. These firms typically rely on venture capital and ... Read Answer >>
  4. How can I calculate the hurdle rate in Excel?

    Learn how to evaluate potential investments. Common desktop software provides functions that can help make the decision with ... Read Answer >>
  5. What does "squeezing the shorts" mean?

    "Squeezing the shorts" refers to a questionable practice of taking advantage of a heavily shorted stock by buying up large ... Read Answer >>
Trading Center