Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 23 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.
Multiplexing in CESR is the process of combining multiple self-framing cryptographic primitives into a single composite stream using count codes and group framing codes, enabling efficient parallel processing through pipelining while maintaining the ability to demultiplex (separate) the primitives back into individual components without loss.
Multiplexing in the CESR (Composable Event Streaming Representation) protocol is a fundamental stream composition process that combines multiple self-framing primitives into a unified data stream. This process accomplishes several critical objectives:
What it accomplishes:
When it's used:
Key participants:
All implementations MUST enforce 24-bit boundary alignment before multiplexing. This requires:
ps = (3 - (N mod 3)) mod 3 to determine lead bytes neededCESR provides multiple count code tables optimized for different scenarios:
Implementations should select the most compact count code that accurately represents the group structure.
For high-performance implementations:
When implementing text-binary conversion:
B(T(stream)) = stream and T(B(stream)) = streamFor nested multiplexing:
The multiplexing process in CESR follows a precise sequence enabled by the protocol's composability properties:
Each primitive to be multiplexed must first be properly formatted:
For example, a public key primitive in text domain might be represented as:
DKxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx
Where D is the derivation code indicating an Ed25519 public key, and the remaining 43 characters encode the key value.
When multiple primitives are to be grouped, CESR uses count codes to specify the group structure:
For instance, a count code -AAB might indicate "the following group contains 2 primitives in text domain."
The actual multiplexing occurs through concatenation:
A multiplexed stream might look like:
-AABDKxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx0BDQzNTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0
Where:
-AAB = count code (2 primitives follow)DKxy... = first primitive (public key)0BDQ... = second primitive (signature)CESR's composability property enables domain transformation:
This transformation satisfies the formal composability requirement:
T(cat(b[k])) = cat(T(b[k])) for all k
B(cat(t[k])) = cat(B(t[k])) for all k
The multiplexing process involves several state transitions:
Initial state: Individual primitives exist as separate data structures ↓ Framing state: Each primitive is wrapped with its derivation code and aligned ↓ Grouping state: Count codes are applied to define group boundaries ↓ Concatenated state: Primitives are joined into a continuous stream ↓ Transmitted state: Stream is sent over network channel ↓ Demultiplexed state: Receiving parser separates primitives back into individual components
Key decision points in the multiplexing process:
Multiplexing in CESR must maintain cryptographic integrity:
The multiplexing process has specific timing characteristics:
Stream processing speed: CESR is designed to support high-bandwidth applications. As documented in [Document 3], modern datacenter cores operate at approximately 5 GHz, while network pipelines reach 40 GHz. This 8x speed differential necessitates the parallel processing capabilities that multiplexing enables.
Look-ahead capability: Unlike JSON which requires parsing the entire stream to determine boundaries, CESR's self-framing design allows parsers to determine chunk sizes immediately by reading count codes. This eliminates sequential parsing bottlenecks.
Pipelining latency: The multiplexing/demultiplexing cycle must be fast enough to support real-time witness receipt collection and key event validation in KERI networks.
Multiplexing implementations must handle several error conditions:
The fundamental technical constraint is 24-bit boundary alignment:
ps = (3 - (N mod 3)) mod 3 where N is raw binary lengthThis constraint ensures that no bits from adjacent primitives share the same character or byte after domain conversion, which is essential for maintaining the composability property.
When transmitting a Key Event Log, multiplexing combines:
Example structure:
[Count Code: 3 events]
[Inception Event]
[Event Data]
[Controller Signature]
[Witness Receipt 1]
[Witness Receipt 2]
[Rotation Event]
[Event Data]
[Controller Signature]
[Witness Receipts...]
[Interaction Event]
[Event Data]
[Anchored SAID]
ACDC credentials often form chains where one credential references another. Multiplexing enables efficient transmission:
[Count Code: Credential Chain]
[Root Credential SAID]
[Root Credential Signature]
[Delegated Credential SAID]
[Delegated Credential Signature]
[Presentation Proof]
This pattern is particularly important for vLEI credentials where QVI credentials delegate to Legal Entity credentials, which in turn delegate to role credentials.
When collecting receipts from multiple witnesses, multiplexing combines:
[Count Code: N witnesses]
[Witness 1 AID]
[Witness 1 Receipt Signature]
[Witness 2 AID]
[Witness 2 Receipt Signature]
...
[Witness N AID]
[Witness N Receipt Signature]
This enables efficient verification of KAACE (KERI Agreement Algorithm for Control Establishment) consensus.
CESR supports nested multiplexing for complex structures:
[Outer Count Code]
[Inner Group 1]
[Count Code]
[Primitive 1.1]
[Primitive 1.2]
[Inner Group 2]
[Count Code]
[Primitive 2.1]
[Primitive 2.2]
[Primitive 2.3]
[Standalone Primitive]
This hierarchical capability enables pipelining where different groups can be routed to different processor cores for parallel processing.
Use appropriate count codes: Select count codes that match the actual number and type of primitives to avoid parsing errors
Maintain deterministic ordering: KERI and ACDC require deterministic field ordering; maintain this in multiplexed streams
Leverage domain conversion: Use text domain for debugging and logging, binary domain for production transmission
Implement sniffability: Begin streams with group codes or field maps to enable automatic format detection by sniffers
Plan for demultiplexing: Structure multiplexed streams to facilitate efficient parallel processing during demultiplexing
Validate alignment: Verify 24-bit alignment before transmission to prevent composability violations
With KERI event streams: Multiplexing must preserve the cryptographic integrity of key events and their receipts. The KEL structure must remain verifiable after demultiplexing.
With ACDC credentials: When multiplexing ACDCs, preserve the SAID references that create the directed acyclic graph structure of chained credentials.
With IPEX exchanges: IPEX messages often contain multiplexed credentials and proofs. The multiplexing must support graduated disclosure patterns where different recipients receive different levels of detail.
With witness networks: Multiplexed witness receipts must support threshold satisfaction verification and duplicity detection.
The multiplexing capability is critical for KERI's scalability:
Parallel processing: By enabling demultiplexing across multiple cores, CESR multiplexing allows systems to process event streams at rates matching network bandwidth (40 GHz) rather than being limited by single-core processing speed (5 GHz).
Bandwidth efficiency: Binary domain multiplexing reduces transmission overhead compared to text-based formats like JSON, which require structural delimiters and cannot be efficiently demultiplexed.
Stream pipelining: The combination of multiplexing (combining) and demultiplexing (separating) enables true pipelining where data flows through multiple processing stages in parallel.
While CESR multiplexing shares the name with traditional telecommunications multiplexing (combining multiple signals over a shared medium), it extends the concept with cryptographic properties:
Traditional multiplexing: Combines analog or digital signals for transmission efficiency
CESR multiplexing: Combines cryptographic primitives while maintaining:
This makes CESR multiplexing uniquely suited for verifiable data structures in decentralized identity systems where both efficiency and cryptographic verifiability are essential.
Robust implementations must handle:
When integrating multiplexing with KERI: