4

In a very general sense, most people who know about cryptocurrency mining understand that for every block in a proof-of-work blockchain there is a new "challenge" for the miners, and that challenge is to successfully solve a math problem.

Going a tad deeper, people a little savvier may know that the way to solve the math problem/challenge is really guessing-and-checking - over and over again - to try to be able to present to the network a value that when hashed will provide a winning solution.

To be more specific, a winning "solution" is a nonce (number) that, on average, proves that a miner performed the work to "solve the math problem." The network can easily verify the solution.

I oversimplified, but it's not terribly important to my question. My question is: how do miners attempt to avoid duplicating nonces of other miners?

Some considerations I'm curious to know are:

  • How are nonces chosen?
  • Once a starting spot is chosen, does a miner go sequentially?
  • Does a miner's hash rate play a role in which nonces it tries?
  • Is there a decent chance that solo miners will hash the same nonces?
  • Is there a decent chance that similarly-sized pools will hash the same nonces?
  • Do miners use a random number generator?
    • If so, does that process affect the number of hashes a given system will produce?
  • In general, are there mechanisms in place to inherently make different miners produce unique hashes?
4

There's no need to worry about duplicating nonces between miners/pools because they construct the block header, which contains the merkle root of all txs in the block, one of which is the coinbase tx that will payout to the miner/pool. So, the block header is different for every miner, so no need to worry about duplicating nonces.

As knaccc points out in the comment below, pools will also assign each miner a so called "extra nonce" to prevent miners at the same pool from duplicating work.

  • 1
    so when a pool sends out work, does each worker get a different nonce space? – Ginger Ale Apr 17 '18 at 19:28
  • 1
    @GingerAle Yes there is an "extra nonce" used for pooled mining, which gets included in the coinbase tx in the tx_extra field. Therefore each different miner in the pool gets a slightly different block to mine. Their block is different because the extra nonce in the tx_extra of the coinbase tx in their block is different. – knaccc Apr 17 '18 at 19:32

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.