Skip to content

Architecture

How identities are created, witnessed, observed and used for secure communication.

KERI ecosystem

KERI architecture

Select the diagram to open it at full size.

Overall architecture

From Interaction To
Identity and key management identity state Trust guard and policy
Authority and credentials (ACDC) authority facts Trust guard and policy
Trust guard and policy ALLOW / DENY Evidence store
Identity and key management publish KEL events Transport
Authority and credentials publish ACDC events Transport
Evidence store publish evidence references Transport
Transport KEL event Witness KEL verification (signature, sequence, hash)
Witness KEL verification verified event Append-only KEL store
Witness KEL verification event hash and sequence Receipt issuer
Receipt issuer signed receipt Receipt store
Witness receipt event Transport
Transport observed events Watcher event ingestion
Event ingestion normalized events Indexers (KEL, ACDC, receipts)
Indexers state updates Watcher state database
Indexers sequence streams Fork and conflict detector
Fork and conflict detector conflict alerts Watcher state database
Trust guard and policy query identity, credential and conflict state Query and evidence API
Identity and key management KEL history query Witness KEL store
Witness KEL store KEL and receipts Identity and key management

The transport layer, for example Nostr, is plain publish and subscribe. It is not trusted.

Embeddable library: identity and KEL system

Component Role
Role config Selects the role: org, block or instance
Genesis policy loader Loads the policy the identity is created with
Governance rules loader Loads thresholds, witnesses and related rules
Inception engine Creates the inception event
KEL manager Extends the key event log
KEL self-validator Validates the log of this identity
KEL store CRUD module and append-only store Persist events
Identity state database and identity API Provide AID, sequence and state

Embeddable library: key management

Component Role
Key vault Generates keys if no external wallet is connected, and signs
External wallet or storage Optional backend for key management
Hot keys cache Holds keys in current use
Pre-rotated keys saver Holds the keys committed for the next rotation
Recovery keys manager Holds recovery keys

Embeddable library: credentials and authority

Component Role
Input gateway and parser Parse input and put it on the task queue
Sender credential verifier Obtains the sender's credential reference
Credential verifier Verifies credentials
Delegation chain resolver Resolves the chain of delegations
Revocation cache API Checks for revoked credentials
Credential store cache API Retrieves cached credentials
Credential issuer Derives credentials from the current key state and identity
ACDC schemas and templates Define issued credentials

Embeddable library: decisions, audit and output

Component Role
Decision context builder Assembles the facts for a decision
Policy engine Evaluates rules of the genesis policy
Trust guard Allows or denies from the evaluated rules and the chain of facts
Evidence builder, hasher and hash signer Build, hash and sign evidence of the decision
Evidence store API Stores evidence
Output manager, signer and collector Attach the evidence reference, sign the output and return it

Witness

Component Role
Ingress queue Receives inception, rotation and interaction events
KEL event parser and normalizer Produce the canonical event
Signature verifier Checks signatures
Sequence and continuity verifier Requires a monotonic sequence
Prior-event hash verifier Checks the link to the previous event
KEL store and AID index Persist verified events and the pointer for each identifier
Receipt builder, signer and store Produce and keep receipts
KEL query handler and proof assembler Answer queries with entries and receipts
Internal event log Records ingestion
Health and integrity monitor Checks the stores

Watcher

Component Role
Input queue Receives observed KEL, ACDC, receipt and alert events
Event parser, normalizer and structural validator Produce the canonical form
Canonical hash computer Computes the content hash
Dedup cache checker Drops events seen within the TTL
KEL, credentials and receipt indexers Index each kind of event
Sequence tracker Follows the sequence of each identifier
Fork and duplicity checker Detects conflicting events
Conflict classifier Classifies conflicts and raises alerts
Database layer KEL, alerts and conflicts, credentials, and receipts databases

DID and DIDComm

DID and DIDComm architecture

Select the diagram to open it at full size.

Layer 1

PUBLIC DISCOVERY AND EVIDENCE.

Public Identity Advertisement

Component Role
Identity Publisher Publishes public identity metadata and service endpoints to relays.
Service Descriptor Declares DIDComm service endpoints and supported protocols.

Nostr Relay Network

Component Role
Relay Ingress Accepts signed public events and distributes them to subscribers.
Relay Storage Persists signed identity, reputation, and service discovery events.

Cryptographic Identity Foundation

Component Role
KERI Identity Controller Manages AIDs, key rotations, delegations, and the Key Event Log lifecycle.
Key Event Log Store Persists the ordered sequence of inception, rotation, and delegation events.
KERI-aware DID Resolver Derives a valid DID Document from the current KEL state.
Cryptographic Primitives Provide signing, verification, encryption, and key agreement operations.

Layer 2

DIDComm Core Engine

Component Role
Message Packer Constructs DIDComm envelopes using authenticated encryption and sender authentication.
Message Unpacker Decrypts, verifies, and authenticates incoming DIDComm messages.
Protocol Dispatcher Routes decrypted messages to the correct DIDComm sub-protocol handler.

DIDComm Sub-Protocols

Component Role
Issue Credential Protocol Securely issues ACDCs from issuer to holder.
Present Proof Protocol Verifies presented ACDCs and attached proofs.
Custom Business Protocols Implement domain-specific negotiations and workflows.

Transport Abstraction Layer

Component Role
Transport Router Sends and receives DIDComm envelopes over multiple transport mechanisms.
HTTP Transport Delivers messages via HTTPS service endpoints.
Nostr Transport Embeds encrypted DIDComm envelopes inside private relay events.

Layer 3

CREDENTIALS AND TRUST PAYLOADS.

Component Role
ACDC Store Persists received credentials, warrants, contracts, and proofs.
Credential Verifier Validates ACDCs against issuer KELs and trust policies.
Trust Policy Engine Evaluates credentials against local acceptance rules and constraints.

Mediation and Store-and-forward

Component Role
Mediator Service Stores encrypted messages for offline recipients and enforces access control.
Mediator Message Store Persists encrypted envelopes without visibility into contents.
Delivery Queue Manages retry, expiry, and ordered delivery semantics.

Agent Runtime

Component Role
Trust Guard Determines whether to accept, reject, or escalate interactions based on credentials and reputation.
Agent Core Orchestrates discovery, secure communication, credential handling, and decision making.
Task Executor Performs authorized work and generates response credentials or results.