bravetheheat (OP)
|
|
January 30, 2012, 06:02:18 AM |
|
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...
|
|
|
|
BurtW
Legendary
Offline
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
|
|
January 30, 2012, 06:05:00 AM |
|
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?
|
Our family was terrorized by Homeland Security. Read all about it here: http://www.jmwagner.com/ and http://www.burtw.com/ Any donations to help us recover from the $300,000 in legal fees and forced donations to the Federal Asset Forfeiture slush fund are greatly appreciated!
|
|
|
bravetheheat (OP)
|
|
January 30, 2012, 06:08:20 AM |
|
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?
|
|
|
|
bravetheheat (OP)
|
|
January 30, 2012, 06:09:42 AM |
|
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?
|
|
|
|
DiThi
Full Member
Offline
Activity: 156
Merit: 100
Firstbits: 1dithi
|
|
January 30, 2012, 06:14:13 AM |
|
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.
|
1DiThiTXZpNmmoGF2dTfSku3EWGsWHCjwt
|
|
|
BurtW
Legendary
Offline
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
|
|
January 30, 2012, 06:14:52 AM |
|
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
|
Our family was terrorized by Homeland Security. Read all about it here: http://www.jmwagner.com/ and http://www.burtw.com/ Any donations to help us recover from the $300,000 in legal fees and forced donations to the Federal Asset Forfeiture slush fund are greatly appreciated!
|
|
|
DiThi
Full Member
Offline
Activity: 156
Merit: 100
Firstbits: 1dithi
|
|
January 30, 2012, 06:18:08 AM |
|
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.
|
1DiThiTXZpNmmoGF2dTfSku3EWGsWHCjwt
|
|
|
bravetheheat (OP)
|
|
January 30, 2012, 06:19:12 AM |
|
Ahh... thanks! I finally understand now
|
|
|
|
BurtW
Legendary
Offline
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
|
|
January 30, 2012, 06:21:30 AM |
|
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.
|
Our family was terrorized by Homeland Security. Read all about it here: http://www.jmwagner.com/ and http://www.burtw.com/ Any donations to help us recover from the $300,000 in legal fees and forced donations to the Federal Asset Forfeiture slush fund are greatly appreciated!
|
|
|
|