MENU

All you need to know about 2^256

April 8, 2019
0
271
0

How to pronounce 2^256?

2^256 is pronounced “two to the power of two hundred and fifty six”.

What does it represent?

Computers represent numbers in binary. Here is an example where we have 2 bits, where each bit can represent a ‘1’ or a ‘0’ allowing us to produce 4 possible combinations:
00 = 0
01 = 1
10 = 2
11 = 3

The formula “2^number of bits” gives us the range of numbers that we can represent. So 2^2 = 4, which is true from the table above where we have 4 possible values. (In computers, we start counting from ‘0’)

If we have 3 “bits” then we have 9 possible combinations (ie 2^3=9):
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
101 = 7
111 = 8

If we have 256 ‘bits’, then we have 2^256 possible combinations which is a really large number!

What does 2^256 look like in decimal?

115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936
OR
1.158 x 10^77 (this is 1.1 with 77 zeros after it).

Source: https://defuse.ca/big-number-calculator.htm

How do you pronounce 2^256?

115 quattuorvigintillion 792 trevigintillion 89 duovigintillion 237 unvigintillion 316 vigintillion 195 novemdecillion 423 octodecillion 570 septendecillion 985 sexdecillion 8 quindecillion 687 quattuordecillion 907 tredecillion 853 duodecillion 269 undecillion 984 decillion 665 nonillion 640 octillion 564 septillion 39 sextillion 457 quintillion 584 quadrillion 7 trillion 913 billion 129 million 639 thousand 936

Source: https://www.wolframalpha.com/input/?i=2%5E256

What can I compare 2^256 with?

2^256 = 1.158 x 10^77

There is an estimated 7.5 x 10^18 grains of sand on Earth
There are estimations of anywhere from 30 x 10^21 to 70 x 10^21 and even 10 x 10^23 stars in the “observable” universe.
There is an estimation of anywhere from 1 x 10^78 to 1 x 10^83 atoms in the known, observable universe.

Here is an interesting video on 2^256 that a friend of mine brought to my attention (Thank Barry!)

Why is 2^256 important?

2^256 is important is because this is the ‘perceived’ range of all possible private keys values cryptography uses in blockchains

Does that mean there are 2^256 possible private keys?

Not quite. Not all numbers in the 2^256 range are on the mathematical curve used for finding a matching public key. Bitcoin and Ethereum (and many others) use the secp256k1 elliptic curve which defines the range slightly less than 2^256. 432420386565659656852420866394968145599 less to be exact.

The range, ‘n’ is actually from 0 to 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 (as defined in the SEC2 standard).

2^256 = 115792089237316195423570985008687907853269984665640564039457584007913129639936
n = 115792089237316195423570985008687907852837564279074904382605163141518161494336
2^256 – n = 432420386565659656852420866394968145599
but this is a minor point. This is like computing 1,000,000 minus 10 which can be still considered as one million.

Side note: The name secp256k1 can be broken down to SEC which is the Standards for Efficient Cryptography SEC2. p means that the curve coordinates are a prime field, 256 means the prime is 256 bits long, k means it is a variant on a so-called Koblitz curve, and 1 means it is the first (and only) curve of that type in the standard. (Source: https://bitcointalk.org/index.php?topic=2699.0)

But wait, there’s more!

A Bitcoin address is a RIPEMD160 of the public address. This means that the length of the address is 160 bits meaning the possible keyspace, or possible range of values, is now reduced to 2^160 which is still a very big number. Ethereum also reduces the key length to 160 bits. Represented in decimal it is: 2^160 = 1.46 x 10^48 or 1461501637330902918203684832716283019655932542976.

How big is this? The width of the observable universe is 8.8 x 10^26 meters or 8.8 x 10^29 millimetre. If a Bitcoin or Ethereum address represented a length of 1mm, it would span slightly under twice the length of the observable universe!

1.46 x 10^48 is actually the total amount of unique wallet addresses possible. Now here is the tricky part. We have 2^256 possible private keys that maps to 2^160 possible public keys. Logic tells us that there will be more than 1 private key for every public key. In fact, all you have to do is find any one of the roughly 2^96 private keys whose corresponding public key hashes to that address. In other words, 2^96 represented how many potential PRIVATE keys would work for a single PUBLIC key. Good luck finding that though!

Summary

In summary, the range of possible values of private keys are very, very large. Although the possible range of private keys is slightly under 2^256 as defined in the SEC2 standard. The private key is then hashed to 160 bits, so the possible range becomes 2^160 which is still a very large number, almost twice the length of the observable universe in fact! The point being that the possibility of two private keys being the same is super duper duper low.

Ref: https://www.reddit.com/r/Bitcoin/comments/279l5v/an_exhaustive_look_at_private_keys_for_the/

Leave a Comment!

Your email address will not be published. Required fields are marked *