Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 26 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 diger is a fundamental cryptographic primitive in the CESR (Composable Event Streaming Representation) encoding scheme that represents a cryptographic digest (hash). The diger primitive encapsulates both the hash value itself and metadata about the hashing algorithm used, enabling self-describing, verifiable cryptographic commitments.
The diger is defined in the cesride terminology framework as "a primitive that represents a digest" with "the ability to verify that an input hashes to its raw value." This verification capability is central to the diger's role in KERI's security architecture, allowing any party to cryptographically confirm that a given input produces the digest value stored in the diger.
Digers are one of six core cryptographic primitives in cesride, alongside Verfer (public keys), Signer (private keys), Siger (indexed signatures), Cigar (unindexed signatures), and Salter (seeds). Together, these primitives form the building blocks for all cryptographic operations in KERI-based systems.
Digers support multiple cryptographic hash algorithms through CESR's system. The derivation code prepended to the digest value indicates which algorithm was used, enabling cryptographic agility. Common hash algorithms supported include:
All diger implementations must provide the cesride standard method interface:
.qb64(): Returns qualified Base64 text representation as string.qb64b(): Returns qualified Base64 representation as bytes.qb2(): Returns qualified binary representation as bytes.code(): Returns derivation code indicating hash algorithm.raw(): Returns unqualified raw digest bytesThis uniform interface ensures consistent handling across implementations and programming languages.
Implementations should support multiple hash algorithms through CESR derivation codes:
Derivation code mappings must match CESR specifications exactly.
Digest verification requires:
Verification failures should be treated as security-critical events.
The choice of hash algorithm affects both security properties and performance characteristics. Blake3, for example, offers superior performance while maintaining strong security guarantees, making it a preferred choice in many KERI implementations.
Digers inherit the security properties of their underlying hash algorithms:
These properties enable digests to serve as cryptographic commitments - once a diger is created from some data, the data cannot be changed without detection, and the digest uniquely identifies that specific data.
Most hash algorithms used in KERI produce 256-bit (32-byte) digests, providing approximately 128 bits of collision resistance security. This security level is considered sufficient for long-term cryptographic applications and aligns with post-quantum security recommendations.
Digers follow CESR's qualified primitive encoding pattern, consisting of:
The derivation code enables self-describing primitives - a parser can determine the hash algorithm and digest length by examining only the first few characters/bytes.
In CESR's text domain, digers are encoded as Base64 URL-safe strings with prepended derivation codes. For example, a Blake3-256 digest might appear as:
EABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv
Where:
E is the derivation code indicating Blake3-256The text representation is human-readable, can be safely transmitted in JSON/text protocols, and maintains CESR's composability property when concatenated with other primitives.
In CESR's binary domain, digers use compact binary derivation codes followed by raw digest bytes. The binary encoding is more efficient for storage and transmission while maintaining the same semantic content as the text representation.
CESR's composability guarantee ensures that digests can be converted between text and binary domains without loss of information or boundary ambiguity when concatenated with other primitives.
All diger implementations provide a standard method interface inherited from the cesride primitive specification:
.qb64(): Returns the qualified Base64 text representation as a string.qb64b(): Returns the qualified Base64 representation as bytes.qb2(): Returns the qualified binary representation.code(): Returns the derivation code indicating the hash algorithm.raw(): Returns the unqualified raw digest bytesThis uniform interface enables consistent handling of digests across different KERI implementations and programming languages.
The primary use of digers in KERI is for creating Self-Addressing Identifiers (SAIDs). A SAID is a special type of identifier where the identifier itself is the digest of the data it identifies. This creates a cryptographically verifiable binding between identifier and content.
SAIDs are used extensively throughout KERI:
The SAID mechanism enables content-addressable data structures where the identifier proves the integrity of the identified content.
In KELs, digests serve multiple commitment functions:
These digest-based commitments create the cryptographic backbone of KERI's security model, enabling detection of unauthorized modifications and ensuring event ordering.
In ACDCs, digests enable compact disclosure mechanisms:
This digest-based disclosure pattern allows graduated revelation of credential information while maintaining cryptographic verifiability at each stage.
Verifying a diger involves:
This verification process is deterministic and requires no trusted third parties - anyone with the input data and the diger can independently verify the commitment.
While digests and public keys serve different cryptographic functions, both are CESR primitives with similar encoding patterns. Verfers represent public keys and enable signature verification, whereas digests enable content commitment. In KERI, verfers are often digested to create compact key commitments in pre-rotation mechanisms.
Signers represent private keys and create signatures. The relationship between digests and signatures is complementary - digests commit to data content, while signatures prove authorship. In practice, signatures are often computed over digests rather than raw data for efficiency.
Salters represent cryptographic seeds used to derive key material. Seeds are often protected by storing only their digests in certain contexts, creating a commitment to the seed without exposing it. The salter-diger relationship enables deterministic key derivation with privacy preservation.
Digers frequently appear in composed structures:
CESR's composability property ensures these structures can be efficiently encoded and parsed in both text and binary domains.
Implementers must choose appropriate hash algorithms based on:
For frequently-accessed data, implementations should cache computed digests rather than recomputing them. This is particularly important for:
Caching strategies must ensure cache invalidation when underlying data changes.
For large data objects, implementations should use streaming hash APIs that process data incrementally rather than loading entire objects into memory. This is critical for:
Digest verification failures indicate either:
Implementations must treat verification failures as security-critical events and handle them appropriately (typically by rejecting the data and logging the failure).
Implementations must maintain accurate mappings between derivation codes and hash algorithms. The CESR specification defines standard codes, but implementations should validate codes before processing and reject unknown codes to prevent security vulnerabilities.
While modern hash algorithms are collision-resistant, implementations should:
Some hash algorithms (notably SHA-256) are vulnerable to length extension attacks. KERI's use of digests in fixed-structure events mitigates this risk, but implementations should be aware of the issue when using digests in novel contexts.
Digest comparison operations should use constant-time comparison functions to prevent timing side-channels that could leak information about digest values.
Modern CPUs provide hardware acceleration for common hash algorithms (e.g., SHA-256 via SHA extensions). Implementations should leverage these features when available for optimal performance.
Blake3 supports parallel hashing through its tree-based construction. Implementations processing large data sets should exploit this parallelism for maximum throughput.
When verifying multiple digests, implementations can optimize by:
These optimizations are particularly valuable in witness and watcher implementations processing high-volume event streams.
Implementations must correctly handle digests in all these contexts to maintain KERI security properties.