Skip to content

​Installation

Add solana-keychain to your Cargo.toml with only the backends you need:
Cargo.toml
Upgrading from 1.x? See the Migrating to 2.0 guide.

​Feature Flags

FeatureDescription
memoryLocal keypair signing (default)
vaultHashiCorp Vault Transit engine
aws_kmsAWS KMS with Ed25519
gcp_kmsGCP Cloud KMS with Ed25519
privyPrivy embedded wallets
turnkeyTurnkey API
fireblocksFireblocks MPC
cdpCoinbase Developer Platform
crossmintCrossmint managed wallets
dfnsDfns wallet infrastructure
openfortOpenfort embedded wallets
paraPara MPC wallets
utilaUtila MPC custody
fordefiFordefi MPC custody
ledgerLedger hardware wallet over USB-HID (Rust only, opt-in, not in all)
allEnable every backend except ledger
sdk-v2Solana SDK 2.x (default)
sdk-v3Solana SDK 3.x
sdk-v4Solana SDK 4.x (required for v1 transactions)
unsafe-debugLogs full provider error responses; never enable in production
Exactly one of sdk-v2, sdk-v3, and sdk-v4 must be enabled.
As of solana-keychain 2.0.0 (October 2026), the sdk-v4 feature fails to compile on a fresh dependency resolve (two incompatible wincode versions). Use sdk-v2 or sdk-v3 until a fixed release is published.

​Basic Usage

All signers implement the base SolanaSigner trait (pubkey, sign_message, is_available). Each backend also implements exactly one capability trait:
  • TransactionSigner: signs your transaction as given.
  • ModifyingSigner: the provider rewrites the transaction, then signs it.
  • SendingSigner: the provider signs and broadcasts it.
Convert a legacy Transaction with .into(). Legacy and v0 transactions work on every SDK feature; v1 transactions require sdk-v4.

​Signer Capabilities

BackendCapability traitsign_message
CrossmintSendingSignerNot supported
Fordefi native autoSendingSignerYes
Fordefi native manualModifyingSignerYes
UtilaTransactionSignerNot supported
CDPTransactionSignerUTF-8 payloads only
LedgerTransactionSignerYes, over an offchain envelope
All others (incl. Fordefi black box)TransactionSignerYes
The Signer::from_* constructors run init() for you. If you construct the Privy, Fireblocks, Dfns, Crossmint, Para, Openfort, or Utila signer types directly, call init().await before use.

​Backend Configuration

​Memory Signer

For development and testing with local keypairs:

​HashiCorp Vault

For self-hosted HSM with Transit engine:
The address must use HTTPS, so a plain-HTTP vault server -dev is rejected by default. For local development only, VaultSigner::with_client_builder takes your own reqwest builder (use the re-exported solana_keychain::vault::reqwest) and leaves TLS to it, while still refusing redirects:

​AWS KMS

For cloud-native signing with AWS KMS Ed25519 keys:

​Privy

For embedded wallet signing:

​Turnkey

For non-custodial signing:

​Fireblocks

For institutional MPC signing:

​GCP KMS

For cloud-native signing with GCP Cloud KMS Ed25519 keys:

​CDP (Coinbase Developer Platform)

For Coinbase managed wallet signing:
CDP’s sign_message accepts UTF-8 payloads only.

​Crossmint

Crossmint is sending-only: its API executes every approved transaction server-side, so there is no sign-only path, and sign_message fails. Call sign_and_send_transaction, which leaves your transaction untouched and returns the signature of the transaction that landed. That transaction may differ from yours if Crossmint sponsors gas.

​Dfns

For Dfns wallet infrastructure signing:

​Para

For Para MPC wallet signing:

​Openfort

For Openfort backend wallet signing:

​Utila

For Utila MPC custody signing. sign_message is not supported, and you broadcast the signed transaction yourself.

​Fordefi

For Fordefi MPC custody signing. API requests are authenticated with an ECDSA P-256 request signature. Provide exactly one of private_key_pem, or request_signer (an Arc<dyn FordefiRequestSigner>, used to keep that key in a KMS/HSM). Fordefi comes as three signer types, fixed at construction by chain and push_mode:
chainpush_modeTypeCapabilityBehavior
NoneanyFordefiBlackBoxSignerTransactionSignerSigns raw bytes; you broadcast
Some(..)None or AutoFordefiNativeAutoSignerSendingSignerFordefi may rewrite the blockhash and fees, signs, and broadcasts
Some(..)ManualFordefiNativeManualSignerModifyingSignerFordefi rewrites and signs; you broadcast the returned transaction
Native manual mode replaces your transaction with the one Fordefi signed. Continue from it, never from the one you built. It must run before any other required signer.

​Ledger

For hardware wallet signing over USB-HID (Rust only). Requires the ledger feature, an unlocked device running the Solana app and, on Linux, Ledger’s udev rules. Ledger is not covered by the current audit; see audit status.
sign_message signs an offchain envelope wrapping your payload, not the raw bytes; rebuild it with solana_keychain::ledger::ledger_offchain_envelope to verify. Set auto_open_app: false for unattended use. A prompt declined on the device returns SignerError::UserRejected.

​Unified Signer Enum

Use the Signer enum to select backends at runtime:
Signer implements only SolanaSigner. Reach a capability through as_transaction_signer(), as_modifying_signer(), or as_sending_signer(), which return None when the backend lacks that shape:
Or let sign_and_send route by backend. The crate has no RPC client, so you supply the broadcast; for a sending backend the closure is never called:

​Error Handling

SignerError::BroadcastUnconfirmed { provider_tx_id, idempotency_key, transaction_signature, .. } (from Crossmint, Fordefi native auto, or a failing sign_and_send closure) means the transaction may have landed. Do not retry blindly: reconcile provider_tx_id or transaction_signature first, or resend only the byte-identical transaction. Exhaustive matches on SignerError need this arm. See the security model for what each signing shape guarantees.

​Adding Custom Signers

See the Adding Signers guide to integrate additional key management services.