Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 82 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 Key Event Receipt Log (KERL) is a verifiable append-only data structure that extends a Key Event Log (KEL) by incorporating all consistent key event receipt messages created by the associated set of witnesses, providing distributed consensus and duplicity detection capabilities for an Autonomic Identifier (AID).
A Key Event Receipt Log (KERL) represents a fundamental advancement over the basic Key Event Log (KEL) by incorporating witness attestations into the verifiable data structure. While a KEL contains only the signed key events produced by an identifier's controller, a KERL augments this with cryptographic receipts from designated witnesses, creating a distributed consensus mechanism without requiring blockchain infrastructure.
The KERL inherits all structural properties of the KEL:
What distinguishes a KERL is the addition of witness receipts (also called commitments) - cryptographically signed attestations from witnesses that they have observed and verified specific key events. This witness layer transforms the KEL from a controller-only data structure into a distributed verifiable data structure that enables ambient duplicity detection.
The KERL serves multiple critical functions in the KERI protocol:
Threshold Management: Implementations must carefully track receipt collection to ensure witness thresholds are met before considering an event fully witnessed. Partial receipt sets should be handled gracefully, with retry logic for missing receipts.
Timeout Handling: Witness response times vary due to network conditions. Implement configurable timeouts (typically 5-30 seconds) and retry mechanisms. Consider the event "pending" until threshold is met, not "failed" on first timeout.
Concurrent Collection: Collect receipts from multiple witnesses concurrently to minimize latency. Use asynchronous I/O or threading to parallelize witness communication.
Database Schema: Store events and receipts separately but with clear associations:
Caching Strategy: KERLs are immutable once witnessed, making them ideal for caching:
Streaming Protocols: For large KERLs, implement streaming retrieval:
Signature Verification: Cryptographic operations are expensive:
Incremental Verification: Don't re-verify entire KERL on each update:
Parallel Verification: Verify independent components concurrently:
Distributed Consensus: By collecting receipts from multiple independent witnesses, the KERL provides evidence that key events have been observed by third parties, making it significantly harder for a controller to present different versions of their event history to different validators (duplicitous behavior).
Availability Enhancement: Witnesses maintain copies of the KERL and can provide it to validators even when the controller is offline, enabling indirect mode operation where identifiers remain verifiable without continuous controller presence.
Duplicity Detection: The witness receipt mechanism enables validators to detect when a controller has created conflicting versions of their key event history by comparing receipts from multiple witnesses. This is fundamental to KERI's security model.
Trust Establishment: The KERL provides the evidentiary basis for validators to establish trust in an identifier's current key state by verifying that sufficient non-duplicitous witnesses have attested to the event sequence.
A KERL is organized as a chronological sequence of establishment events and their associated witness receipts:
Establishment Subsequence: The KERL maintains the complete sequence of establishment events (inception events and rotation events) that define the authoritative key state of the identifier. These events are the only ones that can change which keys control the identifier.
Receipt Attachments: For each establishment event, the KERL includes receipts from witnesses. Each receipt is a signed message from a witness's own AID attesting that the witness observed and verified the event. The receipt includes:
Threshold Requirements: The KERL must satisfy the witness threshold specified in the identifier's configuration. For example, if an identifier specifies a threshold of 2-of-3 witnesses, each establishment event in the KERL must have receipts from at least 2 of the 3 designated witnesses to be considered properly witnessed.
The KERL comprises several essential components:
Base KEL: The foundational sequence of key events produced by the controller, including:
Witness Receipts: Cryptographically signed attestations from witnesses, each containing:
Witness Configuration: Metadata specifying:
Consistency Proofs: The cryptographic chain linking events and receipts, enabling validators to verify:
A KERL does not have a single unified serialization format but rather consists of a KEL plus associated receipt messages. The KEL events follow the standard KERI event format:
Event Structure (using CESR encoding):
{
"v": "KERI10JSON00011c_", // Version string
"t": "icp" or "rot", // Event type (inception/rotation)
"d": "EXq5YqaL6L48...", // Event SAID
"i": "EXq5YqaL6L48...", // Identifier prefix
"s": "0", // Sequence number
"kt": "1", // Current signing threshold
"k": ["DaU6JR2nmwyZ..."], // Current signing keys
"nt": "1", // Next threshold
"n": ["EZ-i0d8JZAoT..."], // Next key digests (pre-rotation)
"bt": "2", // Witness threshold
"b": ["BGKVzj4ve0V..."], // Witness identifiers
"c": [], // Configuration traits
"a": [] // Anchored data seals
}
Receipt Structure:
{
"v": "KERI10JSON00011c_", // Version string
"t": "rct", // Receipt type
"d": "EXq5YqaL6L48...", // Event SAID being receipted
"i": "BGKVzj4ve0V..." // Witness identifier
}
The receipt is followed by attached signatures from the witness in CESR format.
KERLs use CESR (Composable Event Streaming Representation) for encoding, which provides:
Dual Text/Binary Support: CESR enables round-trip conversion between human-readable text (Base64) and compact binary representations without loss of information or primitive boundaries.
Self-Framing: Each primitive (event, signature, receipt) includes a derivation code that specifies its type and length, enabling parsers to extract elements from a stream without external schema information.
Composability: Multiple primitives can be concatenated and the stream remains parseable, enabling efficient pipelining and streaming protocols.
Qualified Primitives: All cryptographic material includes prepended codes indicating the algorithm used (e.g., E for Ed25519 public keys, 0B for Ed25519 signatures), making the KERL cryptographically agile.
Event Size: Individual key events typically range from 200-500 bytes in text format, depending on:
Receipt Size: Each witness receipt adds approximately 100-150 bytes, including:
KERL Growth: A KERL grows linearly with the number of establishment events and witnesses:
Practical Limits: While there are no hard protocol limits, practical considerations include:
Inception Process: KERL creation begins with the identifier's inception event:
Controller generates inception event specifying:
Controller signs inception event with initial keys
Controller promulgates event to witnesses via direct communication or through witness discovery mechanisms (OOBI)
Witnesses verify and receipt:
Controller collects receipts until threshold is met
KERL is established when sufficient receipts are collected
Witness Selection: Controllers choose witnesses based on:
Rotation Operations: The primary update operation is key rotation:
Controller generates rotation event:
Event promulgation to witnesses (same process as inception)
Receipt collection until threshold met
KERL extension with new event and receipts
Witness Rotation: Controllers can change their witness set through rotation events:
Append-Only Constraint: KERLs are strictly append-only:
KERL Verification Process: Validators verify a KERL through multiple steps:
1. Event Chain Verification:
2. Receipt Verification:
3. Consistency Verification:
4. Duplicity Detection:
Validation Outcomes: Verification produces one of several outcomes:
KERI Core Protocol: KERLs are the fundamental data structure for indirect mode operation in KERI:
DID:KERI Method: The did:keri DID method uses KERLs as the authoritative source for DID Document resolution:
ACDC Credentials: Authentic Chained Data Container credentials reference KERLs:
IPEX Protocol: Issuance and Presentation Exchange relies on KERLs:
Active Phase: During normal operation:
Delegation Phase: For hierarchical identifiers:
Recovery Phase: After key compromise:
Abandonment Phase: When identifier is no longer needed:
KEL (Key Event Log): The base structure that KERL extends:
TEL (Transaction Event Log): Credential-specific event logs:
DEL (Duplicitous Event Log): Records of inconsistent behavior:
Witness Pool: Infrastructure supporting KERL creation:
Storage: KERLs require persistent storage:
Network Communication: KERL distribution uses:
Cryptographic Operations: KERL processing requires:
Concurrency: KERL operations must handle:
Duplicity Evidence: KERLs make duplicity evident:
Byzantine Fault Tolerance: KERL witness thresholds provide:
Post-Quantum Security: KERLs support post-quantum cryptography:
Ambient Verifiability: KERLs enable verification by anyone:
Watcher Integration: Implement watcher queries to detect duplicity:
First-Seen Policy: Watchers must implement strict first-seen:
Gossip Protocols: Consider implementing gossip for duplicity alerts:
Witness Discovery: Implement OOBI-based witness discovery:
Witness Rotation: Handle witness set changes gracefully:
Witness Failure Handling: Implement robust failure handling:
Receipt Validation: Thoroughly validate receipts:
Replay Attack Prevention: Protect against receipt replay:
Denial of Service: Protect against DoS attacks:
CESR Compliance: Strictly follow CESR encoding rules:
Version Compatibility: Handle KERI version evolution:
Cross-Implementation Testing: Test against multiple KERI implementations: