Signer Backend Options
Agentic Wallet supports five signer backends for different security and operational requirements. All backends implement the sameKeyProvider interface, allowing seamless switching without code changes.
Encrypted-File
Local development and prototyping
Memory
Ephemeral testing (keys not persisted)
KMS
Managed key governance and rotation
HSM
Hardware-rooted custody for compliance
MPC
Distributed threshold custody
Decision Matrix
Encrypted-File Backend
Overview
Keys stored as encrypted files on local disk using AES-256-GCM. Best for:- Local development and prototyping
- Single-machine deployments
- Quick setup and iteration
- Production environments
- Multi-node deployments
- High-security requirements
Configuration
How It Works
File Format
Keys stored in JSON format:- Algorithm: AES-256-GCM (authenticated encryption)
- Key derivation: SHA-256 hash of
WALLET_KEY_ENCRYPTION_SECRET - IV: Random 16 bytes per encryption
- Authentication: GCM provides integrity verification
File Locations
Security Considerations
1
Strong Secret
Generate secret with
openssl rand -base64 322
File Permissions
Set restrictive permissions:
3
Backup Strategy
Implement encrypted backups of key directory
4
Secret Management
Store
WALLET_KEY_ENCRYPTION_SECRET in environment, not in codeMemory Backend
Overview
Keys held in process memory only, never persisted to disk. Best for:- Integration tests
- CI/CD pipelines
- Ephemeral testing environments
- Any production use
- Development with persistent wallets
- Scenarios requiring key recovery
Configuration
How It Works
Characteristics
- Lifetime: Keys lost when process terminates
- Performance: Fastest backend (no disk I/O)
- Recovery: Impossible once process exits
- Isolation: Keys isolated per process
KMS Backend
Overview
Keys encrypted using envelope encryption with a master secret managed by a Key Management Service. Best for:- Managed cloud environments (AWS, GCP, Azure)
- Centralized key governance
- Audit logging requirements
- Key rotation policies
Configuration
The current implementation is a software simulation of KMS envelope encryption. For production, integrate with AWS KMS, Google Cloud KMS, or Azure Key Vault.
How It Works
Envelope encryption pattern:1
Generate Data Key
For each wallet, generate a random 32-byte data key
2
Wrap Data Key
Encrypt the data key with the KMS master secret
3
Encrypt Private Key
Encrypt the wallet’s private key with the data key
4
Store Envelope
Save both wrapped data key and encrypted private key
File Format
Benefits
- Centralized key management: Master secret can be rotated independently
- Audit trail: KMS operations can be logged
- Access control: KMS policies control who can decrypt
- Compliance: Meets regulatory requirements for key governance
Production Integration
For production AWS KMS integration:HSM Backend
Overview
Keys protected by hardware security module (HSM) with hardware-rooted custody. Best for:- High-compliance environments (PCI-DSS, FIPS 140-2)
- Financial services
- Regulatory requirements for hardware key storage
- Scenarios requiring physical tamper protection
Configuration
The current implementation is a software simulation. For production, integrate with AWS CloudHSM, Thales Luna HSM, YubiHSM, or similar hardware.
How It Works
File Format
HSM Concepts
- Slot: Logical partition within HSM hardware
- PIN: Authentication credential for accessing slot
- Module Secret: Shared secret for wrapping keys at rest
- FIPS 140-2: U.S. government security standard for cryptographic modules
Production Integration
For production AWS CloudHSM integration:MPC Backend
Overview
Keys split into multiple shares using threshold cryptography, providing distributed custody. Best for:- Distributed operational control
- Reducing single-point-of-failure risk
- Multi-party governance
- Geographic distribution requirements
Configuration
How It Works
Secret Sharing Scheme:1
Split Secret
Wallet private key divided into 3 shares using Galois field arithmetic (GF(256))
2
Encrypt Shares
Each share encrypted with its corresponding node secret
3
Store All Shares
All 3 encrypted shares stored in single envelope file
4
Reconstruct on Load
Any 2 shares can reconstruct the original key using Lagrange interpolation
File Format
Threshold Reconstruction
Key reconstruction requires any 2 of the 3 shares:Benefits
- No single point of failure: Loss of one secret doesn’t compromise keys
- Distributed trust: No single party holds complete key
- Geographic distribution: Secrets can be stored in different regions
- Operational flexibility: Any 2 of 3 nodes can sign
Production Deployment
For production MPC deployments:1
Generate Node Secrets
Create 3 strong secrets with
openssl rand -base64 322
Distribute Secrets
Store each secret in a different infrastructure zone:
- Node 1: Region A, AWS Secrets Manager
- Node 2: Region B, HashiCorp Vault
- Node 3: Region C, Google Secret Manager
3
Access Control
Configure IAM policies so no single role can access all 3 secrets
4
Backup Strategy
Back up share files to different storage systems
5
Recovery Testing
Regularly test 2-of-3 reconstruction in staging
Switching Backends
Backends can be changed, but keys must be migrated:Migration Process
1
Export Keys
Read all wallet IDs and load keypairs from current backend
2
Switch Backend
Update
WALLET_SIGNER_BACKEND and related environment variables3
Re-save Keys
Save all keypairs using new backend
4
Verify
Test signing operations with migrated keys
5
Backup Old Keys
Keep old key files as backup until verified
A migration utility script is planned for a future release. For now, contact support for assistance with production migrations.
Performance Comparison
Latencies are approximate and depend on hardware, storage, and network conditions.
Security Comparison
Recommendations
Development
Useencrypted-file for local development:
Testing
Usememory for CI/CD and integration tests:
Production (Cloud)
Usekms with cloud-native key management:
Production (High Compliance)
Usehsm for regulated industries:
Production (Distributed)
Usempc for multi-party custody:
Related Pages
Key Management
Key isolation and lifecycle management
Security Overview
Trust boundaries and protection layers