Why bitcoin addresses have different number of characters?

0

With the help of bitcoin wiki I learned that every bitcoin address stands for a number and that shorter addresses are valid just because they happen to start with zeros, and when the zeroes are omitted, the encoded address gets shorter.

Source: https://en.bitcoin.it/wiki/Address

I am not sure I fully understood everything. First of all, I suppose the part about a "bitcoin address stands for a number" refers to hexadecimal digits?

Other point I'd like to clarify:

How the zeros can appear while address is generated in the first place? I thought that zeros (along with l, I and O) does not exist in Base58Check encoding at all.

D-Samp

Posted 2018-09-11T14:52:53.597

Reputation: 61

Answers

2

Bitcoin addresses are 160bit numbers. They are derived by running the public key through hash functions. The result is a number in a fixed range i.e. 0 to 2^160. This is then encoded in base58check or bech32. You could represent it as hexadecimal as well if you liked.

2 and 53 are both random numbers inside 0-100. One takes 1 character to write out while the other takes 2 characters to write out. Instead of writing them in the decimal number system I could write them in hexadecimal and that would not change.

Base58check is just another encoding format. It's converting the number into base 58 number system and adding a checksum at the end to prevent typos.

You can represent zeroes in all of the above number systems/encoding formats. You may do it with characters other than 0 though. In the case of base58check 0 is represented with 1.

Abdussamad

Posted 2018-09-11T14:52:53.597

Reputation: 1 850

Thank you. Could you also clarify how bitcoin address gets "1" at the start? I've read this Technical_background_of_version_1_Bitcoin_addresses . In the end we can see that two 0 are added before encoding into base58check. Why we have only one "1" instead of two "1". The table you provided says that 0 converts to 1.D-Samp 2018-09-12T13:43:04.663

see number 5 here

Abdussamad 2018-09-12T17:57:07.603