Serializations

Serialization is how the value should be stringified for signing and for transfer between systems. Most serializations use outside standards, but some requiring additional clarifications are provided here.

decimal

Used to represent integers. Strings are used to avoid issues with different implementations of numbers.

  • MUST use 0-9 representation
  • MUST NOT have spaces or separators
  • MUST be a string
InvalidWhyValid
"0x123"Must be decimal"291"
291Must be a string"291"
"291n"BigInt(291) serialization appends an n"291"

base32 multibase

Used to represent bytes. A base32 multibase string is self-identifying and always begins with the b character. The Multibase Table describes this encoding as “RFC4648 case-insensitive - no padding”.

  • MUST use RFC4648 §6 alphabet abcdefghijklmnopqrstuvwxyz234567
  • MUST be lowercase
  • MUST be prefixed with b
  • MUST NOT have spaces or separators
  • MUST NOT end with or contain padding characters (=)
InvalidWhyValid
BDYQDUA4TMust user lowercasebdyqdua4t
dyqdua4tMissing b prefixbdyqdua4t
b3og3k0sjWrong alphabet (base32hex was used)bdyqdua4t
bdyqdua4t=Must not have padding charactersbdyqdua4t