Stellar prefixes public keys with G. Why do they use a bitwise operation VersionByteAccountID VersionByte = 6 << 3
to get the base 10 value 48? Javascript "returns the default numerical values", so why not just use the base10 value of VersionByteAccountID VersionByte = 48
directly?
Add a comment
|
1 Answer
The strkey format is a base32 encoding given by RFC4648. The first output character of the encoding is determined by the top five bits of the first byte. So the value 6 is the value corresponding to 'G' in RFC4648, and it is shifted by 3 to make it the top five bits.
Here's a more complete specification of strkey format in a SEP.