Introduction
Unified Solana signing across multiple key management backends
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, Para
- Compatibility:
@solana/kitand@solana/signerscompatible (TypeScript) |solana-sdkandsolana-sdk-v3compatible (Rust)
Supported Backends
| Backend | Use Case | Rust | TypeScript |
|---|---|---|---|
| Memory | Development, testing | ✓ | via @solana/signers (or kit) |
| 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 | ✓ | ✓ |
| Para | Para MPC wallets | ✓ | ✓ |
Quick Start
Rust
Install the Rust crate:
cargo add solana-keychainBasic usage:
use solana_keychain::{Signer, SolanaSigner};
// Create a signer from any backend
let signer = Signer::from_memory("base58_private_key")?;
// All signers share the same interface
let 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/keychainBasic usage:
import { createKeychainSigner } from "@solana/keychain";
import { signTransactionWithSigners } from "@solana/signers";
// Create any signer via the unified factory
const 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 transaction
const signedTx = await signTransactionWithSigners(
[signer],
compiledTransaction,
);- TypeScript Guide -
@solana/keychainpackages - npm Package - npm package
Other Resources
- Adding Custom Signers - Integrate new backends
Source
Built and maintained by the Solana Foundation.
Licensed under MIT. See LICENSE for details.