Architecture
Where watchers sit in the KERI ecosystem.
KERI ecosystem

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 |