5

Basically the same question as this one, except in my case the value to be hashed doesn’t have to be a valid Bitcoin block, but is a bytearray of arbitrary length and content (and that my use case is completely unrelated to Bitcoin).

In details, I have to deal with a computation that does x^ ((Integer)sha256(y)&0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000), and while I know it’s impossible to have a value of bytearray y that yield the smallest possible number in order to get a computable result, I’m nevertheless still curious in knowing the smallest value of sha256 ever found…
As it’s arbitrary data, I suppose the smallest value ever found is lower than the smallest hash value of a Bitcoin block ever found. Bitcoin hashes are sha256(sha256(80 Bytes)) but in my case even 0 bytes is acceptable.

user2284570
  • 324
  • 4
  • 19

2 Answers2

12

We can almost certainly say the hash corresponding to the Bitcoin block 756951 mined on 2022-10-04 01:28 UTC is the smallest SHA-256 hash ever computed by anyone:

0000000000000000000000005d6f06154c8685146aa7bc3dc9843876c9cefd0f

This hash starts with an incredible 97 binary zeros.
If you would like to find another hash starting with that many zeros - you would have to calculate about 1.58e+29 (2^97) hashes to achieve a 50% probability of finding one.
That's thousands of times more than the estimated number of drops of water on Earth.

Bitcoin miners are calculating many orders of magnitude more hashes than everyone who uses SHA-256 for any purpose combined.
Therefore, they are the most likely to calculate an extremely low hash.
Currently, all Bitcoin miners combined are calculating about 67 times more hashes than the number of grains of sand on Earth - every single second.

NOTE: I've found this hash by writing a Rust program that downloaded the data from https://gz.blockchair.com/bitcoin/blocks/ and searched the files for the lowest hash.

TypicalHog
  • 133
  • 9
8

TL;DR

Let's try to estimate this, based on some purported data [if someone has better data they can make the estimate better as well].

There is a claim I read somewhere, that I can't find a link to, that there were 200 quintillion SHA256 hashes computed in Bitcoin mining per second, sometime in the recent past.

If this is reasonable, then the minimum is about $2^{159}$ which is a 256 bit number with 97 leading zeroes.

Details:

If you have data about how many in other applications, in case this is not negligible compared to Bitcoin computations, you can adjust.

We model the SHA256 output as being uniformly distributed on $$ \{0,1,\ldots,M-1\} $$ where $M=2^{256}.$ Assuming independence, if you have $n$ SHA outputs $X_1,\ldots,X_n$ then the minimum $$Y=\min\{X_k:1\leq k\leq n\}$$ satisfies $$ \textrm{Prob}\{Y > y\}=\left(\frac{M-y}{M}\right)^n. $$ This means that if you want this probability to be say $2^{-k},$ then it can be computed by plugging in $M$ but you'll need to take logs and be careful.

If you're lazy and only want the expected minimum, you can find the CDF ${Prob}\{Y \leq y\},$ differentiate to get the density, and compute the expectation. See this question where this is detailed. If the distribution of the $X_i$ and $Y$ is projected on to the interval $[0,1)$ by dividing the hash output by $2^{256},$ and treating it as a real valued random variable, then the expectation is simply $\frac{1}{n+1},$ which is pleasing. Lifting back to $\{0,\ldots,M-1\}$ gives an expectation of the minimum being $$ \frac{M}{n+1}. $$ For 300 quintillion hashes per second (check my computations) I get a hashrate of $2^{67}$ per second or $2^{92}$ per year. So using a year, we get the expected minimum $Y$ to be approximately $$ \frac{2^{256}}{2^{97}}=2^{159}, $$ with 97 leading zeroes in its binary expansion.

kodlu
  • 25,146
  • 2
  • 30
  • 63