Author

Topic: Why not reuse? (Read 1465 times)

legendary
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
January 30, 2012, 01:21:30 AM
#9
Hash the data + nonce
Check the answer, if it meets the difficulty critera then done
Otherwise increment the nonce and go to step 1

It's probable you won't find a block after trying all posible nonce values. When this happens, you modify something in the transactions (so the hash differs) and start again. That "something" it's usually called "ExtraNonce", a random number placed in the coinbase.

Details, details.  Anyway I think he is back on track now.
sr. member
Activity: 457
Merit: 251
January 30, 2012, 01:19:12 AM
#8
Ahh... thanks! I finally understand now  Grin
full member
Activity: 156
Merit: 100
Firstbits: 1dithi
January 30, 2012, 01:18:08 AM
#7
Hash the data + nonce
Check the answer, if it meets the difficulty critera then done
Otherwise increment the nonce and go to step 1

It's probable you won't find a block after trying all posible nonce values. When this happens, you modify something in the transactions (so the hash differs) and start again. That "something" it's usually called "ExtraNonce", a random number placed in the coinbase.
legendary
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
January 30, 2012, 01:14:52 AM
#6
OK here you go the value of the hash is a function of the data in the block.  It is a very fancy checksum of a block of data, in this case the current block of transactions.  A hash is designed so that given all the data in the block anyone and everyone can calculate the same number (the hash).  So if you calculate the hash of the block you get a number, it you calculate it again you get the same number - but we want the hash to change every time we calculate it so we can hopefully, by random chance, find one that matches the current difficulty requirement.

That is where the nonce come in.  If I hash alll the transactions plus the nonce I get a number, then I increment the nonce and hash again I get a totally different answer for the hash value so the algorithm is:

Hash the data + nonce
Check the answer, if it meets the difficulty critera then done
Otherwise increment the nonce and go to step 1
full member
Activity: 156
Merit: 100
Firstbits: 1dithi
January 30, 2012, 01:14:13 AM
#5
You hash exactly the 80 bytes of the header, but it includes:
  • The hash of the previous block.
  • The hash of all transactions in the block (or more specifically, the the root hash of a merkle tree of the transactions).

It makes no sense to save it: the previous block is always different and the more you wait, the longer the chain will be.
sr. member
Activity: 457
Merit: 251
January 30, 2012, 01:09:42 AM
#4
Quote
Edit: after reading your post again I think your disconnect is even more fundamental.  What do you think a hash is?  Do you realized what exactly is being hashed when you generate the hash?

Unfortunately, I do not know what exactly is being hashed. Is it in the wiki? (because I can't seem to find it.)

EDIT: Is it the block's header?
sr. member
Activity: 457
Merit: 251
January 30, 2012, 01:08:20 AM
#3
I didn't mean that you would save the block, just the hash. *Forgive and correct me if I'm not making any sense >.<*

And what about for mining shares, instead?
legendary
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
January 30, 2012, 01:05:00 AM
#2
I think the block hash has to be under the target and the block itself must be valid.  Isn't your saved block full of a bunch of old transactions?  Hasn't everyone else moved on to the next block?  Your saved block is rejected by the rest of the network.

Edit: after reading your post again I think your disconnect is even more fundamental.  What do you think a hash is?  Do you realized what exactly is being hashed when you generate the hash?
sr. member
Activity: 457
Merit: 251
January 30, 2012, 01:02:18 AM
#1
Hi all!

It seems to me that this might be a rather stupid question, so if it is, please forgive my 'insolence' or incapability of answering this question myself.
Is it possible to 'reuse' a previously generated hash? An example would be a miner that would do as it would until it finds a solution for the particular work. It would then save that hash in its memory and attempt to reuse it as a solution for the next work. If it doesn't meet the requirements, the miner would then continue on hashing until it found another suitable hash, which would then be stored and used again, continuing the cycle.

The wiki articles don't really seem to touch upon this issue, since all they say is that as long as it is underneath the target, it would be fine.

EDIT: Okay, it seems like the wiki 'indirectly' answers this question. If it actually does not, then feel free to answer it. Otherwise, close this? I find the description of the nonce value somewhat confusing, however...
Jump to: