Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 9 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.
Text-binary concatenation composability is the property of an encoding scheme where any set of self-framing concatenated primitives can be converted as a group between text and binary domains and back again without loss, while maintaining the separability of individual primitives.
Text-binary concatenation composability is a fundamental property of encoding schemes that enables lossless bidirectional transformation between textual and binary representations of concatenated data structures. An encoding has composability when the transformation of a set of concatenated primitives as a whole equals the concatenation of individually transformed primitives.
Formally, given transformations T(B) (binary to text) and B(T) (text to binary):
T(cat(b[k])) = cat(T(b[k])) and B(cat(t[k])) = cat(B(t[k])) for all k
This property ensures that:
The concept addresses a critical limitation in traditional binary-to-text encodings like Base64, which provide only value information without type or size metadata, and lack composability when primitives are concatenated. Without composability, repeated transformations between domains result in data corruption or loss of primitive boundaries.
The vLEI glossary documentation uses an effective analogy to illustrate composability through its absence. When translating text repeatedly between English and Dutch using Google Translate:
Implementations must ensure that every primitive maintains 24-bit alignment:
The alignment requirement means that some primitives will have lead bytes that don't carry semantic information but are necessary for maintaining composability.
Framing codes must encode:
Parsers use the framing code to determine exactly how many characters/bytes to extract without needing to parse the value portion.
Implementations need six transformation functions:
T(B): Binary to text conversionB(T): Text to binary conversionT(R): Raw to text conversion (includes code prepending)R(T): Text to raw conversion (strips code)B(R): Raw to binary conversion (includes code prepending)R(B): Binary to raw conversion (strips code)These functions must maintain the composability property: T(B(T(x))) = T(x) and B(T(B(x))) = B(x).
Composability enables efficient stream processing:
This single-pass processing is possible because composability guarantees that primitive boundaries are preserved across domain transformations.
The message degrades and changes with each iteration until it stabilizes at some altered form. This demonstrates that Google Translate is not composable - repeated transformations result in data loss.
By contrast, in a composable system like CESR:
Traditional binary-to-text encoding schemes like Base64 were designed primarily for transport compatibility - enabling binary data to traverse text-only protocols like email (MIME) or HTTP headers. These schemes focused on:
However, traditional schemes had critical limitations:
= padding characters create parsing challenges in concatenated streamsThese limitations made traditional encodings unsuitable for streaming protocols where:
CESR (Composable Event Streaming Representation) was specifically designed to achieve text-binary concatenation composability through several innovations:
The foundation of CESR's composability is 24-bit boundary alignment. Every primitive in both domains must be an integer multiple of 24 bits:
Twenty-four bits is the least common multiple of 6 (Base64 character bit width) and 8 (byte bit width). This alignment ensures that:
Every CESR primitive is self-framing - it contains all information needed to parse it without external delimiters. This is achieved through prepended framing codes that encode:
Self-framing enables stream processing where parsers can:
CESR operates across three domains:
A-Z, a-z, 0-9, -, _) for human readability and text-protocol compatibility(text_code, raw_binary) where actual cryptographic operations occurSix transformations connect these domains: T(B), B(T), T(R), R(T), B(R), R(B). The composability property ensures that:
T(B(T(primitive))) = T(primitive)
B(T(B(primitive))) = B(primitive)
For concatenated primitives:
T(cat(B(t[1]), B(t[2]), ..., B(t[n]))) = cat(t[1], t[2], ..., t[n])
CESR uses multiple code tables optimized for different primitive sizes and types:
Each table is designed to maintain 24-bit alignment through careful selection of code lengths and padding strategies. The code table selector mechanism allows CESR to support multiple tables while maintaining composability.
CESR uses pre-padding (lead bytes) rather than post-padding to achieve alignment:
= characters as post-paddingThis approach eliminates the ambiguity of padding characters in concatenated streams and ensures that every primitive is self-contained and self-framing.
Composability enables cold start stream parsing - after a reboot or when beginning to process a stream, parsers can immediately identify primitive boundaries without requiring external framing information. This is critical for:
Applications can choose the most appropriate domain for their needs:
The composability property ensures that this choice doesn't lock the application into a single domain - data can be freely converted as requirements change.
For KERI key events and ACDCs, composability is essential because:
Composability guarantees that converting a signed KEL between text and binary domains doesn't invalidate signatures or break cryptographic commitments.
Different KERI implementations may prefer different encodings:
Composability ensures that these implementations can interoperate seamlessly - a witness can receive events in binary, process them, and return receipts in text without any loss of integrity.
CESR's composability enables hierarchical composition through count codes and group codes:
This allows complex data structures like key event messages with multiple signatures and attachments to be processed as atomic units while maintaining composability at every level of the hierarchy.
The 24-bit alignment requirement means that:
However, these trade-offs are justified by the benefits:
Text-binary concatenation composability is not merely a convenience feature but a fundamental architectural property that enables KERI's verifiable data structures to function reliably across diverse computing environments. By ensuring that concatenated primitives can be freely converted between text and binary domains without loss, CESR provides the encoding foundation for a truly interoperable, verifiable internet infrastructure.
Implementations should verify composability through: