Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 205 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 cryptographic primitive in KERI is the serialization of a value associated with a cryptographic operation (digest, salt, seed, private key, public key, or signature), which MUST be expressed in CESR format as a qualified, self-framing encoding that includes both type information (derivation code) and the cryptographic material itself.
Within the KERI (Key Event Receipt Infrastructure) and ACDC (Authentic Chained Data Container) ecosystems, a cryptographic primitive is formally defined as the serialization of a unitary value associated with a cryptographic operation. According to Document 62, these operations include but are not limited to:
The critical requirement established in Document 3 is that all primitives in KERI MUST be expressed in CESR (Composable Event Streaming Representation). This mandatory encoding ensures universal interoperability, self-describing data structures, and composability across text and binary domains.
As defined in , a cryptographic primitive is when it includes a prepended (also called a ) that indicates the cryptographic algorithm or suite used for that derivation. This qualification:
All cryptographic primitives in KERI implementations MUST be expressed in CESR format. This is not optional - it is a protocol requirement for interoperability. Implementations using naive Base64 encoding or other formats will not be compatible with KERI infrastructure.
Implementers must consult the CESR code tables to select appropriate derivation codes for their cryptographic primitives. The code tables are organized by:
Incorrect derivation codes will cause verification failures and interoperability issues.
Implementations must ensure all primitives align on 24-bit boundaries:
ps = (3 - (N mod 3)) mod 3ps zero bytes to raw binary before Base64 conversionFailure to maintain alignment breaks composability and round-trip conversion.
Cryptographic libraries typically work with unqualified (raw) cryptographic material. KERI requires qualified representations with derivation codes. Implementations must:
When processing CESR streams containing multiple primitives:
Self-framing eliminates the need for external framing protocols.
Implementations should prefer algorithms providing at least 128 bits of cryptographic strength:
Qualification is described as an essential property of CESR, making it foundational to KERI's encoding scheme.
CESR's derivation code system provides cryptographic agility by supporting multiple algorithm families through standardized prefixes. Document 4 details how CESR code tables organize primitives by:
According to Document 2, cryptographic primitives in KERI must exhibit cryptographic strength - greater resistance to attack compared to weaker alternatives. The ACDC specification (Document 68) mandates that cryptographic operations MUST provide approximately 128 bits of cryptographic strength or entropy (nominally).
Document 22 establishes that hash functions with 128 bits of cryptographic strength remain quantum-resistant:
These hash functions maintain their security properties even in a post-quantum computing environment because quantum computers provide no advantage for collision search operations.
CESR primitives are organized by raw binary size in code tables (Document 9):
Small Fixed Raw Size (common primitives):
Large Fixed Raw Size (extended primitives):
Variable Size (for arbitrary-length data):
CESR provides a dual text-binary encoding format (Document 5) that operates across three domains:
[A-Z, a-z, 0-9, -, _] encoding 6 bits per character(code, raw) where cryptographic operations occurThe composability property requires all primitives to align on 24-bit boundaries - the least common multiple of 6 bits (Base64 character) and 8 bits (byte). This constraint means:
As explained in Document 27, a derivation code is prepended to the Base-64 encoding of cryptographic material. For example:
F5pxRJP6THrUtlDdhh07hJEDKrJxkcR9m5u1xs33bhp=B: BF5pxRJP6THrUtlDdhh07hJEDKrJxkcR9m5u1xs33bhpThe derivation code replaces the pad character, embedding crucial cryptographic context directly into the identifier.
Unlike naive Base64 that uses trailing = pad characters, CESR uses leading pad bytes ("lead bytes") prepended to raw binary values before Base64 conversion (Document 9). The pad size calculation is:
ps = (3 - (N mod 3)) mod 3
Where ps is pad size and N is the raw binary length in bytes. This pre-padding ensures 24-bit alignment without requiring trailing pad characters in the text representation.
CESR primitives are self-framing (Document 29), meaning they include type, size, and value information in a single atomic encoding. This enables:
Cryptographic primitives are fundamental to KEL structure (Document 3):
Inception Events use primitives for:
k fieldn fieldRotation Events use primitives for:
p fieldk fieldn fieldInteraction Events use primitives for:
Document 68 describes how ACDCs use cryptographic primitives:
SAIDs (Self-Addressing Identifiers):
d field contains a CESR-encoded digest primitiveIssuer AIDs:
i field contains a CESR-encoded AID primitiveSignatures:
Witnesses provide signed receipts using cryptographic primitives (Document 71):
rct) reference the event digest-CAB prefixVerification of cryptographic primitives follows a standard pattern:
The cesride implementation (Document 23) defines six core primitive classes:
Diger (Document 172):
Verfer (Document 175):
Signer (Document 176):
Siger (Document 47):
Cigar (Document 48):
Salter (Document 174):
All cesride primitives share a common method interface (Document 118):
.qb64(): Qualified base-64 representation as a string.qb64b(): Qualified base-64 representation as bytes.qb2(): Qualified base-2 representation as bytes.code(): Derivation code indicating cryptographic type.raw(): Raw cryptographic material without qualificationCryptographic primitives compose in several ways:
Concatenation (Document 145):
Group Codes (Document 154):
Indexed Signatures (Document 149):
Post-quantum considerations favor hash-based commitments over signature schemes vulnerable to Shor's algorithm.
Implementations must handle:
CESR's design enables efficient stream processing:
Implementations should verify: