PROOF OF WORK CHALLENGE, Bounty: 1000 sats.
This is an educational challenge aimed at begginers please leave it be if you are well
versed in Proof of work, here is the challege:
I'll give you a block represented as a piece of text, and you have to mine it like in Bitcoin.
The first to prove they mined the block takes the reward, what is mining you ask? Hashing the block (in Bitcoin the block header)
over and over again until you get a hash that is low enough to reach the target, the target for this challenge is:
0000000f00000000000000000000000000000000000000000000000000000000
And the algorithm SHA256, just like in Bitcoin. Which means you need to come up with a hash that starts with 7 zeroes.
Then you might ask, but hashing the same text always gives the same hash, how do I make it start with zeroes? Here is the
catch, I'll give you a piece of data inside of the block you can change, it's called the nonce, you can put any number or text
in there, it's not size contrained like in Bitcoin, but you can only change the nonce in the block that means the value of the nonce inside the double quotes,
nothing else, Bitcoin let's you change some other data aswell like the coinbase data.
For this target difficulty you are expected to try a few BILLION times, below is the block and the hash of nonce 0, I generated the hash
in Python but in theory you could use any sha256 implementation, even pen and paper (please don't). Please check that your sha256 also hashes
the block with nonce 0 to this hash or you will never be able to reach a valid solution.
To claim the bounty you need to comment on this note with the nonce that mines the block, the fastest miner takes it all (please don't use ASICS, let the newbs have a shot).
Here is the block:
{"Name":"Pretty cool block","Nonce":"0","Transactions":["OP_RETURN 'taxation is theft'","OP_RETURN 'Imposto é roubo'"]}
Here is the hash of the above block:
298736bab199101b89291aef566017bd1294ab778b2139ae0ef0d222a64caf69
Python code to hash:
block = """{"Name":"Pretty cool block","Nonce":"0","Transactions":["OP_RETURN 'taxation is theft'","OP_RETURN 'Imposto é roubo'"]}"""
print(sha256(block.encode('utf-8')).hexdigest())
Example:
Trying some other nonce:
{"Name":"Pretty cool block","Nonce":"fjrovho443443","Transactions":["OP_RETURN 'taxation is theft'","OP_RETURN 'Imposto é roubo'"]}
That hashes to:
469c2774ddf74a75584f327bbd982bfb436cc6e04cc0ccf400a193a430360ecd
No zeroes at the beggining, better try again with another nonce.
Happy mining!