Foundations of Blockchain
上QQ阅读APP看书,第一时间看更新

Encoding schemes

Encoding schemes are generally used in data storage or the transmission of textual data over a medium. You can often observe the conversion of binary to text-encoding schemes in primitive cryptographic implementations.

Encoding schemes provide a compact way of representing long sequences of characters using a base. For example, a decimal system uses base 10, which uses characters from 0-9, and a hexadecimal system uses additional characters from A-F, along with the numbers from the decimal system. The bigger the base of a system, the smaller the size of the encoded string.

Base64 is an encoding scheme that is widely used to store and transmit large files such as an image. It uses 26 lowercase letters, 26 uppercase letters, 10 numerical characters, and 2 special characters ("+" and "/").

Base58 is an encoding scheme developed for Bitcoin and used in several blockchain applications. Base58 is actually a subset of Base64 and was created with the intention of providing better readability. The characters in Base64 that are omitted in Base58 are 0 (zero), O (uppercase o), l (lowercase L), I (uppercase i), and the special characters "+" and "/."

Bitcoin's 34-character Base58-encoded wallet address is as follows:

16RhN7MhhTRMDdrS3szys5pEpmS2YGTMsk