In KERI, a key is a cryptographic primitive representing either a private key (secret signing material) or public key (verification material) from an asymmetric key pair, encoded in CESR format with derivation codes indicating the cryptographic algorithm used.
Related Concepts
No related concepts available
Comprehensive Explanation
key
Technical Definition
Within the KERI (Key Event Receipt Infrastructure) protocol and broader cryptographic identity systems, a key refers to cryptographic material that serves as the foundation for establishing and maintaining control authority over autonomic identifiers (AIDs). Keys exist in two complementary forms:
Private keys: Secret cryptographic material held exclusively by the controller, used to generate digital signatures that prove control authority
Public keys: Corresponding verification material that can be openly shared, used to verify signatures created by the associated private key
In KERI's architecture, keys are not merely cryptographic primitives but are qualified cryptographic primitives - meaning they are always encoded with metadata (derivation codes) that specify the cryptographic algorithm, key type, and derivation method. This qualification is essential for KERI's composability and interoperability properties.
Keys serve multiple critical functions in KERI:
Control Authority Establishment: Keys cryptographically bind controllers to their AIDs through self-certifying identifier derivation
KERI keys are based on asymmetric cryptography (public-key cryptography), where key pairs are generated through one-way mathematical functions:
Seed → Private Key → One-Way Function → Public Key
The security model relies on the computational infeasibility of deriving the private key from the public key, even though the public key is mathematically derived from the private key.
Supported Cryptographic Algorithms
KERI supports multiple cryptographic suites to enable cryptographic agility:
Ed25519 (Edwards-curve Digital Signature Algorithm):
Key size: 32 bytes (256 bits) for both private and public keys
Signature size: 64 bytes (512 bits)
Security level: ~128 bits of security
Properties: Fast signature generation and verification, deterministic signatures
CESR derivation codes: B (non-transferable prefix), D (public verification key)
ECDSA secp256k1 (Elliptic Curve Digital Signature Algorithm):
Purpose: Encryption and key agreement (not signing)
CESR derivation code: C (public encryption key), O (private decryption key)
Cryptographic Strength Requirements
The GLEIF vLEI Ecosystem Governance Framework establishes that all key pairs MUST provide approximately 128 bits of cryptographic strength. This requirement ensures:
Resistance to brute-force attacks with current computational capabilities
Sufficient security margin for long-lived identifiers
Compliance with industry-standard security recommendations
Key Generation Process
KERI key generation follows a deterministic, entropy-based process:
Entropy Collection: High-quality random entropy is collected (minimum 128 bits)
Seed Derivation: Entropy is processed into a cryptographic seed (called bran in KERI)
Key Stretching: The seed undergoes key stretching (e.g., Argon2) to derive private keys
Hierarchical Derivation: Multiple keys can be derived from a single seed using hierarchical deterministic algorithms
Public Key Derivation: Public keys are mathematically derived from private keys
Data Format & Encoding
CESR Encoding
All keys in KERI MUST be encoded using CESR (Composable Event Streaming Representation), which provides:
Self-describing format: Each key includes metadata about its type and algorithm
Domain flexibility: Keys can be represented in both text (Base64) and binary domains
Composability: Keys can be concatenated and parsed without external schema
Qualified Base64 Representation
KERI keys use qualified Base64 encoding where the key is prepended with a derivation code:
<derivation_code><base64_encoded_key>
Example Ed25519 public key:
DKxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx
Breakdown:
D: Derivation code indicating Ed25519 public verification key
Kxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx: Base64-encoded 32-byte public key
Derivation Codes
Derivation codes are compact indicators (1-4 characters) that specify:
Cryptographic algorithm: Which signature scheme (Ed25519, ECDSA, etc.)
Next keys are hidden through one-way hash functions
Even quantum computers cannot reverse hash functions efficiently
Rotation frequency can adapt to quantum computing advances
Key Exposure Minimization
Strategies to minimize key exposure:
Edge signing: Keep private keys on client devices, not cloud servers
Custodial rotation: Separate signing authority from rotation authority
Witness isolation: Witnesses use separate keys from controllers
Ephemeral keys: Use [non-transferable](/concept/non-transferable "A property indicating that control authority over a digital identifier or asset ...") identifiers for temporary purposes
Key State Management
Track current keys, next key digests, and thresholds in key state
Implement efficient key state queries from KEL
Cache key state for performance but validate against KEL
Support key state reconstruction from KEL replay
Witness Integration
Implement separate key management for witness identifiers
Support witness key rotation independent of controller keys
Validate witness signatures using witness public keys