Skip to main content

Signer Backend Options

Agentic Wallet supports five signer backends for different security and operational requirements. All backends implement the same KeyProvider 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
Not suitable for:
  • Production environments
  • Multi-node deployments
  • High-security requirements

Configuration

The WALLET_KEY_ENCRYPTION_SECRET must be kept secure. If compromised, all encrypted keys are at risk.

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

Example:

Security Considerations

1

Strong Secret

Generate secret with openssl rand -base64 32
2

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 code

Memory Backend

Overview

Keys held in process memory only, never persisted to disk. Best for:
  • Integration tests
  • CI/CD pipelines
  • Ephemeral testing environments
Not suitable for:
  • 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
Memory backend provides no persistence. Wallets created with this backend cannot be recovered after restart.

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

All 3 node secrets are required. The system uses a 2-of-3 threshold: any 2 shares can reconstruct the key.

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 32
2

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:
Changing WALLET_SIGNER_BACKEND without migrating keys will make existing wallets inaccessible.

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 variables
3

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

Use encrypted-file for local development:

Testing

Use memory for CI/CD and integration tests:

Production (Cloud)

Use kms with cloud-native key management:

Production (High Compliance)

Use hsm for regulated industries:

Production (Distributed)

Use mpc for multi-party custody:

Key Management

Key isolation and lifecycle management

Security Overview

Trust boundaries and protection layers