# How can we derive all work ever done on the system from the lowest hash ever found?

If not mathematically (I imagine the proof might be quite rigorous), could you please provide an intuitive explanation for why the lowest hash ever found tells approximates the total amount of work ever done on the system? Source: https://youtu.be/zYzEmBlJ77s?t=4720

My thinking: We can figure out the probability of finding a hash that is lower than the hash we found. From there, we can find the "mid-point" of a distribution for how many attempts it would take to find such a hash. So it just gives you a point on a distribution.

Thank you!

Every hash attempt, regardless of who does it, or what difficulty it occurs at, is an independent evaluation of a hash function, resulting in a number uniformly distributed between 0 and 2256 - 1.

Now consider the distribution of the minimum of N independent samples. See this question for a derivation, but the result is that the average of that distribution is approximately 2256 / (N+1).

This gives an intuition about the relation between the smallest observed hash and the number of hashes performed: on average, the minimum will scale approximately proportional to 1 / (N+1) with N performed hashes.

The statistical tool for estimating N from the observation is called likelihood estimation: we have a probability distribution with unknown parameter N, and make one observation from that distribution. That distribution of the minimum of N hashes (if we simplify it a bit by turning the output of hashing into a continuous real function, uniformly distributed over [0, 2256]), has probability density function fN(x) = N(1-x/2256)N-1. Given an observation min_hash, the value for N that maximizes fN(min_hash) (the maximum likelihood estimator) is -1 / log(1 - min_hash/2256). For small values of min_hash, that expression is closely approximated by 2256/x - 1/2.

Proof-of-work as used in Bitcoin relies on finding low hashes, in other words finding hashes that begin with a certain number of zeros. To find a hash whose binary representation starts with 30 zeros, you would need to do, on average, 2^30 attempts. When you find this hash and present it, it is a proof that you have actually done about as much work. And it works both ways, when you perform 2^30 attempts, the lowest hash you will end up with will start with roughly 30 zeros.

Importantly, this works on any scale. The smallest block hash I could find starts with 23 hexadecimal zeros, or 92 binary zeros, which shows that the network has calculated around 2^92 hashes in its existence.

If you want to see it even more intuitively, check out this answer from a different thread that shows how the number of zeros in the lowest ever hash has been rising over time.
{"ft_lang_label":"__label__en","ft_lang_prob":0.91089076,"math_prob":0.9500142,"size":1267,"snap":"2022-27-2022-33","text_gpt3_token_len":277,"char_repetition_ratio":0.1290578,"word_repetition_ratio":0.020304568,"special_character_ratio":0.23362273,"punctuation_ratio":0.09606987,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9946337,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-17T13:07:17Z\",\"WARC-Record-ID\":\"<urn:uuid:0ff83648-e4ba-4b89-a4f0-ecdb6f97ad28>\",\"Content-Length\":\"232186\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d6b3e9dd-93a0-49c1-9c24-98f099fd6779>\",\"WARC-Concurrent-To\":\"<urn:uuid:eaa30c0b-bfe7-41d9-b52d-48ef092d151e>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://bitcoin.stackexchange.com/questions/106817/how-can-we-derive-all-work-ever-done-on-the-system-from-the-lowest-hash-ever-fou\",\"WARC-Payload-Digest\":\"sha1:PZPN5GBZSS3JO2DSV7MMUCYZ2MK4HUIL\",\"WARC-Block-Digest\":\"sha1:GEBHEPA5PG4PWBL7QFZUGF7MZIGD6ZYO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882572908.71_warc_CC-MAIN-20220817122626-20220817152626-00278.warc.gz\"}"}