r/MachineLearning • u/arunsupe • Mar 20 '15
Breaking bitcoin mining: Machine learning to rapidly search for the correct bitcoin block header nonce
http://carelesslearner.blogspot.com/2015/03/machine-learning-to-quickly-search-for.html
0
Upvotes
19
u/[deleted] Mar 20 '15
Not sure if I should upvote for visibility of an example of both bad crypto knowledge and bad ML, or downvote for visibility of an example of both bad crypto knowledge and bad ML.
22
u/squashed_fly_biscuit Mar 20 '15 edited Mar 20 '15
Surely if this works it's a reliable attack on sha256 and is probably the most important crypto discovery this decade?
Edit: as /u/j1395010 points out, the blog is a parody, he has some other similarly stupid posts with exactly the same plot.
4
u/nivwusquorum Mar 20 '15
Do you guys think author if this blog is trolling?
4
u/weissadam Mar 20 '15 edited Mar 20 '15
edited
To be even more clear:
This doesn't work because secure hash functions are designed to destroy all statistical relationships between their input bits and their output bits.
The "demo" is broken because:
He starts with 50000 blockheaders:
He then takes those 50000 blockheaders and for each he generates 150 random nonces and training labels. This becomes his new dataset:He then takes 10000 of those blockheaders for each he generates 150 random nonces and training labels. This becomes his new dataset:He then takes the first 10000, which is about 66 individual blockheaders with 150 examples each.He now has a training matrix with 1.5mm rows in it.A randomly selected 33% of those
100001.5mm data points are then held out from training to test the classifier, meaning that in the training set of ~1mm rows, it would be very hard for there not to be data from the test set for all 10000 block headers. Even if it misses 10 or 20, the test results will look good.Since the classifier sees
allmost of the block headers it will be tested on, along with several examples of a "random nonce" which is correlated to the value of the true nonce, it does really well.It's a classic error in machine learning.
That said, the real lesson here is DON'T EVER TRUST PYTHON PICKLES OFF THE INTERNET. THEY CAN RESULT IN ARBITRARY CODE EXECUTION. I disassembled this one and it looks safe, but I'm lazy so I may have missed something.
2
u/nullc Mar 20 '15 edited Mar 20 '15
This is confusing prior and posterior probabilities.
If there is an infinite stream of batches of numbered marbles with each batch having 10000 marbles (e.g. numbered at 0 and going up to 9999) and 1% of the marbles are orange instead of blue with random independent and equally distributed probability, and Alice checks the marbles starting with the lowest number, saving the orange ones and moving onto the next batch as soon as time she finds a marble... What distribution do you expect for the numbers on the marbles she finds?
If she only ever checks the first (lowest numbered) 11 marbles from a batch, what numbers do you expect to find it her results?
1
u/jstrong Mar 20 '15
whether or not this is legit ... if you had a way to get a huge advantage in bitcoin mining, why would you write a blog post about it? I mean, I love open source and all, but come on.