← Escritos

The Eddington number

From sand to atoms,to the entire observable universe: Why can’t someone else guess my private key?

Why is it that two people can generate the same private key? Or how can a wallet generate a private key offline simply by picking a random number and be sure that nobody else has picked that private key before?

Or how do I know that nobody else is using the same seed as me?

Or how do I know that nobody else can figure out or guess which private keys I’m using since there may be millions of users generating millions of private keys out there?

And this is a really common question and it has to do

with the sheer magnitude of the numbers we’re talking about. And it’s a topic that is often misunderstood. So let’s put it into perspective. First of all, let’s understand that a private key is a number. That’s all it is. It’s a pin number if you like. And it’s a number that allows you to identify yourself as the owner and sign for an amount that is stored on the blockchain and signing is another mathematical or arithmetic manipulation you do based on your private key, this very long number.

Now you will often hear me say that a private key is just a very long number but how long is it exactly?

A private key on the elliptic curve used in Bitcoin is a 256 bit number.

That means it is 256 binary digits. So in math, we would estimate that number. We would calculate that number rather not estimate as two to the power 256.

Now most people have problems with exponents and to demonstrate how most people have problems with exponents, I’m going to purposely make several errors in this rabbit hole where I will mix up what I’m saying about exponents, but I’m doing this entirely deliberately just so that you can feel more comfortable about the fact that all of us make mistakes.

No I’m not.

All right, so two to the 256, okay, what is that number?

That’s two multiplied by two, multiplied by two, multiplied by two, by two, by two, by two, by two. And if you line up the number two, 256 times multiplying it by itself, you get two to the 256.

All right, so now let’s talk about why exponents are so weird.

What is half of two to the 256?

Well, half of two to the 256, is two to the 255.

Now you may have thought that half of two to the 256 is two to the 128, that’s a normal thing but then you’re confusing the exponents with the number itself. The exponents tells you how many times you multiply by two. So two to the 255 times two, is 255 two’s in a row and one more. So it’s 256 twos in a row.

So two to the 256 is double whats two to the 255 is. And this consecutive doubling creates an unfathomably large number.

Now we say unfathomably, but what exactly does that mean? Well first of all, let’s make easier

and turn it into decimal.

So if you take two to the 256 and you express it in terms of a decimal number, it becomes a number that is 10 to the 77. That means you could write one, and add 77 zeros after it and you would have this number, 77 zeros, it’s 10 times 10, times 10, 77 times. How big is that? Well, often people try to use physical analogies.

So, you know, what do we use for expressions of things that are very big, a drop in the ocean?

Not good enough because there are more than 10. There are far, far more numbers in 10 to the 77 than there are drops in all of the oceans.

So let’s try something else.

How about a grain of sand.

A grain of sand out of all of the grains of sand, all of the grains of sand, and all of the beaches, and all of the ocean floor, in all of the deserts, on the entire planet earth, how many grains of sand are there?

Well, people have done a variety of calculations and the numbers they come up with they’re pretty speculative. But many people would agree on a number around 10 to the 20.

So that’s 10 with 20 zeros, 10 to the 20 grains of sand.

There are 10 to the 20 grains of sand on planet earth. Let’s assume that’s true. Eh, the thing with exponents is how off do you have to be? It’s somewhere between 10 to the 16 and 10 to the 20.

But 10 to the 20 is 10,000 times more than 10 to the 16. So, you know, one or two numbers in the exponents aren’t going to make a big difference in your calculation.

It’s a huge difference in the number. So if it’s not 10 to the 20 but it’s 10 to the 19, that’s 10 times less sand but it doesn’t really change my comparison to a number as big as 10 to the 77.

All right, let’s keep going. So one out of 10 to the 20 grains of sand, isn’t enough to explain the sheer number of private keys.

If I put this into your mind and I said

go out there on the beach and pick one grain of sand

now, what is the chance that somebody else walked out onto that specific beach could pick that specific grain of sand.

Hell, even if I told you, pick one grain of sand out of a bucket, what are the chances that somebody else could pick that grain of sand out of that bucket. Now take it to the beach.

Now, take it to the entire ocean floor. Now take it to every beach on the planet, and all of the deserts that are tens of feet deep with sand. And now you’re beginning, no, you’re not.

You’re not beginning anything. We’re still a 10 to the 20 and we don’t need even realize how bad that is, how badly it represents the number 10 to the 77.

So let’s take it one step further.

