5

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?

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.