Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 50 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.
Escrow in KERI is a temporary storage mechanism for events that arrive out-of-order or lack prerequisite information, holding them until dependencies are satisfied before processing. The escrow state tracks all pending events and their required conditions across the fully asynchronous KERI protocol.
Escrow in KERI protocol design is a fundamental mechanism for handling asynchronous event processing in distributed systems. When events arrive that cannot be immediately validated or processed due to missing dependencies, the protocol temporarily stores (escrows) these events until the required prerequisite information becomes available.
The escrow mechanism accomplishes several critical functions:
Key participants in the escrow process include:
The escrow mechanism follows a well-defined sequence of operations:
KERIpy's escrow implementation underwent a major migration from Sled to Redb database backend (versions 0.15.0-0.17.3). The Redb implementation provides:
Implementations should maintain separate escrow queues for different event types:
Escrow Query Optimization: Use indexed lookups rather than full escrow scans when checking for dependency satisfaction.
Batch Processing: When multiple dependencies are satisfied simultaneously, batch-process escrowed events to reduce overhead.
Memory vs Disk: For high-throughput systems, consider in-memory escrow with periodic persistence for performance.
Escrow Flooding Protection: Implement per-identifier and global limits on escrow queue depth to prevent denial-of-service attacks.
Malicious Event Detection: Events that repeatedly fail validation should be removed from escrow quickly and potentially blacklisted.
Resource Monitoring: Track escrow queue depths, timeout rates, and processing latencies to detect anomalies.
For cloud agent deployments (KERIA):
When an event cannot be immediately processed:
As new information arrives in the system:
The system manages escrow lifecycle:
Escrow operations must maintain cryptographic integrity:
The escrow mechanism operates within specific timing constraints:
Escrow Timeout Configuration: The escrow_config parameter (measured in seconds) determines how long events remain in escrow before automatic removal. This prevents indefinite storage of invalid or malicious events. Typical values range from seconds (for high-performance systems) to hours (for loosely-coordinated systems).
First-Seen Policy Interaction: The escrow mechanism operates independently of the first-seen rule. Events in escrow (including invalid or "garbage" events) do not affect first-seen determination. When a valid event arrives that matches the next expected sequence number, it is immediately accepted as first-seen regardless of what may be waiting in escrow.
Propagation Speed: When escrowed events are released and processed, watchers propagate the agreed-upon events within microseconds across the validator network, ensuring rapid convergence.
Robust error handling is essential for escrow operations:
Invalid Event Detection: Events that fail cryptographic validation or structural checks may be placed in escrow temporarily but should be removed quickly to prevent resource exhaustion.
Circular Dependencies: The system must detect and handle circular dependency scenarios where Event A waits for Event B, which waits for Event A.
Resource Limits: Escrow storage must implement limits to prevent denial-of-service attacks through escrow flooding.
Recovery Mechanisms: If escrow state becomes corrupted, the system must have recovery procedures to rebuild escrow from authoritative KEL sources.
The most common escrow scenario occurs when KEL events arrive out of sequence:
Scenario: A validator receives Event N+2 before Event N+1 has arrived.
Escrow Action: Event N+2 is placed in out-of-order escrow, indexed by its sequence number.
Resolution: When Event N+1 arrives and is processed, the system queries escrow for Event N+2, validates it, and processes it in correct sequence order.
Transaction Event Logs (TELs) must be anchored to KEL events:
Scenario: A TEL event for a credential arrives before the corresponding KEL interaction event that anchors it.
Escrow Action: The TEL event is placed in escrow awaiting the anchoring KEL event.
Resolution: When the KEL event arrives with the appropriate seal, the TEL event is retrieved from escrow and processed.
Multisignature events require threshold-satisfying signatures:
Scenario: A multisig rotation event arrives with 2 of 3 required signatures.
Escrow Action: The partially-signed event enters escrow awaiting additional signatures.
Resolution: As additional signatures arrive, they are attached to the escrowed event. Once the threshold is satisfied, the event exits escrow and is processed.
Delegated identifiers require approval from delegating identifiers:
Scenario: A delegated inception event arrives before the delegator has created the corresponding delegation seal.
Escrow Action: The delegated event is placed in delegation escrow.
Resolution: When the delegator's KEL includes the delegation seal, the delegated event is validated and processed.
Escrow Timeout Tuning: Configure escrow timeouts based on expected network latency and coordination requirements. High-performance systems may use seconds; loosely-coordinated systems may use hours or days.
Monitoring Escrow State: Implement monitoring to track escrow queue depths and identify potential issues (network partitions, malicious flooding, configuration errors).
Escrow Type Separation: Maintain separate escrow queues for different event types (out-of-order, partially-signed, delegation pending) to optimize query performance and timeout management.
Resource Limits: Implement per-identifier and global escrow limits to prevent resource exhaustion attacks.
Logging and Forensics: Log escrow operations (entry, exit, timeout) for debugging and security analysis.
Database Implementation: Escrow requires persistent storage with efficient indexing. The KERIpy implementation migrated from Sled to Redb for improved performance and reliability.
Witness Integration: Witnesses must escrow partially-signed multisig events and query escrow when new signatures arrive.
Watcher Integration: Watchers operating in promiscuous mode must escrow events from multiple identifiers and manage escrow state across their monitored KELs.
Agent Integration: Cloud agents (KERIA) must manage escrow state across multiple client AIDs in multi-tenant deployments.
IPEX Protocol: The Issuance and Presentation Exchange protocol relies on escrow for managing asynchronous credential issuance workflows where multiple parties must coordinate signatures over extended timeframes.
The escrow state represents a comprehensive snapshot of all temporary storage locations and pending operations across the KERI system. This state includes:
Effective escrow state management is essential for KERI implementations to handle the complexity of asynchronous, distributed event processing while maintaining protocol correctness and system performance. The escrow mechanism transforms KERI's fully asynchronous architecture from a theoretical challenge into a practical, implementable system that can handle real-world network conditions and coordination requirements.
The IPEX protocol for credential issuance relies heavily on escrow for managing asynchronous workflows: