Live data from Hacker News

Show HN: SHAllenge – Compete to get the lowest hash

shallenge.quirino.net

111–120 of 136 posts

Re: Show HN: SHAllenge – Compete to get the lowest hash

#111

60 MH/s with parallel Rust code (rayon) on a 5900X. Got stuck on 8 zeroes, changed my nonce prefix and got lucky with 9 zeroes after 10 seconds! Currently sitting at #73 and pondering whether to write a GPU solution. https://gist.github.com/zdimension/63d3aa5f04573267f423520e4...

There are still some gains to be had on the CPU. I'm at ~570 MH/s on a 5950x

Re: Show HN: SHAllenge – Compete to get the lowest hash

#112
post #93

Just lucked into 33rd place with 16 lines of single threaded C# doing ~1MH/sec. 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.

Chose to fix that, but won't delete the submissions that used it. Thanks!

I used a classic cheat code to get a valid entry and a bit higher :D

    jodrellblank/710260141000+idkfa 
though why limit the filter to all zeroes, here's double-0 facade...

    jodrellblank/uhxbvhbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

    00FACADE F2036CC41D004F2EB0F35B079C589D724D5A49BD796363C9A13C27D8

Re: Show HN: SHAllenge – Compete to get the lowest hash

#114
I've made a few changes in my software, use Base64 instead of numerical values, now I'm getting the following error: "Nonce must be 1-64 characters long and consist only of Base64 characteres"

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})$/;

Re: Show HN: SHAllenge – Compete to get the lowest hash

#115
Wasn't expecting to stay in the top 100 for this long!

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 :]

Re: Show HN: SHAllenge – Compete to get the lowest hash

#117
post #18

Earlier quoted context omitted.

At least I'm not (second place currently), I'm using a single threaded rust program that chatgpt wrote for me. I'm getting 10-15 million hashes per second. 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

Hey. It's nothing very fancy. About 150 lines of C/CUDA code with no deps, including args parsing and logging. The code runs at steady rate of 18.00-18.40 GH/s at cloud GPU. In fact it's not hashes-per-second, but actually messages-per-second checked. It launches a 64⁶ kernels in a loop, where each launch checks first two bytes of the SHA of a message concatenated with unique 6-byte nonce per kernel + 6-byte incremen…

I think we've done something similar in our kernels, because I've likewise struggled to squeeze more than ~18GH/sec from a rented 4090. I think the design of SHA256 makes it hard to avoid many of the loop iterations. It's possible there are some fun GPU specific instructions to parallelize some of the adds or memory accesses to make the kernel go faster.

If you limit your variable portion to a base16 alphabet like A-P, radix encoding would just be `nibble + 0x41`. Sure you're encoding 4x as many values, but with full branch predictability. You'd have to experimentally determine if that performs any better.

You could also do something theoretically clever with bitmasking the 4 nibbles then adding a constant like 0x4141 or 0x00410041 or something (I'm too tired to think this through) and then you can encode twice as many per op assuming 32-bit bitwise ops are similar in speed to 16-bit bitwise ops.

Anyways this has been a cool challenge. You might also enjoy hunting for amulets - short poems whose sha256 hash contains a substring that's all 8: https://news.ycombinator.com/item?id=26960729

Re: Show HN: SHAllenge – Compete to get the lowest hash

#118
post #117

Earlier quoted context omitted.

Hey. It's nothing very fancy. About 150 lines of C/CUDA code with no deps, including args parsing and logging. The code runs at steady rate of 18.00-18.40 GH/s at cloud GPU. In fact it's not hashes-per-second, but actually messages-per-second checked. It launches a 64⁶ kernels in a loop, where each launch checks first two bytes of the SHA of a message concatenated with unique 6-byte nonce per kernel + 6-byte incremen…

I think we've done something similar in our kernels, because I've likewise struggled to squeeze more than ~18GH/sec from a rented 4090. I think the design of SHA256 makes it hard to avoid many of the loop iterations. It's possible there are some fun GPU specific instructions to parallelize some of the adds or memory accesses to make the kernel go faster. If you limit your variable portion to a base16 alphabet like A-…

SHA256 is designed as such that the maximum amount of data that can be contained within a single block is 440 bits (55 bytes.)

If you carefully organize the nonce at the end and use all 55 bytes, you can pre-hash the first ~20/64 rounds of state and the first several rounds of W generation and just base further iterations off of that static value (this is known as a "midstate optimization.")

> If you limit your variable portion to a base16 alphabet like A-P

The more nonce bits you decide to use, the less you can statically pre-hash.

In FPGA, I am using 64 deep, 8-bit-wide memories to do the alphabet expansion. I am guessing in CUDA you could something similar with `LOP3.LUT`.

Re: Show HN: SHAllenge – Compete to get the lowest hash

#119
post #114

I've made a few changes in my software, use Base64 instead of numerical values, now I'm getting the following error: "Nonce must be 1-64 characters long and consist only of Base64 characteres" 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 (garethgeorg…

The site owner changed equals from accidentally-allowed to forbidden, but left any existing solutions using it. See comment and reply here: https://news.ycombinator.com/item?id=40724707

Re: Show HN: SHAllenge – Compete to get the lowest hash

#120

60 MH/s with parallel Rust code (rayon) on a 5900X. Got stuck on 8 zeroes, changed my nonce prefix and got lucky with 9 zeroes after 10 seconds! Currently sitting at #73 and pondering whether to write a GPU solution. https://gist.github.com/zdimension/63d3aa5f04573267f423520e4...

There are still some gains to be had on the CPU. I'm at ~570 MH/s on a 5950x

I'm a bit late to the game, but I managed to squeeze out about 1 GH/s on an i7-13700K.
Post reply on HN