Nonce

Intermediate

A nonce refers to a number or value that can only be used once. Nonces are often used on authentication protocols and cryptographic hash functions. In the context of blockchain technology, a nonce refers to a pseudo-random number that is utilized as a counter during the process of mining.

For instance, Bitcoin miners need to try and guess a valid nonce as they perform multiple attempts to calculate a block hash that meets certain requirements (i.e., that starts with a certain number of zeros). When competing to mine a new block, the first miner to find a nonce that results in a valid block hash is granted the right to add the next block into the blockchain - and is rewarded for doing so.

In other words, the process of mining consists of miners performing a myriad of hash functions with many different nonce values until a valid output is produced. If the hashing output of a miner falls below the predetermined threshold, the block is considered valid and is added to the blockchain. If the output is not valid, the miner keeps trying with different nonce values. When a new block is successfully mined and validated, the process starts over.

Within Bitcoin — and most Proof of Work systems — the nonce is just a random number that miners use to iterate the output of their hash calculations. Miners employ a trial and error approach, in which every calculation takes a new nonce value. They do so because the probability of accurately guessing a valid nonce is close to zero.

The average number of hashing attempts is automatically adjusted by the protocol to ensure that each new block is generated - on average - every 10 minutes. This process is known as difficulty adjustment and is what determines the mining threshold (i.e., how many zeros the block hash needs to start with to be considered valid). The difficulty in mining a new block is related to the amount of hashing power (hash rate) committed to a blockchain system. The more hashing power dedicated to the network, the higher the threshold will be, meaning that more computational power will be required to be a competitive and successful miner. In contrast, if miners decide to stop mining, the difficulty will be adjusted, and the threshold will drop, so less hashing power will be required to mine, but the protocol will make sure that the block generation follows a 10-minute schedule, regardless.

Glossary

A decentralized, digitized ledger that records transaction information about a cryptocurrency in a chronolo...

Full definition
Glossary

A digital currency that is secured by cryptography to work as a medium of exchange within a peer-to-peer (P...

Full definition
Glossary

Money that a government has declared to be legal tender.

Full definition
Glossary

A malicious attack where a bad actor will attempt to obtain the credentials of a user in order to gain unau...

Full definition
Glossary

A type of malware which takes over your computer and threatens to destroy or reveal files unless a ransom i...

Full definition
Glossary

A cryptocurrency that is alternative to Bitcoin. Used to describe cryptocurrencies that are not Bitcoin.

Full definition
Glossary

Also referred to as a Transaction hash. This is a transaction identifier used to reference transactions on ...

Full definition
Glossary

The verification of transactions on a blockchain network, in which transactions are added as entries into t...

Full definition
Glossary

The number of blocks in the chain between itself and the first block on that blockchain (genesis block or b...

Full definition
Glossary

A way of organizing and structuring large amounts of data to make it more straightforward to process. A has...

Full definition