123 points · by quirino · 2y ago · 133 comments
Now that we have plenty of proof of work completed, we don't really need any more. You can bootstrap your new coin by burning Bitcoins as a provable value sink to get it started on the path to POS.
I wish cryptocurrency folks would stop pretending it is about decentralization or distributed systems, and that anything that allows them to bypass financial regulation is good enough.
The fact that faster hashers will come about just adds some natural competition, but it's still about limiting money supplies.
The "adding more zeros" is done automatically, according to an algorithm, so that the time between blocks is more or less the same.
There's this incredible MIT course about all of this, it's where I got the idea for the site from: https://youtube.com/playlist?list=PLUl4u3cNGP61KHzhg3JIJdK08...
00000000 000003da 5849ade5 e2112447 73478c46 5fcdc744 9e247df4 11e97b28 (#1 of leaderboard)
00000000 00000000 0002a2fa b0d010ce 270927e8 c9a698a3 4f5e3d6c 4dbcffd3 (latest mined block)
Doesn't seem that impressive but keep in mind that it gets exponentially harder to find additional leading 0s and that the Bitcoin network currently finds such hashes every ~10 minutes.Edit: Looking at the data structure for a bitcoin block, for multiple reasons such as magic numbers and length, none of them would be a valid submission.
A hash is essentially just some random bytes, there is a small chance that the first hash bytes would randomly all be printable characters that fit the submission format, given that the bitcoin network has already done most of the work finding the small hashes, scanning through the blockchain trying to find a hash with a plaintext that fits the submission criteria, should be much less work.
00000000 000003da 5849ade5 e2112447 73478c46 5fcdc744 9e247df4 11e97b28 (#1 of leaderboard)
00000000 00000000 0000fac0 39d91fc6 1db532f3 879ec244 15a2bff9 cd1d4efb (latest mined block right now -- another zero added since your post)
00000000 00000000 00000000 5d6f0615 4c868514 6aa7bc3d c9843876 c9cefd0f (lowest hash ever?)[0]
[0] https://crypto.stackexchange.com/questions/110956/what-s-the...From what I recall it was a bunch of YC founders writing janky cuda code vs djb who proceeded to smoke us all.
[1] https://news.ycombinator.com/item?id=704182
[2] archive link to the dead link in [1] https://web.archive.org/web/20090717104634/http://www.engine...
[3] https://news.ycombinator.com/item?id=716851
[4] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
Got a 404 but the title was a nice throwback, $2k in cloud credits too!
There's 13 8s, so that's 1365Wh. 5 9s is 8400Wh, 2 10s is 53760Wh, 3 11s is 1290240Wh.
Total that's ~1.35MWh, which might cost $100 to $180. Very weak estimate, though.
Luck plays a tiny part too, I'm testing sequentially and I got my 9th zero with only ~7e8 hashes, a whopping 100x earlier than expected.
But seletskiy is, as you can see in his nonce which tells us that he uses an RTX4090 and has 18 Giga Hashes per second. I'm really curious how he wrote that program, as I have a Rx 7900 XTX and would love to use it for this competition haha
Running this for 1.5 hours would consume 1KWh of energy, and compute 1.134e14 hashes (or 2^46.7 if you prefer).
Assuming SHA-256 hashes are essentially normally distributed, that means that finding a hash with 13 leading hex zeroes should be a 1-in-(16^13) aka 1-in-(2^52) odds.
This gives 2^(52-46.7) or 39.7KWh on average to generate a single 13-zero hash, and ~16x that (635KWh) for a 14-zero hash. I got very lucky finding a 14-zero hash quickly, vastly earlier than average expectation, so my energy usage is quite a bit lower than that.
Design/colour scheme is nice too.
The go program beat the javascript miner within seconds. Right now it's that easy to get into the top 10.
I'm using my own SHA256 implementation in C++, and it is at least 100 times faster than the JS one. I've measured it to be about as fast as the one on the Go standard library.
I assume anyone with knowledge about GPU hashing and the will would be able to steal the top spot very quickly. Assuming seletskiy isn't already that guy. I don't have a good grasp on the compute difference between 8-9 0s and 10 0s in a reasonable amount of time.
Curiously most of the code for that JS miner was written on my phone, with the help of ChatGPT.
I didn't have my laptop with me and was curious how fast a phone browser would be able to mine.
It uses Peer-2-Peer in the browser and I haven't touched it in a while, but it looks like it still works. :)
Whih is really odd, since my string has only 51 chars and all chars are valid within the Base64 group.
If I remove the padding ("=") then it's good to go, however, there is a string in the scoreboard with "=" in it (garethgeorge/AHQAAAHPe0Q=)
Did the user bypassed the javascript check using curl or something?
Also, this could use some adjustments:
const nonceRegex = /^[A-Za-z0-9+/]{1,64}$/;
if (!nonceRegex.test(nonce)) {
alert('Nonce must be 1-64 characters long and consist only of Base64 characters');
return false;
}
Personally, I would use const nonceRegex = /^[A-Za-z0-9+/]{1,64}(={0,2})$/;I couldn't get wgsl to work properly, as it would need to have a sha256 implementation, and that's a bit heavy for a buzzed coding session. So, I used the simd commands, and that got me up to around 7mh/s on the m1, and a whole lot more on my desktop.
I will share the code once I get all the other optimizations I want in!
I have a bunch of other ideas to get me to my goal of 20, but I am happy to let this run for a bit! Thanks for the suggestion!
Initial C implementation got me to ~70 for a short time, then very sloppy racy pthreads one kept me at the tail end for a bit longer, but my again very sloppy cuda program running on my GTX1070 has me at 35 at the time of writing.
Rough calculation shows it to be doing 28.6MHashes/sec, and I suspect I could do a lot better than that if I knew anything about cuda programming.
I didn't read enough to know how to pick good values for blocks/threads per block, so I just benchmarked all the combinations of powers of two to arrive at the best result.
Really fun challenge!
Would be fun to see the total amount of valid submissions, and maybe the number of leading zeroes of a hash for those of us that need a moment to figure it out from hex in their head :]
Bug: The site says "nonce: 1-64 characters from Base64 (a-zA-Z0-9+/)" but it accepts "=" as well.
Reading the other answers about hand optimised CUDA and parallel Go and Rust, that's probably as high as I'll get.
jodrellblank/710260141000+idkfa
though why limit the filter to all zeroes, here's double-0 facade... jodrellblank/uhxbvhbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00FACADE F2036CC41D004F2EB0F35B079C589D724D5A49BD796363C9A13C27D8Is it even possible to have cheaper first character SHA256 algorithm?
There isn't a known way to calculate just the first bytes of a SHA256 hash faster. Each step in SHA256 depends on the value of the previous step, so you have to calculate the whole thing through. SHA256 is meant for cryptography and would be considered vulnerable to attacks if a shortcut were known.
What would be the goal of that? Do you want a cryptographic hash function, or do you want something else?
If any such shortcut would be found, it would be considered a vulnerability, and the use of SHA256 for anything involving cryptography would be strongly discouraged.
edit: up to #28 ;)
Including the code below if anyone is curious. I managed to get a 9 zero hash in under an hour on a M2 Mac Mini using it. Its only about ~3.3 MH/s which is not very impressive, but it was very easy to write.
https://gist.github.com/boyter/8600199cc6f4073dc9da380f3224f...
I suppose the next step for me would be to make use of the GPU, which is a much better fit for this job and I'm sure would increase my hash rate by orders of magnitude, but I researched it for a bit and running code on the GPU on a Mac is cumbersome to say the least.
It manages 1.1 GH/s on an Intel i7-13700K.
https://gist.github.com/zdimension/63d3aa5f04573267f423520e4...
https://gist.github.com/Chaz6/81523edaed6f31aa609daa919ff6b8...
Sorry for the late reply.
I've added a "/data" endpoint where you can get the full database in json format.
The nonce alphabet being limited makes the whole thing quite a bit more expensive.
Did you start using a GPU or where you just insanely lucky?
This is my current solution: https://gist.github.com/lovasoa/9bb6c50feed7bb264c15ae65c622...
Time to comb through this code :D
I just started on a metal implementation and it's at 320MH/s