Skip to main content

Wallets

Wallets are the foundation of the Agentic Wallet system. Each wallet represents a Solana keypair with flexible custody options and built-in balance management.

Wallet Creation

Wallets are created through the wallet-engine service and assigned a UUID identifier for internal tracking:

Creating a Wallet

Auto-Funding (Devnet Only)

For development, wallets can be automatically funded on creation:
Auto-funding only works with devnet RPC URLs and requires WALLET_AUTOFUND_PAYER_PRIVATE_KEY to be configured.

Signer Backends

Agentic Wallet supports multiple signer backends for different security and deployment requirements:

Encrypted File

Development & TestingKeys encrypted with AES-256-GCM and stored locally.

Memory

Testing OnlyKeys stored in-memory, lost on restart.

KMS

Production: CloudAWS KMS or compatible key management service.

HSM

Production: HardwareHardware Security Module integration.

MPC

Production: DistributedMulti-Party Computation with threshold signatures.

Key Provenance

Each wallet includes provenance metadata:

Balance Queries

SOL Balance

Query the native SOL balance for any wallet:
Response:

SPL Token Balances

Query all SPL token holdings:
Response:

Signing Operations

The wallet-engine provides a secure signing boundary. Private keys never leave the service:

Transaction Signing

Returns:

Message Signing

Returns:
The /api/v1/wallets/:walletId/sign endpoint should only be called by trusted internal services (transaction-engine). Never expose this endpoint to external clients.

Wallet Listing

List all wallets or filter by public key:

RPC Reliability

Wallet-engine includes automatic RPC retry logic:
  • Health-scored RPC pool: Automatic failover using SOLANA_RPC_POOL_URLS
  • Adaptive retries: Configurable max retries and delay
  • Error detection: Automatic retry for 429, fetch failures, blockhash issues

Configuration

Best Practices

  1. Never use memory or encrypted-file backends in production
  2. Use KMS, HSM, or MPC for production key management
  3. Enable RPC pool failover for high availability
  4. Set appropriate retry limits to avoid cascading failures
  5. Monitor wallet creation rate and implement rate limiting
  1. Private keys never appear in logs or API responses
  2. Signing operations are isolated in wallet-engine
  3. All key material is encrypted at rest (except memory backend)
  4. Use separate wallets for different risk profiles
  5. Implement wallet status management (active/disabled)
  1. Use autoFund for quick devnet testing
  2. Label wallets clearly for debugging
  3. Use encrypted-file backend for local development
  4. Test RPC failover scenarios
  5. Validate balance before attempting transactions

Source Code Reference

Wallet functionality is implemented in:
  • services/wallet-engine/src/app.ts - Main wallet API (services/wallet-engine/src/app.ts:1)
  • services/wallet-engine/src/key-provider/factory.ts - Signer backend factory
  • packages/common/src/schemas/wallet.ts - TypeScript schemas (packages/common/src/schemas/wallet.ts:1)