Custodial rotation is a KERIkey management mechanism that splits control authority between signing authority (delegated to a custodial agent) and rotation authority (retained by the original controller), enabling secure operational delegation while maintaining ultimate control through the ability to unilaterally rotate keys.
Related Concepts
No related concepts available
Comprehensive Explanation
custodial-rotation
Process Definition
Custodial rotation is a sophisticated key management process in KERI that enables secure delegation of operational signing capabilities to a third-party custodian while the original controller retains ultimate authority over the AID. This is accomplished through KERI's partial rotation mechanism, which splits control authority into two distinct capabilities:
Signing authority: The right to sign non-establishment events and perform day-to-day operations
This separation is achieved through specific structuring of thresholds and key lists in establishment events, combined with KERI's pre-rotation mechanism. The custodial agent holds keys that satisfy the current signing threshold, while the original controller maintains exclusive possession of the pre-rotated keys needed to authorize any .
Implementation Notes
Critical Implementation Requirements
Threshold Configuration
Implementers must carefully structure thresholds to achieve proper authority separation:
Current threshold (kt): Must be satisfiable by custodian's keys alone for operational signing
Next threshold (nt): Must require controller's pre-rotated keys, excluding custodian keys from rotation authority
Fractional weights: When using weighted thresholds, ensure custodian keys have sufficient weight for signing but insufficient weight for rotation
Key Material Management
Controller Responsibilities:
Generate high-entropy keys using CSPRNG
Securely store rotation keys (HSM, TEE, or offline storage recommended)
Maintain encrypted backups with documented recovery procedures
Never expose rotation keys to custodian or operational systems
Custodian Responsibilities:
Securely receive and store delegated signing keys
Implement proper key access controls
Monitor for rotation events that revoke authority
Gracefully cease operations after rotation
Rotation Event Validation
Validators must verify:
Prior next key exposure: Exposed keys must hash to digests in prior event's n field
Dual threshold satisfaction: Both prior next threshold and new current threshold must be satisfied
Sequence number: Rotation must increment sequence number correctly
Digest chain: Event digest must properly chain to prior event
Witness receipts: Sufficient witness receipts per TOAD configuration
State Synchronization
Implementations must handle:
KEL retrieval: Fetch complete KEL to determine current key state
Cache invalidation: Invalidate cached key state when rotations occur
Concurrent operations: Handle race conditions between signing and rotation
Regulatory compliance: Separation of duties requirements mandate split authority structures
Risk mitigation: Limiting exposure of the most critical rotation keys while enabling operational flexibility
Key Participants
The custodial rotation process involves three primary roles:
Original Controller: The entity with ultimate authority over the AID, who retains exclusive rotation authority
Custodial Agent: The delegated entity granted signing authority for operational purposes
Witnesses: The designated entities that verify and receipt both the delegation establishment and any subsequent rotation events
Process Flow
The custodial rotation process follows a multi-phase lifecycle:
Phase 1: Initial Establishment with Split Authority
Step 1: Controller Key Generation
The original controller generates two distinct key sets:
Current key set: Keys that will be delegated to the custodial agent for signing authority
Next key set: Pre-rotated keys that remain under exclusive controller possession for rotation authority
The controller computes cryptographic digests of the next key set, creating blinded commitments that will be included in the inception event.
Step 2: Threshold Configuration
The controller structures the establishment event with carefully designed thresholds:
Current threshold (kt): Set to enable the custodial agent's keys to satisfy signing requirements (e.g., "1" for single custodian, or weighted threshold for multiple custodians)
Next threshold (nt): Set to require the controller's pre-rotated keys for rotation authorization (typically excluding custodian keys from rotation authority)
Example threshold structure:
{
"kt": "1", // Custodian can sign with single key
"k": ["<custodian_public_key>"],
"nt": "1", // Controller must sign rotations
"n": ["<digest_of_controller_next_key>"]
}
Step 3: Inception Event Creation
The controller creates an inception event that:
Establishes the AID with the custodian's public key in the current key list
Commits to the controller's next keys via digests in the next key digest list
Sets thresholds that enable custodial signing but reserve rotation authority
Includes configuration traits and witness designations
Step 4: Key Material Transfer
The controller securely transfers the current private keys to the custodial agent through an out-of-band secure channel. The controller retains:
The pre-rotated private keys (never shared with custodian)
The ability to generate additional pre-rotated keys for future rotations
Critical Limitation: The custodian cannot create rotation events because they lack the pre-rotated private keys needed to satisfy the next threshold from the prior establishment event.
Phase 3: Controller-Initiated Rotation ("Firing" the Custodian)
Step 6: Rotation Decision
The controller decides to rotate keys, which may be triggered by:
Termination of custodial relationship
Suspected key compromise
Scheduled key rotation policy
Change in operational requirements
Security incident or audit finding
Step 7: New Key Generation
The controller generates:
New current key set (may be controller-held or delegated to a different custodian)
New next key set for future rotation authority
Digests of the new next keys
Step 8: Rotation Event Creation
The controller creates a rotation event that:
References prior establishment: Links to the previous event via digest
Exposes prior next keys: Reveals the actual public keys corresponding to the digests from the prior event (proving possession)
Establishes new current keys: Specifies the new current key list and threshold
Commits to new next keys: Includes digests of newly generated next keys
Satisfies dual thresholds:
Prior next threshold: Signed with the controller's pre-rotated keys
New current threshold: Signed with the new current keys
Step 9: Rotation Event Propagation
The controller:
Signs the rotation event with both the prior next keys and new current keys
Watchers provide ambient verification of rotation events
Caching systems must invalidate stale key state
Error Handling
Rotation Failure Scenarios
Insufficient witness receipts: If rotation event doesn't achieve witness threshold, the rotation is not established. Controller must retry or investigate witness availability.
Threshold satisfaction failure: If rotation event signatures don't satisfy both required thresholds, witnesses will reject the event. Controller must regenerate with correct signatures.
Digest mismatch: If exposed prior next keys don't hash to the committed digests, the rotation is invalid. This indicates either key generation error or potential attack.
Custodian interference: If custodian attempts to create conflicting events after rotation, duplicity detection mechanisms will identify the conflict. Validators will reject custodian's events based on KEL ordering.
Recovery Procedures
Lost rotation keys: If controller loses pre-rotated keys, the AID cannot be rotated. This is an irrecoverable failure requiring AID abandonment. Emphasizes importance of secure key backup.
Premature key exposure: If next keys are accidentally exposed before rotation, controller should immediately rotate to new keys to maintain security.
Witness pool failure: If witness pool becomes unavailable, controller may need to rotate to a new witness pool configuration, which itself requires a rotation event.
Usage Patterns
Typical Scenarios
Scenario 1: Cloud Agent Delegation
A user wants to use a cloud-based KERIA agent for convenience while maintaining ultimate control:
User generates AID with custodial rotation structure