Post
Topic
Board Development & Technical Discussion
Re: Python based Solo miner for CPU | Learn Basic Bitcoin Mining | Just for fun
by
number435398
on 04/04/2023, 23:57:37 UTC
thanks, i also want to practice some code for cpu/gpu bitcoin mining, so i very gladly looked at your work.

a question regarding this line of code: hash = hashlib.sha256(hashlib.sha256(binascii.unhexlify(blockheader)).digest()).digest()
why are you calling sha256 twice? so you hash the hash of the header.
maybe it's a mistake?

Should be able to implement PyCuda into that code. I'd love to see that myself. 

Bitcoin double hashes. That's how it works. When you hash the block and think you're done, you're not. You have to hash it a second time to see if it has the requisite zeros.