Bitcoin part 8: Big numbers

(Warning: Again I have indulged in a bit of wine.)

Before attempting to tackle the block chain, I feel the need to atone for the deadly sin of understatement. (You remember the seven deadly sins, right? Understatement, Exaggeration, False Analogy, Non Sequitur, Affirming the Consequent, Reification, and… Oh, crud, I always forget the last one.)

While numbers like “12” and “37” make for nice illustrative examples, they are so far from reality that I fear the very essence has been lost. And I want to fix that.

So, let me put it this way. Pick a number between 0 and 115792089237316195423570985008687907853269984665640564039457584007913129639935. That is, between 0 and . That is the range of output for SHA-256, the principal cryptographic hash function used by Bitcoin. The “256” means 256 bits of output, and a 256-bit value can be interpreted as an integer from 0 to 2256-1.

Go ahead, pick a number. Let me guess: You picked 37 just to annoy me, right? Fine, let’s run with it.

SHA-256 is considered “not broken”. That means nobody has ever found any value whose SHA-256 hash is equal to 37, and nobody has any clue how to find one. The SHA-256 hash of your name is not 37. The SHA-256 hash of your phone number is not 37. The SHA-256 hash of your age in seconds right now is not 37. The SHA-256 hash of the Declaration of Independence is not 37. The SHA-256 hash of the entire fourth season of “Sex in the City” on Blu-ray is not 37.

Take any idea you have, or ever had, or ever will have, encode it however you like, run it through SHA-256… and the result will not be 37.

Am I 100% certain all of these statements are true? In the strictest possible sense, no; in every practical sense, yes. The odds that any of the above are false are lower than the odds that you get struck by lightning on a clear day and then win the Powerball lottery. Twice. In fact, it’s not even close.

Ordinary experience and intuition simply do not prepare us for numbers on this scale. Finding a value whose SHA-256 hash is 37 would be a Ph.D.-worthy (if not tenure-worthy) result1. Of course, there is nothing special about 37. All of the statements above are true for absolutely any number you will ever imagine, unless your imagination involves computing the SHA-256 hash of something else. Indeed, finding any two numbers with the same SHA-256 hash is, as far as anyone knows, literally impossible by any practical definition.

So if I show you a number x, and you compute the SHA-256 hash of the fourth season of “Sex in the City” on Blu-ray and get x, then you will know I came up with x by computing the SHA-256 hash of the fourth season of “Sex in the City” on Blu-ray. You will know this as surely as you have ever known anything.

That is what “cryptographic hash function” means. And this property is the essence of the Bitcoin block chain, and therefore the essence of Bitcoin.

As we shall see next time.

1. and bad news for Bitcoin

1 comment to Bitcoin part 8: Big numbers

  • cz

    Wine fueled or not, this is one of the best explanations of the scale of large numbers and the impracticality in ever finding a collision in SHA256.

Leave a Reply