Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 175 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.
A message in the KERI protocol represents the fundamental unit of communication and state change within the key event infrastructure. As defined in the IETF KERI specification, a message is formally composed of two primary components:
This dual-component architecture enables KERI's security model by separating the content being attested from the attestations themselves. The body contains the semantic payload—whether that's a key event, a query, a reply, or other protocol-defined content—while attachments provide the cryptographic proofs necessary for verification.
Messages serve as the carrier mechanism for all KERI operations, including:
The message structure is designed to support CESR encoding, enabling efficient streaming and composability across text and binary domains.
Implementations must handle CESR framing codes to separate message bodies from attachments. The parser should:
When verifying message signatures:
Implementations should maintain escrow databases for:
Escrow entries should be periodically re-evaluated as new messages arrive.
KERI messages support multiple serialization formats, all of which must maintain the fundamental body-plus-attachments structure:
JSON Serialization: The most common format for human-readable messages, using KERI10JSON version strings. JSON messages consist of a JSON object (the body) followed by CESR-encoded attachments.
CBOR Serialization: Concise Binary Object Representation provides compact binary encoding while maintaining the same logical structure.
MessagePack (MGPK): Another binary serialization option offering efficient encoding for streaming applications.
The message body is a serialized data structure that varies by message type but typically includes:
Version String (v): A regexable format string indicating protocol version, serialization type, and message size (e.g., KERI10JSON0000e6_)
Message Type (t): Identifies the category of message:
icp - Inception eventrot - Rotation eventixn - Interaction eventrct - Receiptqry - Queryrpy - Replyexn - Exchange messagevrc - Validator receiptIdentifier (i): The AID that is the subject of the message
Sequence Number (s): For key events, indicates position in the KEL
Event-Specific Fields: Additional fields determined by message type (keys, thresholds, digests, anchors, etc.)
Attachments are encoded using CESR primitives and groups, providing self-framing cryptographic material:
Signature Attachments: The most common attachment type, containing:
Receipt Attachments: For witness receipts, containing:
Seal Attachments: Cryptographic commitments to external data
OOBI Attachments: Out-of-Band Introduction information for discovery
Attachments are separated from the body by CESR framing codes (e.g., -AAB for a signature attachment), enabling parsers to distinguish between body content and cryptographic material.
Message size is constrained by:
Typical message sizes range from hundreds of bytes (simple events) to several kilobytes (complex multi-sig events with multiple attachments).
Creating a KERI message involves several steps:
For key event messages, the body must include the event digest (d field), which is a SAID computed over the entire event content. This creates a self-referential structure where the identifier is derived from the content it identifies.
Messages are transmitted through various transport mechanisms:
Direct Mode: Point-to-point transmission between controllers over HTTP or TCP
Indirect Mode: Transmission via witnesses and watchers, using mailbox services for asynchronous delivery
Streaming: Messages can be concatenated into CESR streams for efficient batch processing
The CESR encoding ensures messages are self-framing, allowing parsers to extract individual messages from streams without external framing protocols.
Verifying a KERI message requires:
For key event receipts, verification additionally requires:
Processing messages involves:
Escrow Management: Messages that cannot be immediately processed (due to missing dependencies) are placed in escrow:
State Updates: Successfully verified messages update the local state:
Duplicity Detection: Messages are checked against existing state to detect duplicity—the existence of conflicting versions of the same event.
Messages are the fundamental communication primitive in KERI, used for:
Key Event Logs: The KEL is constructed from a sequence of key event messages, each cryptographically chained to its predecessor through digest references.
Witness Infrastructure: Witnesses receive key event messages, verify them, and return receipt messages attesting to their observation of the events.
Watcher Networks: Watchers collect messages from multiple sources to detect duplicity and provide ambient verifiability.
Controller Interactions: Controllers exchange messages to:
Messages carry ACDC credentials and related operations:
Credential Issuance: IPEX grant messages contain ACDC credentials being issued from issuer to holder.
Credential Presentation: IPEX apply and offer messages enable credential presentation from holder to verifier.
Registry Operations: TEL events are anchored in KEL messages through seals, linking credential state to key state.
The Trust Spanning Protocol uses KERI messages for:
VID Resolution: Messages carry DID documents and key state information for verifiable identifiers.
Encrypted Communication: TSP messages wrap KERI messages with additional encryption layers while preserving the underlying message structure.
Messages have a defined lifecycle:
Messages interact with several related data structures:
Key Event Log (KEL): An ordered sequence of key event messages forming the authoritative history of an AID.
Key Event Receipt Log (KERL): A KEL augmented with receipt messages from witnesses.
Transaction Event Log (TEL): A log of transaction events (like credential issuance/revocation) anchored to a KEL through seals in key event messages.
CESR Streams: Concatenated sequences of messages encoded in CESR format for efficient streaming and processing.
OOBI: Out-of-Band Introductions that bootstrap message exchange by providing initial discovery information.
The message structure's flexibility and composability make it the universal carrier for all KERI protocol operations, enabling the protocol's security properties while maintaining efficiency and interoperability across diverse deployment scenarios.