Solana Keychain provides a unified interface for signing Solana transactions across multiple key management backends. Use it to integrate enterprise-grade signing into your backend services.
Why Keychain?
- Single Interface: One
SolanaSignertrait works across all backends - Swap Backends: Change key management providers without rewriting code
- Zero-Cost Abstraction: Feature flags include only what you need
Architecture
- Languages: Rust + TypeScript
- Trait: Unified
SolanaSignerinterface - Backends: Memory, Vault, AWS KMS, GCP KMS, Privy, Turnkey, Fireblocks, CDP, Crossmint, Dfns, Openfort, Para
- Compatibility:
@solana/kitand@solana/signerscompatible (TypeScript) |solana-sdkandsolana-sdk-v3compatible (Rust)
Supported Backends
| Backend | Use Case | Rust | TypeScript |
|---|---|---|---|
| Memory | Development, testing | ✓ | ✓ |
| HashiCorp Vault | Self-hosted HSM | ✓ | ✓ |
| AWS KMS | Cloud-native (AWS) | ✓ | ✓ |
| GCP KMS | Cloud-native (GCP) | ✓ | ✓ |
| Privy | Embedded wallets | ✓ | ✓ |
| Turnkey | Non-custodial | ✓ | ✓ |
| Fireblocks | Institutional MPC | ✓ | ✓ |
| CDP | Coinbase Developer Platform | ✓ | ✓ |
| Crossmint | Crossmint managed wallets | ✓ | ✓ |
| Dfns | Dfns wallet infrastructure | ✓ | ✓ |
| Openfort | Openfort embedded wallets | ✓ | ✓ |
| Para | Para MPC wallets | ✓ | ✓ |
Quick Start
Rust
Install the Rust crate:
cargo add solana-keychain
Basic usage:
use solana_keychain::{Signer, SolanaSigner};// Create a signer from any backendlet signer = Signer::from_memory("base58_private_key")?;// All signers share the same interfacelet pubkey = signer.pubkey();let signature = signer.sign_transaction(&mut tx).await?;
- Rust Guide - Full installation and backend configuration
- Crates.io - Rust crate
TypeScript
Install the TypeScript package:
pnpm add @solana/keychain
Basic usage:
import { createKeychainSigner } from "@solana/keychain";import { signTransactionWithSigners } from "@solana/signers";// Create any signer via the unified factoryconst signer = await createKeychainSigner({backend: "vault",vaultAddr: "https://vault.example.com:8200",vaultToken: "hvs.xxxxx",keyName: "my-solana-key",publicKey: "base58_public_key"});// Sign an already-compiled transactionconst signedTx = await signTransactionWithSigners([signer],compiledTransaction);
- TypeScript Guide -
@solana/keychainpackages - npm Package - npm package
Other Resources
- Adding Custom Signers - Integrate new backends
- GitHub Releases - Release history
Source
Built and maintained by the Solana Foundation.
Licensed under MIT. See LICENSE for details.
Is this page helpful?