Solana Keychain provides a unified interface for signing Solana transactions across multiple key management backends. Develop locally with an in-memory key, then switch to enterprise key management, cloud HSMs, or managed wallet services in production, without rewriting your signing code.
Why Keychain?
- Single Interface: One
SolanaSignerbase interface across all backends, plus one capability per backend: sign, rewrite-and-sign, or sign-and-broadcast - Swap Backends: Change key management providers through configuration; call sites only change when the new backend has a different capability (Crossmint and Fordefi native modes)
- Pay for what you use: Rust feature flags, per-backend npm packages, Python extras and per-backend Go modules include only the backends you need
- Audited: Rust, TypeScript, Python and Go audited by OtterSec (the opt-in Ledger backend was out of scope); an earlier Accretion audit covered Rust and TypeScript. See audit status.
Architecture
- Languages: Rust, TypeScript, Python and Go, at parity (the Ledger backend is Rust-only)
- Interface:
SolanaSignerbase (pubkey,sign_message,is_available) plus exactly one capability per backend:TransactionSigner,ModifyingSignerorSendingSigner - Backends: Memory, Vault, AWS KMS, GCP KMS, Privy, Turnkey, Fireblocks, CDP, Crossmint, Dfns, Openfort, Para, Utila, Fordefi, Ledger (Rust only, opt-in, unaudited)
- Compatibility:
@solana/kitand@solana/signers8.1+ (TypeScript) |solana-sdk2.x, 3.x or 4.x via thesdk-v2/sdk-v3/sdk-v4features (Rust; v1 transactions needsdk-v4) |solders(Python) |solana-gov2 (Go)
Supported Backends
Backends span local development, self-hosted and cloud key management, and managed or MPC wallet services. See Choosing a backend to compare custody models and pick the right one.
| Backend | Use Case | Rust | TypeScript | Python | Go |
|---|---|---|---|---|---|
| Memory | Development, testing | ✓ | ✓ | ✓ | ✓ |
| HashiCorp Vault | Self-hosted key management | ✓ | ✓ | ✓ | ✓ |
| AWS KMS | Cloud-native (AWS) | ✓ | ✓ | ✓ | ✓ |
| GCP KMS | Cloud-native (GCP) | ✓ | ✓ | ✓ | ✓ |
| Privy | Embedded wallets | ✓ | ✓ | ✓ | ✓ |
| Turnkey | Non-custodial key management | ✓ | ✓ | ✓ | ✓ |
| Fireblocks | Institutional custody | ✓ | ✓ | ✓ | ✓ |
| CDP | Coinbase Developer Platform | ✓ | ✓ | ✓ | ✓ |
| Crossmint | Crossmint managed wallets | ✓ | ✓ | ✓ | ✓ |
| Dfns | Dfns wallet infrastructure | ✓ | ✓ | ✓ | ✓ |
| Openfort | Openfort backend wallets | ✓ | ✓ | ✓ | ✓ |
| Para | Para MPC wallets | ✓ | ✓ | ✓ | ✓ |
| Utila | Utila MPC custody | ✓ | ✓ | ✓ | ✓ |
| Fordefi | Fordefi MPC custody | ✓ | ✓ | ✓ | ✓ |
| Ledger | Hardware wallet (opt-in, unaudited) | ✓ |
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")?;let pubkey = signer.pubkey();// Transaction signing is a capability; `tx` is a VersionedTransactionif let Some(tx_signer) = signer.as_transaction_signer() {let result = tx_signer.sign_transaction(&mut tx).await?;}// Or let the umbrella route any backend shape and supply the RPC hop yourselflet signature = signer.sign_and_send(&mut tx, |encoded| async move { broadcast(encoded).await }).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
To install a Keychain signer on a Kit client
as its payer or identity, use @solana/keychain-kit-plugin (Crossmint and
Fordefi native modes are excluded, since they rewrite transactions).
Python
Install the package (heavier backends ship as extras, for example
solana-keychain[aws-kms]):
pip install solana-keychain
Basic usage:
import osfrom solana_keychain import VaultSignerConfig, create_vault_signersigner = await create_vault_signer(VaultSignerConfig(api_base_url="https://vault.example.com:8200",token=os.environ["VAULT_TOKEN"],key_name="my-solana-key",public_key="base58_public_key",))# tx is a solders VersionedTransactionresult = await signer.sign_transaction(tx)
- Python Guide - Full installation, extras and backend configuration
- PyPI - Python package
Go
Each backend is its own Go module, so you only pull the backends you import:
go get github.com/solana-foundation/solana-keychain/go/signers/vault/v2@latest
Basic usage:
import "github.com/solana-foundation/solana-keychain/go/signers/vault/v2"signer, err := vault.New(vault.Config{VaultAddr: "https://vault.example.com:8200",Token: os.Getenv("VAULT_TOKEN"),KeyName: "my-solana-key",Pubkey: "base58_public_key",})if err != nil {return err}// tx is a *solana.Transaction from solana-go v2res, err := signer.SignTransaction(ctx, tx)
- Go Guide - Modules, capabilities and backend configuration
- pkg.go.dev - Go reference
Next steps
Rust guide
Install the crate and configure each backend.
TypeScript guide
Install the packages and configure each backend.
Python guide
Install the package and its extras, and configure each backend.
Go guide
Add the per-backend modules and configure each backend.
Choosing a backend
Compare custody models and pick the right signing backend.
Production best practices
Operate signing safely: hot/cold separation, rotation, monitoring.
Adding custom signers
Integrate a new key management backend.
Source
Built and maintained by the Solana Foundation. Licensed under MIT.
Is this page helpful?