Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 51 GitHub source documents. All source documents are searchable here.
Last updated: October 7, 2025
This content is meant to be consumed by AI agents via MCP. Click here to get the MCP configuration.
Note: In rare cases it may contain LLM hallucinations.
For authoritative documentation, please consult the official GLEIF vLEI trainings and the ToIP Glossary.
MessagePack (MGPK) is a binary serialization format that encodes data structures (arrays and associative arrays) in a compact binary representation, prioritizing efficiency over human readability while maintaining cross-language compatibility.
MessagePack (abbreviated as MGPK in KERI contexts) is a binary data interchange format designed to serialize simple data structures—specifically arrays and associative arrays (key-value mappings)—into compact binary representations. The format emphasizes two core design principles: compactness (minimizing serialized data size) and simplicity (straightforward implementation across programming languages). Unlike text-based formats such as JSON, MessagePack sacrifices human readability to achieve superior bandwidth efficiency and processing performance.
Within the KERI protocol suite, MessagePack serves as one of three primary serialization formats supported by CESR (Composable Event Streaming Representation), alongside JSON and CBOR. CESR's architecture enables interleaved serialization, allowing MGPK-encoded data to coexist within CESR streams through special count codes that mark serialization boundaries.
For ACDC (Authentic Chained Data Container) credentials, MessagePack provides a binary encoding option that maintains the same logical structure as JSON variants while reducing payload size. The version string mechanism in ACDC supports MGPK through format indicators embedded in the version field, enabling parsers to correctly interpret serialized data.
CESR's sniffer component can detect MGPK-encoded sections within streams by identifying MessagePack's binary signatures. When MGPK is detected, the parser uses regex patterns to locate the , extracts length information, and processes the bounded MGPK block before resuming stream parsing. This enables where parsers can recover from errors by re-synchronizing at MGPK boundaries.
When implementing KERI/ACDC systems, choose MessagePack when:
MGPK sections within CESR streams require:
Parsers must:
Official MessagePack implementations exist for major languages (Python, JavaScript, Rust, Go, Java, C++). Use canonical libraries to ensure specification compliance and interoperability across KERI implementations.
The format's official implementations across multiple programming languages make it particularly suitable for KERI's cross-platform requirements. In scenarios where bandwidth is constrained (IoT devices, supply chain applications), MGPK's compact encoding provides significant advantages over JSON's text representation while maintaining the same data model.
MessagePack influenced the development of CBOR, which extended MGPK's design by adding the ability to distinguish text strings from byte strings—a feature subsequently adopted by MessagePack itself in 2013. This evolution demonstrates the format's adaptability and its role in advancing binary serialization standards.