Canonical Msgpack - Algorand Specifications
Keyboard shortcuts
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
- Auto
- Light
- Dark
Algorand Specifications
Algorand uses a version of MsgPack to produce canonical encodings of data.
Algorand’s msgpack encodings are valid msgpack encodings, but the encoding function is deterministic to ensure a canonical representation that can be reproduced to verify signatures.
A canonical msgpack encoding in Algorand must follow these rules:
Maps MUST contain keys in lexicographic order;
Maps MUST omit key-value pairs where the value is a zero-value, unless otherwise specified;
Positive integer values MUST be encoded as
unsignedin msgpack, regardless of whether the value space is semantically signed or unsigned;Integer values MUST be represented in the shortest possible encoding;
Binary arrays MUST be represented using the
binformat family (that is, use the most recent version of msgpack rather than the older msgpack version that had nobinfamily).