base 2 (using 1024)
log(2^10) / log(2) = 10
log(1024) / log(2)
6.9314718055994530941723212145818 / 0.69314718055994530941723212145818
... = 10
... which makes sense:
you can define 1024 as a binary 1 followed by 10x zeroes
alternatively, as 1 plus the binary value of the largest 10-bit number (all 1s)
as such, a 10 "bit" number has the first value of "zero" and the highest value you can express is 1023 (the 1024th in the sequence starting with zero)
base 10 (using 1 million)
log(10^6) / log(10) = 6
log(1000000) / log(10)
13.815510557964274104107948728106 / 2.3025850929940456840179914546844
... = 6
... which makes sense:
you can define one million as a decimal 1 followed by 6x zeroes
alternatively, as 1 plus the decimal value of the largest 6-digit number (all 9s)
as such, a 6 "digit" number has the first value of "zero" and the highest value you can express is 999999 (the millionth in the sequence starting with zero, discounting negatives, fractions, etc.)
34 "digit" (base 58) bitcoin address:
log(58 ^ 34) / log(58) = 34
log(58 ^ 34) / log(58)
log(9.0479831084470077531332721514049e+59) / log(58)
138.05506235857825744441714122988 / 4.0604430105464193366005041538201
... = 34
So how many bits (binary) are required to store that?
bitcoin address can be defined as 34 "digits" of base 58, therefore:
log(58 ^ 34) / log(2) < 200
Wait, really?
log(58 ^ 34) / log(2)
log(9.0479831084470077531332721514049e+59) / log(2)
138.05506235857825744441714122988 / 0.69314718055994530941723212145818
199.17135383433745210447229303735 (round up to 200 bits)
Similar math is used to determine how many bits of entropy exist in a given passowrd pattern.
Bitcoin addresses DO NOT go up to 256 bits. They are basically only 160 bits, plus additional checksum / error-detection padding:
(citation) -
Technical background of version 1 Bitcoin addresses... potentially, it is possible to have a collision for which two different private keys (actually 256 bits) match up to the same bitcoin address (34 base 58 "digits" / 160 bits / whatever)
Another fun math thing. Earlier, someone was trying to figure out if 2^256 was closer to the number of atoms in the universe (or the visible universe, or a fraction of these atoms, or the atoms in a person)
2^256 atoms?
Well, every "mol" of hydrogen atoms weighs 1 gram:
(cite) --
Avogadro constant so aprox: 6.02214 * 10^23
great!
Now for some math & logic time:
(6.02214 * 10^23) = number of hydrogen atoms in 1 liter of hydrogen gas at standard temperature / pressure (ideal gas law)
A liter of water weighs approximately 1000 grams (1 kg)
A single water molecule weighs aprox 18 times as much as a single hydrogen atom
Therefore, 55.5 mols of water in a liter (kilogram)
7.806 * 10^26 atoms in 70 kilograms of water. The human body is mostly water.
Assuming we're mostly water, the human body has aprox 2^70 atoms
2^256 hydrogen atoms ... actually I'm just going to stop right now, converting to decimal and bypassing mass calculations:
log(2^256) / log(10) ... you're already much closer to the number of atoms in the visible universe.
... Not to worry though, since there is no point in attempting to exhaust the 256 keyspace:
Only 160 bits worth of hash used to generate bitcoin's 34 "digit" base 58 public key addresses, so you'll VERY likely have many many collisions well before you try a number of keypairs equal to the number of atoms on planet earth.