A judge is an entity or component in KERI that examines Key Event Receipt Logs (KERLs) and Duplicitous Event Logs (DELs) to determine the current authoritative key set for an identifier by validating that the event history originates from a non-duplicitous controller and has been witnessed by sufficient non-duplicitous witnesses, thereby enabling validators to make trust decisions.
Related Concepts
No related concepts available
Comprehensive Explanation
judge
Process Definition
A judge in the KERI ecosystem performs forensic analysis and validation of key event data structures to establish trustworthiness of identifier control. The judge examines entries from one or more Key Event Receipt Logs (KERLs) and Duplicitous Event Logs (DELs) for a given Autonomic Identifier (AID) to make authoritative determinations about key state validity.
Core Objectives
The judge accomplishes three primary objectives:
Validate Event History Integrity: Verify that the event sequence originates from a non-duplicitouscontroller by examining the cryptographic chain of key events
Assess Witness Attestations: Confirm that sufficient non-duplicitous witnesses have signed and receipted the events according to the identifier's threshold requirements
Determine Trustworthiness: Provide a trust determination to validators about whether the identifier's key state can be relied upon for making authorization or verification decisions
When Judges Are Used
Implementation Notes
Critical Implementation Considerations
Judge Independence
Judges MUST be operationally independent from witnesses and watchers to avoid conflicts of interest. A judge operated by the same entity as a witness it validates creates potential for collusion or bias. Best practice is to deploy judges as separate services with distinct operational control.
Cryptographic Agility
Judges must support all CESR derivation codes used in the KERI ecosystem. As new cryptographic algorithms are added (particularly post-quantum algorithms), judges must be updated to verify signatures and digests using these new primitives. Failure to support a derivation code renders the judge unable to validate identifiers using that algorithm.
Performance vs Security Trade-offs
Judges face inherent trade-offs between validation thoroughness and response time:
Fast validation: Query minimum threshold of witnesses, cache aggressively, skip watcher consultation
Thorough validation: Query all available witnesses, consult multiple watchers, perform extended temporal analysis
Implementations should allow validators to specify required confidence levels, enabling risk-appropriate validation depth.
Witness Availability Handling
Judges must gracefully handle witness unavailability:
Retry logic: Implement exponential backoff for transient failures
Timeout configuration: Set appropriate timeouts based on network conditions
Partial validation: Make determinations based on available witnesses if threshold is met
Degraded mode: Provide lower-confidence determinations when full witness set is unavailable
Duplicity Evidence Preservation
When duplicity is detected, judges MUST preserve all conflicting versions for forensic analysis. This evidence is critical for:
Understanding attack patterns
Supporting recovery operations
Legal proceedings if necessary
Improving detection algorithms
Implement secure, tamper-evident storage for duplicity evidence.
Watcher Integration
Effective judge implementations integrate closely with watcher networks:
Subscribe to duplicity alerts: Receive real-time notifications of detected duplicity
Query historical data: Access watcher archives for temporal analysis
Judges operate in KERI's indirect mode infrastructure, particularly in advanced deployment scenarios where:
The judge begins by collecting Key Event Receipt Logs (KERLs) from the designated witness set for the identifier under examination. Each KERL contains:
For each collected KERL, the judge performs internal consistency verification:
Cryptographic Chain Validation: Verify that each event's digest correctly chains to the previous event through the p (prior event digest) field
Signature Verification: Validate that each event is signed by the appropriate keys according to the key state at that sequence number
Pre-rotation Commitment Verification: Confirm that rotation events use keys whose digests were committed in the previous establishment event's n (next key digest) field
Threshold Compliance: Verify that the number of signatures meets the signing threshold specified in the current key state
Configuration Consistency: Ensure that configuration traits remain consistent or change only through valid establishment events
An internally inconsistent KERL fails validation immediately and cannot be used for trust decisions. Internal inconsistency indicates either:
Corruption during transmission or storage
Malicious tampering that broke cryptographic bindings
After confirming internal consistency of individual KERLs, the judge performs external consistency analysis by comparing KERLs from different witnesses:
Event Sequence Comparison: Compare the sequence of events across all collected KERLs
First-Seen Analysis: Determine which events were "first seen" by each witness
Conflict Identification: Identify any sequence numbers where different witnesses have different events
Duplicity Classification: Classify conflicts as either:
Live attacks: Involving current signing keys
Dead attacks: Involving stale keys from superseded key states
The presence of externally inconsistent but internally valid KERLs indicates duplicity - the controller has created multiple conflicting versions of their event history.
Step 4: Witness Attestation Assessment
The judge evaluates the quality and sufficiency of witness attestations:
Witness Identity Verification: Confirm that receipts come from the designated witnesses for this identifier
Receipt Signature Validation: Verify cryptographic signatures on witness receipts
Witness Consistency: Assess whether witnesses have maintained consistent positions (no evidence of witness duplicity)
Threshold Achievement: Determine if sufficient non-duplicitous witnesses have attested to establish consensus
The judge applies the identifier's TOAD (Threshold of Accountable Duplicity) to determine if enough honest witnesses exist to make a reliable determination.
Step 5: Watcher Input Integration
Judges receive and integrate observations from watchers:
Duplicity Reports: Watchers report detected duplicity across the network
Juror Findings: Basic duplicity detection results from juror components
Network-Wide Consistency: Information about whether the same events are being propagated globally
Temporal Analysis: Timing information about when different versions appeared
Watchers operate in promiscuous mode, collecting all versions of events they encounter, providing judges with comprehensive duplicity evidence.
Step 6: Authoritative Key Set Determination
Based on the analysis, the judge determines the current authoritative key set for the identifier:
Valid Event Sequence: Identify the longest valid, non-duplicitous event sequence
Current Key State: Extract the current signing keys and next key digests from the latest valid establishment event
Witness Configuration: Determine the current witness set and thresholds
Recovery State: Identify if the identifier is in a recovery state due to detected compromise
Step 7: Trust Determination Output
The judge produces a trust determination that validators can consume:
Trusted: The identifier's key state is valid, non-duplicitous, and sufficiently witnessed
Untrusted: Duplicity detected, insufficient witness consensus, or other validation failures
Conditional: Trust with caveats (e.g., recent rotation, recovery in progress)
Unknown: Insufficient information to make a determination
This determination includes:
The validated key state
Evidence supporting the determination
Confidence level based on witness consensus strength
Judge validates the recovery and updates key state
Validators are notified of the recovery
This scenario demonstrates KERI's core security innovation: making duplicity evident and recoverable.
Scenario 3: Witness Rotation
When a controller rotates their witness set:
Controller issues a rotation event changing witness configuration
New witnesses begin receipting events
Judge must validate the transition from old to new witnesses
Judge ensures sufficient overlap for continuity
Judge updates its witness tracking for future validations
Witness rotation is a normal operational event that judges must handle smoothly.
Scenario 4: High-Stakes Transaction
For critical transactions requiring enhanced assurance:
Validator requests high-confidence determination
Judge collects KERLs from all available witnesses (not just threshold)
Judge queries multiple watchers for duplicity reports
Judge performs extended temporal analysis
Judge provides detailed confidence metrics with determination
Validator makes risk-based decision using enhanced information
This pattern trades performance for increased security assurance.
Best Practices
Judge Deployment Architecture
Distributed Judge Pools: Deploy multiple judges operated by different entities to avoid single points of failure. Even competitors in the same market space benefit from sharing duplicity detection infrastructure, similar to certificate transparency systems.
Separation of Concerns: Judges should be separate from witnesses and watchers to maintain independence. A judge operated by the same entity as a witness creates potential conflicts of interest.
Redundancy: Validators should consult multiple judges for critical decisions, especially when judges disagree.
Performance Optimization
Caching: Cache validated key states with appropriate TTLs to reduce repeated validation overhead.
Incremental Validation: When possible, validate only new events since the last validation rather than re-validating entire KERLs.
Parallel Processing: Validate multiple KERLs concurrently to reduce latency.
Witness Prioritization: Query witnesses in order of reliability/proximity to optimize response time.
Security Hardening
Input Validation: Rigorously validate all inputs (KERLs, receipts, watcher reports) to prevent injection attacks.
Rate Limiting: Implement rate limits to prevent denial-of-service attacks.
Audit Logging: Maintain comprehensive logs of all determinations for forensic analysis.
Query Interface: Request key state determinations for specific identifiers
Subscription Model: Subscribe to updates for identifiers of interest
Batch Queries: Request determinations for multiple identifiers efficiently
Confidence Thresholds: Specify required confidence levels for determinations
Watcher Integration
Judges integrate with watchers through:
Duplicity Reports: Receive notifications of detected duplicity
Event Queries: Request specific events or event ranges from watcher archives
Network Topology: Understand watcher coverage to assess global consistency
Temporal Data: Obtain timing information about when events were first seen
Witness Integration
Judges integrate with witnesses through:
KERL Retrieval: Fetch complete or partial KERLs via OOBI endpoints
Receipt Verification: Validate witness signatures on receipts
Availability Monitoring: Track witness uptime and responsiveness
Configuration Updates: Detect when witness sets change
Ecosystem Cooperation
The source material emphasizes that even competitors benefit from sharing judge infrastructure:
"Even competitors in the same market space will want to share duplicity information across the entire ecosystem... Similar to certificate transparency systems in the internet hosting space, competitors share information with each other because it serves their best interest to eliminate fraud/duplicity."
This cooperative model enables:
Network effects: Security improves as more participants validate
Watcher Observation: Watchers collect all versions of events
Judge Analysis: Judges detect inconsistencies across witnesses
This approach is more scalable and performant than consensus-based systems.
Attack Detection
The source material emphasizes:
"The only 'fault' that is apparent to judges is an attack on the KEL. Such attacks can only occur via key compromise. Therefore, a successful multi-threshold attack causing duplicity is the only condition that watchers are actively monitoring for, and judges transmit the 'judgement' of watchers concerning duplicity."
This focused threat model allows judges to be highly effective at their specific task.
Recovery Facilitation
When duplicity is detected, judges facilitate recovery:
Identify Compromise Point: Determine where in the event sequence compromise occurred
Validate Recovery: Verify that recovery uses legitimate pre-rotated keys
Update Key State: Propagate the recovered key state to validators
Maintain Evidence: Preserve duplicitous events for forensic analysis
This recovery capability is unique to KERI and enabled by pre-rotation.
Conclusion
Judges are critical components in KERI's distributed validation infrastructure, providing authoritative determinations about identifier key state by examining witness attestations and detecting duplicity. By operating in a cooperative ecosystem model where even competitors share duplicity information, judges enable scalable, secure, and recoverable decentralized identity systems. Their focused role—validating key state and detecting duplicity—allows them to be highly effective without requiring the complexity of distributed consensus mechanisms, making KERI suitable for internet-scale identity infrastructure.
Understand coverage: Know which identifiers each watcher monitors
Assess reliability: Track watcher uptime and accuracy
Threshold Calculation
Correctly implementing threshold validation is critical:
Simple thresholds: "2/3" means 2 of 3 signatures required
Weighted thresholds: Different keys may have different weights (e.g., "0.5,0.3,0.2" with threshold "0.6")
Fractional weights: Support arbitrary precision for complex multi-sig schemes
Threshold changes: Handle threshold changes across rotation events
Recovery Support
When duplicity indicates key compromise, judges must support recovery:
Identify compromise point: Determine the sequence number where compromise occurred
Validate recovery events: Verify that recovery uses legitimate pre-rotated keys