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.
Direct mode is a KERI operational mode where an identifier controller establishes control authority through verified signatures of the controlling [key-pair](/concept/key-pair "A key-pair is a mathematically related pair of cryptographic keys consisting of ...") via direct, intermittent network communication with validators, without relying on witnesses or Key Event Receipt Logs (KERLs).
Direct mode represents one of two fundamental trust modalities in the KERI protocol, designed specifically for scenarios where identity controllers can establish cryptographic control authority through direct peer-to-peer communication with validators. Unlike indirect mode, which relies on witness infrastructure and KERLs as a secondary root-of-trust, direct mode operates on the principle that intermittent but direct network contact between controller and validator is sufficient for secure identifier verification.
The core properties of direct mode include:
The scope of direct mode is deliberately constrained to one-to-one relationships or select group interactions where a single direct mode identifier may be reused across multiple bilateral relationships. This design choice reflects KERI's recognition that different trust scenarios require different operational architectures, with direct mode optimized for simplicity and mobile-first use cases.
Direct mode implementations must handle TCP or HTTP connections between controllers and validators. The KERIpy reference implementation demonstrates this through:
Direct mode implementations require:
Signature Verification: All events must be cryptographically verified:
Duplicity Detection: While ambient detection is limited, implementations should:
Offline-First Architecture:
The concept of direct peer-to-peer identity verification has roots in early cryptographic protocols like PGP (Pretty Good Privacy), where users exchanged public keys directly and built trust through personal verification. However, traditional approaches suffered from key management challenges, particularly around secure key rotation and recovery from compromise.
Early decentralized identity systems attempted to solve these problems through various mechanisms:
The innovation in KERI's direct mode lies in combining cryptographic self-certification with event-sourced key management (KEL replay) to enable secure direct verification without requiring either persistent infrastructure or manual trust management. The pre-rotation mechanism, in particular, addresses the historical challenge of secure key rotation in peer-to-peer systems by enabling forward-secure key commitments that can be verified even during intermittent connectivity.
KERI's direct mode implementation leverages several protocol innovations to provide security guarantees without witness infrastructure:
Direct mode establishes control authority through verified signatures of the controlling key-pair, creating what KERI terms an autonomic trust basis. The controller's AID (Autonomic Identifier) is self-certifying, meaning the identifier itself is cryptographically derived from the initial key material. This eliminates the need for external authorities to bind identifiers to keys.
Validator operations in direct mode—including verification, control authority establishment, and duplicity detection—all depend on the ability to replay the sequence of key events (the key event history) for an identifier. The KEL provides:
This event-sourced architecture means that even with intermittent connectivity, validators can reconstruct and verify the complete control authority history when the controller is available.
Direct mode is explicitly designed for mobile internet devices such as smartphones, where:
The protocol accommodates these constraints by requiring event promulgation only when the controller is actively attached to the network and able to communicate directly with the validator. This design assumption makes direct mode particularly compatible with mobile-first identity applications.
Direct mode provides distinct security characteristics compared to indirect mode:
Attack Surface Differences: The KERI specification explicitly notes that direct and indirect modes have different attack surfaces for availability and consistency threats. Direct mode's security model assumes:
Duplicity Detection: While direct mode lacks the ambient duplicity detection provided by witness networks, it can be enhanced through watcher networks that establish verification thresholds. Future implementations may allow validators to compare received KELs against multiple watcher views before acceptance, significantly increasing security guarantees.
The choice between direct and indirect mode represents a fundamental architectural decision:
| Aspect | Direct Mode | Indirect Mode |
|---|---|---|
| Connectivity | Intermittent, synchronous | High availability, asynchronous |
| Infrastructure | No witnesses required | Requires witness pools |
| Use Cases | One-to-one, mobile devices | One-to-many, public services |
| Trust Model | Direct cryptographic verification | Witness-mediated verification |
| Availability | Controller must be online | Events available via witnesses |
| Complexity | Simpler, fewer components | More complex, distributed consensus |
Direct mode is particularly suited for:
Peer-to-Peer Interactions: Two parties establishing a direct relationship without requiring persistent infrastructure. Examples include:
Mobile Identity Applications: Smartphone-based identity wallets where:
Select Group Relationships: A single direct mode identifier reused across multiple one-to-one relationships within a trusted circle, such as:
Development and Testing: Direct mode's simplicity makes it ideal for:
Simplicity: Direct mode eliminates the complexity of witness selection, configuration, and management. This reduces:
Quick Bootstrapping: Controllers can begin using identifiers immediately without:
Privacy: Direct mode provides inherent privacy benefits:
Mobile Compatibility: The intermittent connectivity model aligns perfectly with mobile device usage patterns, enabling:
Availability Limitations: Direct mode requires both parties to be online simultaneously, which:
Scalability Constraints: Direct mode is optimized for one-to-one relationships rather than one-to-many scenarios:
Reduced Duplicity Detection: Without witness infrastructure:
Infrastructure Dependency: While direct mode eliminates witness dependency, it still requires:
When implementing direct mode applications, developers should consider:
Connection Management: Applications must handle:
Security Enhancements: While direct mode provides strong cryptographic guarantees, additional security can be achieved through:
User Experience: Direct mode's synchronous nature requires careful UX design:
Hybrid Architectures: Many real-world applications may benefit from combining direct and indirect modes:
Battery Optimization:
The KERIpy demo scripts (keri_bob, keri_eve) provide reference implementations for testing: