A signer is a CESRprimitive that represents a private key and has the ability to create indexed signatures (Sigers) and non-indexed signatures (Cigars) for cryptographic signing operations in KERI.
Related Concepts
No related concepts available
Comprehensive Explanation
signer
Technical Definition
A signer is a cryptographic primitive within the CESR (Composable Event Streaming Representation) framework that encapsulates a private key and provides methods for generating digital signatures. As defined in the cesride terminology, a signer has two primary capabilities:
Create Sigers: Generate indexed signatures used in multi-signature contexts where the signature must be associated with a specific key in an ordered set
The signer primitive is one of six foundational cryptographic primitives in cesride (alongside Diger, Verfer, Siger, Cigar, and Salter) that form the building blocks for KERI's cryptographic operations.
Purpose in KERI/ACDC
In the KERI protocol, signers serve as the authoritative signing mechanism for controllers of Autonomic Identifiers (AIDs). Every entry in a Key Event Log (KEL) must be signed by the controller's current authoritative key pairs, and the signer primitive provides the interface for these signing operations.
Implementation Notes
Key Generation
Signers must be generated from high-entropy sources using cryptographically secure random number generators (CSPRNGs). The minimum entropy requirement is 128 bits of cryptographic strength. Implementations should use platform-specific secure random sources (e.g., /dev/urandom on Unix, CryptGenRandom on Windows, or language-specific crypto libraries).
Storage Security
Private keys encapsulated by signers must never be stored in plaintext. Implementations should:
Encrypt keystores using strong encryption (AES-256 or equivalent)
Derive encryption keys from user passcodes using key stretching (e.g., PBKDF2, Argon2)
Consider hardware security modules (HSMs) or trusted execution environments (TEEs) for high-value keys
Implement secure memory handling to prevent key material from being swapped to disk
Algorithm Support
While Ed25519 is the most common signature scheme in KERI, implementations should support multiple algorithms for cryptographic agility:
Ed25519: Primary algorithm, provides ~128 bits of security
ECDSA secp256k1: For Bitcoin/Ethereum compatibility
Future post-quantum algorithms: Architecture should allow adding new schemes via derivation codes
Multi-Signature Coordination
In multi-signature scenarios, implementations must handle:
Partial signature sets: Events may arrive with incomplete signatures
Escrow mechanisms: Hold events until threshold is satisfied
Index management: Ensure each signature includes correct index for key identification
Threshold verification: Validate that collected signatures meet the required threshold
Performance Considerations
Signing operations: Ed25519 signing is fast (~50,000 signatures/second on modern CPUs)
Batch processing: For high-throughput scenarios, consider batching multiple events
Hardware acceleration: Leverage CPU instructions (AVX2) or hardware crypto accelerators
Caching: Cache signatures for frequently-accessed events, but invalidate on key rotation
Security Best Practices
Key rotation: Rotate signing keys regularly using KERI's pre-rotation mechanism
For ACDC (Authentic Chained Data Container) credentials, signers enable:
Credential issuance: Signing credential data to establish proof-of-authorship
Presentation signing: Creating signatures for credential presentations
Chain verification: Signing edges that link ACDCs in verifiable chains
Type Classification
The signer is classified as a cryptographic material primitive in CESR's taxonomy. It belongs to the category of primitives that perform cryptographic operations (as opposed to primitives that represent digests or verification keys). The signer is specifically a signing primitive that operates in the Raw Domain for cryptographic operations while supporting serialization to both Text Domain and Binary Domain through CESR encoding.
Cryptographic Properties
Underlying Algorithms
Signers in KERI implementations support multiple cryptographic signature schemes, with the specific algorithm indicated by the derivation code prepended to the encoded key material. Common algorithms include:
Ed25519 (EdDSA):
The most commonly used signature scheme in KERI
Based on Curve25519 elliptic curve
Provides approximately 128 bits of cryptographic strength
The pre-rotation mechanism provides post-quantum security even with current algorithms
Security Properties
Signers provide several critical security properties:
Non-repudiation: Signatures created by a signer are cryptographically bound to the private key, making it computationally infeasible for the signer to deny having created the signature. This property is fundamental to KERI's duplicity detection mechanisms.
Unforgeability: Without access to the private key, it is computationally infeasible to create valid signatures. This property relies on the hardness of the discrete logarithm problem (for elliptic curve schemes) or similar mathematical problems.
Key Isolation: The signer primitive encapsulates the private key, providing an abstraction layer that can enforce security policies around key usage. In production systems, signers may interface with Hardware Security Modules (HSMs) or Trusted Execution Environments (TEEs) to protect key material.
One-Time Use: KERI's security model emphasizes one-time, one-place, one-way key usage. Signers should ideally be used for a single signing operation and then rotated, particularly for establishment events that change key state.
Key/Output Sizes
For Ed25519 (the most common KERI signature scheme):
Private Key Size:
Raw binary: 32 bytes (256 bits)
CESR text encoding: 44 characters (including derivation code)
CESR text encoding for indexed signature (Siger): 88 characters
CESR binary encoding for indexed signature: 66 bytes
The derivation code prepended to the key material indicates:
The cryptographic algorithm used
The key type (signing vs. verification)
The encoding format
For example, the derivation code A indicates an Ed25519 signing key in CESR text format.
Data Format & Encoding
CESR Encoding Format
Signers follow CESR's qualified encoding approach, where cryptographic material is prepended with a derivation code that makes the primitive self-describing. This enables self-framing and composability properties essential to CESR streams.
Qualified Encoding Structure:
[Derivation Code][Encoded Key Material]
The derivation code serves multiple purposes:
Algorithm identification: Specifies which cryptographic algorithm the key uses
Type indication: Distinguishes signing keys from verification keys
Length determination: Enables parsers to extract the correct number of bytes/characters
Domain indication: Specifies whether the encoding is text or binary
Text and Binary Representations
Signers support dual-domain encoding, a core CESR feature:
Text Domain (T):
Uses URL-safe Base64 character set: [A-Z, a-z, 0-9, -, _]
Human-readable for debugging and logging
Suitable for JSON serialization and text-based protocols
Example Ed25519 signing key: AXq5YqaL6L48pf0fu7IUhL0JRaU2_RxFP0AL43wYn148
Binary Domain (B):
Compact byte representation
Efficient for network transmission and storage
Maintains same logical structure as text domain
Enables lossless round-trip conversion with text domain
Raw Domain (R):
Represented as tuple: (derivation_code, raw_key_bytes)
Used for actual cryptographic operations
The raw key bytes are fed to cryptographic libraries
Example: ("A", b'\x5e\xae\x98\xaa...') (32 bytes for Ed25519)
The derivation code system is extensible, allowing new signature schemes to be added without breaking existing implementations. This cryptographic agility is essential for KERI's long-term security as new algorithms emerge and old ones become deprecated.
Alignment and Padding
CESR requires all primitives to align on 24-bit boundaries (the least common multiple of 6 bits for Base64 characters and 8 bits for bytes). For Ed25519 signing keys:
Raw key: 32 bytes
Pad size calculation: (3 - (32 mod 3)) mod 3 = 1
One lead byte is prepended before Base64 encoding
The derivation code replaces characters derived from the lead byte
This alignment ensures composability—concatenated primitives can be converted between text and binary domains without bit-level dependencies between adjacent primitives.
Delegated identifiers require signatures from both the delegate's signer and approval from the delegator
The delegator's signer creates a seal in their KEL approving the delegate's event
Common Usage Patterns
Single-Signature Pattern:
1. Controller generates key pair using Salter
2. Signer primitive encapsulates private key
3. Event data is serialized
4. Signer.sign(event_data) produces signature
5. Signature is attached to event message
6. Verfer (public key) is published in KEL
Multi-Signature Pattern:
1. Multiple controllers each have their own Signer
2. Event data is shared among all signers
3. Each Signer creates an indexed signature (Siger)
4. Signatures are collected until threshold is met
5. All signatures are attached to the event
6. Each signature includes an index indicating which key signed
Custodial Signing Pattern:
1. Controller retains rotation authority (pre-rotated keys)
2. Custodial agent holds signing authority (current keys)
3. Agent's Signer signs routine operations
4. Controller's Signer only used for rotations
5. Enables secure delegation without full key transfer
Witness Receipt Pattern:
1. Controller's Signer signs key event
2. Event is sent to witnesses
3. Each witness's Signer creates a receipt signature
4. Receipts are collected to form KERL
5. Witnesses' signatures provide distributed consensus
Verification Procedures
While signers create signatures, verification uses the corresponding Verfer (public key) primitive:
Signature Verification Steps:
Extract the signature from the event message
Identify the signing key using the signature index (for multi-sig)
Retrieve the corresponding Verfer from the KEL
Use Verfer.verify(event_data, signature) to validate
Check that the signature satisfies the threshold requirement
Key State Verification:
Determine which keys were authoritative when the event was signed
For inception events, the AID prefix derives from the initial keys
For subsequent events, consult the KEL to find the current key state
Verify that the signing keys match the authoritative keys at that point in the KEL
Threshold Verification:
Count the number of valid signatures
Compare against the signing threshold specified in the most recent establishment event
For weighted thresholds, sum the weights of valid signatures
Ensure the threshold is met before accepting the event