The math problem is basically a twist on “Im thinking of a number between one and a billion” first person to guess it wins.
you need to know a few things:
1. there’s something called “hashing” that takes in inputs and outputs a seemingly random output (see this tool [https://emn178.github.io/online-tools/sha256.html](https://emn178.github.io/online-tools/sha256.html))
2. hashing will give the same output every time if the inputs are exactly the same (inputting “reddit” into SHA256 will always give “2e183f2a7a70de1c10044f4e370a221a792736cb074835afcde6a9df457d413b” as output)
3. changing even a single bit of the input will give an unpredictable, and completely different answer (inputting “Reddit” (capital R) gives “eb0050f72303bcdbbdc071e2a3bf810c903be8d05cdf09f7c3106f2b6f9878bf” which has nothing to do with the hash from “reddit” above)
4. These ‘outputs’ are usually formatted in hexadecimal (using characters 0123456789abcdef), but can be in binary or in decimal form and just represents a number (the output of ‘reddit’ being hashed from step2 in decimal form is “20849231319617073542494766561462311394317076535891665807670320877453132513595” and will be smaller than the max number representable in 256 bits)
5. the bitcoin network sets some threshold that the answer will be lower than (“im thinking of a number that added after the word “reddit”, its hashed value is a number lower than 10000000000000000000000000000000000000000000000000000000000000000000000000000″).
6. The first miner to find one wins, so you either get really lucky or are able to try hashing a bunch of times really fast.
“reddit1” hashes to “80992191607849107266945937912545788070534224368496577081050248192831763894397”
“reddit2” hashes to “91388177237288728016826958650204545595078502430216916238498236656504089532824”
“reddit3′ hashes to “5889602377724921096772519443223865920769791603544214551718898286268048025550” WINNER! (doesnt look like it cuz we dont write leading 0’s before decimals, but it’s actually 058896…etc)
“reddit4” hashes to “35390741966812078950407895123414739401095538395380331101523408047775363744221”
“reddit5” hashes to “115699904307572733452589137606698425027623415455401192282092685292621194302023” (almost! but try again cuz it’s not good enough)
“reddit6” hashes to “7026529653835210427635203474129647138418149896339361660188653916361750185586” WINNER!
“reddit7” hashes to “59415021918001391266558038051229429712161014466127143009275001879126847080756”
Because of these properties, you’re basically just guessing one input at a time and hashing it to find a valid output.
More reading: [https://en.wikipedia.org/wiki/Hashcash](https://en.wikipedia.org/wiki/Hashcash)
The maximum value of an unsigned 256-bit integer is 2 raised to the power 256 − 1, written in decimal as 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,935 or approximately as 1.1579 x 10 to the power 77.
I wrote a quick python program to find this, cuz why not.
import hashlib
given_constant = ‘reddit’
count = 0
minVal = 10000000000000000000000000000000000000000000000000000000000000000000000000000
while (count < 100):
count = count+1
string_to_hash = given_constant+str(count)
result = hashlib.sha256(string_to_hash.encode(‘utf-8’)).hexdigest()
if int(result,16) < minVal:
print( count, int(result, 16))
TLDR: I’m looking for a number that when you hash it with these other constants, you get a resulting hash output smaller than some target value. first to guess it wins.
Latest Answers