Bitcoin Forum
May 27, 2024, 10:20:24 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: what is extra nonce ELI5  (Read 204 times)
john139 (OP)
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
April 23, 2019, 07:04:46 PM
 #1

Hello ,
I had a question on my mind that if no nonce can create a hash value less than target hash what will happen ?
seems that solution is "extra nonce " for this problem, would u please simply explain it ?  Huh
thanks in advance
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
April 23, 2019, 07:26:15 PM
Last edit: April 23, 2019, 07:52:19 PM by AdolfinWolf
 #2

Can you tell me whether or not the answers in this thread explain your question sufficiently;

https://bitcointalk.org/index.php?topic=1040859.0 (And more specifically Danny's post, but it's really too big to quote in good faith here.)
I've got one more question. When I first thought of the nonce and the hashing algo I was under the assumption that once all the hashing is done there is then a calculation made with the nonce and then we get our block hash result.

This to me doesn't know look right. If it isn't please could someone tell me at what stage does the nonce come in when the calculations are being made?

The nonce is part of the data that is hashed for the blockhash. Thus it influences the result of the hashing function. Once you have the hash it is compared to the target. If your hash is below the traget value we have a new block, if not you change the data (e.g. nonce = nonce +1), hash and compare again. Once you have tried all possible nonces you have to change something different in order to get hash values for the block you did not try yet. There are several options, e.g. the transactions to include, the timestamp of the block or what is called the extranonce.

As i understand it, the extranonce is the amount of times a nonce had to "reset"/"increment" itself because no valid hash was found, but since i also just ever heard about this term, this is probably not the correct understanding of it.


https://medium.freecodecamp.org/how-bitcoin-mining-really-works-38563ec38c87
Quote
<...

The solution to this is to add a field to the coinbase (the transaction contents of a block, stored as the merkle tree) called the extraNonce. The size of this extraNonce is only limited by the size of block itself, and so it can be as large as miners wish as long as the block size is within protocol limits.

If all 4 billion possible values of the nonce are exhausted, the extraNonce is added and incremented to the coinbase. A new merkle root and subsequently new block header are calculated, and the nonce is iterated over once again. This process is repeated until a sufficient hash is found.

It’s best to avoid adding the extraNonce until the nonce is exhausted, because any change to the extraNonce changes the merkle tree. This requires extra computation in order to propagate the change upwards until a new root of the merkle tree is calculated.

...>

Awesomus Maximus
Member
**
Offline Offline

Activity: 392
Merit: 66


View Profile
April 23, 2019, 07:47:15 PM
 #3

As far as I can tell, DannyHamilton gave a fantastic explanation of extranonce. Check it out in this post: https://bitcointalk.org/index.php?topic=1040859.0 In particular:

Is this the point where if nonce cannot achieve this the extranonce comes in?

That depends on the mining software.  There are a few ways to adjust the header after all the nonce values have been attempted.  The timestamp can be adjusted.  The order of the transactions in the block can be manipulated, or the extranonce can be altered.

If so what is this extranonce and what changes happen here (eg are these random brute-force changes or calculated changes?)

extranonce is part of the input to the generation transaction.  How it is adjusted depends on the miner or mining pool.


As a side note, too bad Danny hasn't posted from June 2018. I miss his great posts.
siwsag
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 25, 2019, 11:49:06 AM
 #4

extraNonce gets put into the input of the generation transaction. getwork clients can't see transactions, so they can't update extraNonce. Some miners instead modify nTime slightly to give them more nonce space.

extraNonce is used by bitcoind, but it's not part of the protocol. There is no extraNonce field in blocks or transactions.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!