0

I have been wondering if it would be possible to generate hashes, store them in a file, then use them as hashes when mining. When you would mine, you would not generate the hashes, but instead, just compare them to the target. This would be much more efficient, right? Anyway, here is some psudo python code i made up:

import hashlib
while True:
    hash = hashlib generate random hashes
    file = open('hashes.txt', 'w')
    file.write(hash)

or something like that.

  • Creating ‘random hashes’ will always fail. A valid blockhash must not only be below a target value, it must also use the header of an otherwise valid block as input. – chytrik Mar 12 at 3:41
3

While this certainly could work, the chances of the hashes ever being valid are next to zero.

The reason is, the hashes must not only meet the target requirements, but they must also be a valid hash of the block header, which changes with each block.

  • So most of them would be invalid or low diff shares? – Crypthusiast Mar 12 at 1:11
  • You might have some high diff hashes (after a lot of hashes) but they would all be invalid. – JBaczuk Mar 12 at 1:33
  • Ok, thanks! Very helpful – Crypthusiast Mar 12 at 15:20
  • would it would still be possible tho? – Crypthusiast Mar 12 at 15:20
  • If by chance you happened to use the right block header data as input to the hash function. But you'd have to guess 80 bytes correctly. – JBaczuk Mar 12 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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