Let’s take one grain of sand and think about

what it’s made of. And it’s made of, well it’s made of molecules, really. Molecules of a substance that’s primarily silica the most common substance on this planet. So molecules of silica, how many molecules of silica in a single grain of sand, a spec that is about a millimeter cubed, how many grains, how many molecules in that grain? Well, we can do a calculation based on a number,

called the Avogadro number, that calculates

the amount of atoms in a one mole of a substance. And if you do the math, you’re going to end up with a number that is surprisingly very similar to the number I mentioned before 10 to the 20.

So there is approximately 10 to the 20 molecules of silica in one grain of sand, more or less. All right, so we’ve got 10 to the 20. So if I look at a single grain of sand and I looked at it under an electron microscope and I could see down to the single molecule of silica, and I said, pick one of those.

And what if we multiply these two numbers together?

What if we said, pick a molecule of silica from any grain of sand anywhere on the planet, does that give us a bigger number? Oh boy, I mean, that’s 10 to the 20, times 10 to the 20, and that’s what? 10 to the 40.

So this is how exponents work. If you multiply two numbers together, it’s the same as adding up their exponents. So 10 to the 20. So 20, 10s in a row, multiply it by another 20, 10s in a row, give you about 40, 10s in a row. It’s fairly simple once you think of it as simply a series of multiplications.

So 10 to the 40 molecules of silica on this planet.

How far are we from 10 to the 77? Still a ways to go? All right, well, what if we took all of the planets? The solar system has how many? Well Pluto is or isn’t a planet? Are we counting the sun? Do gas giants have sun?

Let’s just assume these 10, we’re rounding. There’s 10 planets. Why am I doing that? Because we’re counting in base 10. So let’s take all of the planets in the entire solar system.

Whew, all of the planets in the entire solar system, let’s say it’s 10, we’re rounding and they’re all made of sand. They’re made basically sand and times 10 planets.

So did we put a dent? We had 10 to the 40 molecules of silica on this planet. What happens when you multiply that number by 10? All right, 10 to the 41.

Shit, we’re really not making any progress here.

Okay, let’s go bigger. Let’s go bigger.

The Milky Way, a hundred billion stars,

that should do it, right. A hundred billion stars. What’s a hundred billion? So a billion is nine zeros and a hundred billion is 11 zeros. So all of the stars in the Milky Way galaxy, assuming each one is a solar system like earth and has 10 sandy planets completely exaggerating.

We don’t know that, but let’s take all of that. So we just added 11, 10 to the 11 and we multiplied that by 10 to the 41. And now we’re at 10 to the 52.

Shit we’re still not anywhere near 10 to the 77. We’ve just done all of the molecules of silica in all of the sands in all of the sandy planets, in the solar system and across the entire Milky Way of a hundred billion stars

and we’re still at 10 to the 52.

What do I have to do with you people?

All right, let’s take all of the galaxies. Fuck it, all of them. How many are there? We don’t know a hundred billion galaxies possibly?

A hundred billion galaxies, that’s just 11. That’s just 10 to the 11. We multiply all of the galaxies that we know off, times all of the molecules of silica, and all of the beaches and oceans, and all of the planets across the entire solar system, and all of the stars, and all of the galaxies, in all of the galaxies.

And we’re at 10 to the 63.

And we’re still nowhere near tend to the 77

and I could keep going, but somebody’s already done that. And the person who did this is a person called Eddington.

And Eddington tried to come up

with an estimate of how many atoms of everything there are in the entire visible, observable universe.

That means if you take the observable universe which is the part of the universe that has lights that will ever reach us, the matter that is all within the observation cone of space-time that we occupy as humans, 13.8 billion light years across in space time. And you take that and you take all matter every atom of hydrogen in that entire observable universe and you count all of these atoms,

10 to the 77 is the number you come up with.

The Eddington number happens to be the center of the range of estimates for the Eddington number happens to be the same as the maximum number of keys in Bitcoin, which means that every atom of matter in the entire observable universe of a hundred billion galaxies and more, everything that is making up everything that we can observe in our space time cone could have its own Bitcoin private key.

So pick an atom, any atom, and see if somebody else picks the same one.

sources

https://www.youtube.com/watch?v=2eZ5DP2P5As https://github.com/bitcoinbook/bitcoinbook/blob/f8b883dcd4e3d1b9adf40fed59b7e898fbd9241f/ch04.asciidoc