Author

Topic: Stupid newbie question about the nonce (Read 13485 times)

member
Activity: 178
Merit: 10
June 30, 2017, 04:23:09 AM
#18
To prove that there are very few limits to human stupidity, or necrophilia, I need to ask: what does "Found nonce" actually mean? How close am I to finding a block with such a message? And does it have anything to do with verifying "other" blocks?
newbie
Activity: 21
Merit: 0
April 04, 2017, 03:48:14 PM
#17
In a pool, the pool server will hand out unique headers to each worker/request, by using the extraNonce and rehashing the tree, to prevent duplication of work and get better odds of finding a valid block.

So is this what a `share` is? An attempt to solve a block with a unique header?
sr. member
Activity: 507
Merit: 253
sr. member
Activity: 280
Merit: 250
Relax!
March 11, 2015, 05:22:54 AM
#15
Dude, if you can't find it in the searches it's NOT a newbie question.

Good luck to you, hope you find your answers.

Well apart from the fact that this thread is almost 4 years old, the question isn't exactly stupid. He actually thought about how blocks are being found and what the nonce's role is and deducted correctly how many nonces a miner has to go through, or should be capable to go through per second.
donator
Activity: 2058
Merit: 1054
March 11, 2015, 04:56:11 AM
#14
That page did not exist in 2011 when the question was asked.
Not only did the page exist since 2010, the Merkle tree section was added before the question was asked.

Anyway, looks like Geremia is trying to set some sort of record on gratuitous necrobumps...
sr. member
Activity: 434
Merit: 250
Loose lips sink sigs!
March 10, 2015, 11:56:29 PM
#13
Dude, if you can't find it in the searches it's NOT a newbie question.

Good luck to you, hope you find your answers.
legendary
Activity: 896
Merit: 1000
March 10, 2015, 07:02:13 PM
#12

That page did not exist in 2011 when the question was asked.
sr. member
Activity: 507
Merit: 253
newbie
Activity: 40
Merit: 0
Thanks KJJ that was very helpful for understanding how it works.
Many of the newbie tutorials explain the system in a more simple manner which makes you assume there is 1 true next block that everyone is working on.

Now, after reading you post it is clear why everyone is actually working on a different one.

Now I have to go find some info on what a Merkle tree is .... Tongue

kjj
legendary
Activity: 1302
Merit: 1026
I think that a lot of the confusion comes from thinking that there is just the one true next block and everyone is trying to find the one.

That isn't how it works.  There are many blocks that could be the next one.  The difficult part is finding one out of the much huger number of blocks that aren't difficult enough.

Each node builds up a list of pending transactions, and they pick some or all of them to go into the new block.  Once they have their list of accepted transaction, they calculate the hash of a Merkle tree for that list.  One of these transactions is unique to that node too, because it is the generation transaction, and everyone gets to pick their own account for the reward.  So, even if everyone had the same rules for picking and ordering transactions, they would all be starting from different places anyway.

For many potential blocks, there is no value of the nonce that will give a hash less than the target.  When that happens, the node must alter something in the block header and try again.  The timestamp is a good candidate, since it usually takes some time to try all 2^32 nonces.  New transactions may have come in across the network that can be added to the tree too.

I could have sworn there was also a nonce in the Merkle tree calculations, but I can't find any references to it now.  Ahh, theymos found it while I was typing.  It is in the generation transaction, which changes the Merkle hash.

In a pool, the pool server will hand out unique headers to each worker/request, by using the extraNonce and rehashing the tree, to prevent duplication of work and get better odds of finding a valid block.
administrator
Activity: 5222
Merit: 13032
A solo miner increments Nonce until it overflows. Then it increments extraNonce and resets Nonce. extraNonce is located in the coinbase transaction, so changing it alters the Merkle root. extraNonce is reset based on the time.
donator
Activity: 2058
Merit: 1054
Thanks to both of you for the quick answers.  One final question and I'm done for the night.

Theymos talks about the node resetting the nonce. kjj talks about the node making changes in the merkle root and possibly the timestamp.  Are you both talking about the same thing?  Merkle root nonces?  I thought that a miner was playing with the nonce itself to get a block.  Is my inderstanding incorrect.

Thanks again, and I promise I'm done for the night.

I may come back with more newbie questions tomorrow, though.
The miner plays with the nonce to get a block, up to a point. Since nonce is a 32-bit integer which only allows for 4B values, eventually it will need to ask the server (whether locally or on a pool) for a new merkle root to work on (where things like the extra nonce have been changed).
newbie
Activity: 52
Merit: 0
Thanks to both of you for the quick answers.  One final question and I'm done for the night.

Theymos talks about the node resetting the nonce. kjj talks about the node making changes in the merkle root and possibly the timestamp.  Are you both talking about the same thing?  Merkle root nonces?  I thought that a miner was playing with the nonce itself to get a block.  Is my inderstanding incorrect.

Thanks again, and I promise I'm done for the night.

I may come back with more newbie questions tomorrow, though.
administrator
Activity: 5222
Merit: 13032
The upper limit is 4294967295, but Bitcoin resets the nonce long before you reach that. The reset is based on time, I believe. Edit: Actually, it looks like the nonce does go right up to the limit before being reset. ExtraNonce is the one that is reset based on time.

On transactions, if I'm solo mining, are those being assigned to my miner, or is it picking them out of the pool of transactions on its own? 

Are you talking about transactions in blocks? Solo miners pick them according to their own rules.
newbie
Activity: 52
Merit: 0
Then what is the upper limit on the nonce?  Is there one in the protocol?

On transactions, if I'm solo mining, are those being assigned to my miner, or is it picking them out of the pool of transactions on its own? 

kjj
legendary
Activity: 1302
Merit: 1026
There is another one in the Merkle root.

If a miner burns through every possible nonce in the block header without success (which is most of the time), it reports that to the node, which updates the Merkle nonce and hash (it might also reconsider which transactions to include and possibly a new timestamp), and starts over.
administrator
Activity: 5222
Merit: 13032
The nonce is reset from time to time. With pooled mining, you ask the pool for new work when this happens. With solo mining, you modify the coinbase transaction to get a new set of hashes to try.
newbie
Activity: 52
Merit: 0
This is definitely a newbie question.  It has probably been answered before, but I can't find it with the searches I've done.

I have come to bitcoin with the slashdot post last week and have tried to educate myself before asking stupid questions.  I started bitcoin mining solo and after about a day and a half realized I should join a pool.

I'm using the poclbm client.

As I understand bitcoin mining (in a pool or solo), I am grabbing the hash of the previous block, possibly some transactions, my (or the pool's) address and randomly trying different nonce's to get a hash of all of that smaller than a specified value based on the current difficulty.

But here's where I am confused.  My miner (solo or pooled) using my Radeon 5770 card reports around 170 - 175 Mhashes/sec.

The nonce on block 125907 found as I began writing this was 150,035,635 (comma's added for readabilty).  If the Mhashes reported by my miner are checking blocks by playing with the nonce, that should have been found in a second.

As I've written this, block 125908 has been found with a nonce of 3,787,138,861.  At 170M/s that would have taken just under 22 seconds.

Obviously, I'm missing something.  Technically, I do realize that a block hash is the hash of a hash, but still, I do not understand what is being reported as hashes/second when trying to find a block.

Technical discussions over my head are welcome as are pointers to threads where this has already been asked.  But, in a nutshell, if the only thing that a miner program is playing with is the nonce, why is the nonce so small compared to the hashes/sec or the time to find a block?



Jump to: