Encoding is not encryption, but it can also be understood as public encryption of passwords. In the field of computing, encoding is ubiquitous, and the encoding table is the basic rule of encoding, sometimes referred to as a 'protocol.' 'Modular arithmetic' is the technical foundation of encoding.
Base64 and Base58 encoding tables and Base58Check encoding format
The most famous is the Base64 encoding table, which is used to encode binary data into ASCII string format. Since computers can only process binary numbers, the purpose of encoding boils down to two main points:
Encoding long binary numbers into shorter, more readable forms is beneficial for storage. When used, it can be reversed into binary according to the encoding table.
Encoding the text, images, and videos that need to be saved into a digital format for easier processing by computers, and then displaying the images according to the encoding rules after processing.
Essentially, the driver is executing a predetermined encoding table at both ends of the communication, also known as a 'protocol.'
The Base64 encoding table can be searched for independently. Base58 is an improved version of Base64, used as an encoding method in the Bitcoin system. The main difference is that confusing characters such as lI (lowercase L, uppercase I) and 0O are removed, and then re-encoded into a table of 58 characters.
The method of adding some check digits to the data to be encoded in Base64 before performing Base64 encoding is what we call the Base58Check encoding format.
2. Modular arithmetic
'Modular arithmetic' belongs to the field of number theory (such as the Euclidean extended theorem, Euler function and theorem, etc.) and is also a technical cornerstone in the field of encryption (both RSA and ECC encryption algorithms are based on modular arithmetic rules). The operations of 'modular arithmetic' can be searched for. It can also handle conversions between different bases in encoding, such as converting a decimal encoded number into a binary number by continuously taking the modulus of 2 (n mod 2) of the decimal number.
In Bitcoin, many data types such as private key, extended private key, public key, extended public key, address, compressed address, etc., are encoded using Base58Check format.
By changing the highest bit of the binary, the converted encoding format can be fixed to certain characters like 1, 3, K, L, making it easier for users to identify its characteristics. In the next article, we will briefly describe why this effect occurs.