Installation
Install the umbrella package or individual signers as needed:@solana/kit 8.1 or later. v1 transactions
(createTransactionMessage({ version: 1 })) are supported, except by Fireblocks
with useProgramCall: true, which accepts legacy and v0 only.
Basic Usage
Unified Factory (Recommended for apps wanting to support multiple signers)
UsecreateKeychainSigner with a discriminated config to create any backend:
Using with Transaction Messages
Every backend except Crossmint and Fordefi native mode returns aSolanaTransactionSigner, which is a Kit TransactionPartialSigner and works
with the @solana/signers partial-signer helpers below. Managed-broadcast
backends are covered in Signer Capabilities.
Sign and Send with Any Signer
signAndSendTransaction from @solana/keychain-core gets a transaction on
chain whatever the signer’s shape. Sending signers broadcast through their
provider; every other shape uses the sendTransaction you pass in (core has no
RPC dependency):
Using with a Kit Client (keychainSigner plugin)
@solana/keychain-kit-plugin installs a keychain signer directly on a
Kit client, wiring it up as the payer and
identity so you skip the manual pipe setup shown above:
createKeychainSigner,
except Crossmint and Fordefi native mode (chain set). Those backends rewrite
the transaction server-side, so they cannot act as a client payer or
identity; the plugin rejects them at compile time and at runtime. Only the
backend it dispatches to is bundled (backend packages load via dynamic
import()).
Use keychainPayer or keychainIdentity to set just one role, and mix backends
on a single client:
SolanaTransactionSigner? It is a valid Kit
TransactionPartialSigner, so you can install it with
@solana/kit-plugin-signer
instead (npm install @solana/kit-plugin-signer):
Cancellation and Unconfirmed Broadcasts
signTransactions, modifyAndSignTransactions, signAndSendTransactions, and
signMessages all accept { abortSignal } as their second argument. Aborting
stops waiting; it does not undo work a provider already accepted.
On Crossmint and Fordefi native auto mode, a failure does not mean nothing
landed. When the provider may have accepted the transaction, the error code is
SignerErrorCode.BROADCAST_UNCONFIRMED ("SIGNER_BROADCAST_UNCONFIRMED").
context.providerTransactionId is set when the create was accepted, and
context.idempotencyKey carries the key derived from the message. Resending the
byte-identical transaction is safe; a rebuilt one (for example with a new
blockhash) is a new transfer. providerMayHaveAccepted(error) and
providerStatus(error) from @solana/keychain-core help classify the error.
Reconcile with the provider before retrying.
Backend Configuration
Memory
Provide exactly one ofkeyPair, privateKey, privateKeyString, or
privateKeyPath:
HashiCorp Vault
vaultAddr must use HTTPS: a plain-HTTP address throws SIGNER_CONFIG_ERROR,
even on loopback, so a local vault server -dev doesn’t work. For local
development, run vault server -dev-tls instead. It serves HTTPS on
127.0.0.1:8200 with a self-signed certificate and prints the CA file path as
VAULT_CACERT. Set vaultAddr to https://127.0.0.1:8200 and start Node with
that CA trusted:
AWS KMS
GCP KMS
Privy
Turnkey
Fireblocks
CDP (Coinbase Developer Platform)
Crossmint
signAndSendTransactions(): it has no signTransactions() or signMessages(),
and it cannot be installed with @solana/keychain-kit-plugin. The returned
signature identifies the transaction Crossmint landed.
Dfns
Openfort
Para
Utila
Utila signs transactions only; it has nosignMessages().
Fordefi
Fordefi has three signing modes, fixed at construction bychain and
pushMode. Each mode exposes exactly one transaction method, and all three sign
messages:
| Mode | Config | Type | Method |
|---|---|---|---|
| Black box | chain unset | FordefiBlackBoxSigner | signTransactions() |
| Native auto | chain set, pushMode omitted or "auto" | FordefiNativeSigner | signAndSendTransactions() |
| Native manual | chain set, pushMode: "manual" | FordefiNativeManualSigner | modifyAndSignTransactions() |
privateKeyPem, or keep it in a KMS/HSM by passing a
requestSigner.
Native auto mode (recommended for onchain use): set chain, and Fordefi
signs and broadcasts the transaction itself. Because Fordefi may replace the
blockhash or fees before signing, the signer is a Kit
TransactionSendingSigner: use it with
signAndSendTransactionMessageWithSigners, not the partial-signer flow shown
above. Native auto mode accepts only an unsigned transaction whose sole required
signer is the vault, and it cannot be used with @solana/keychain-kit-plugin.
chain and pushMode: "manual". Fordefi rewrites
the message (recent blockhash, Compute Budget fee instructions) and signs it,
but does not broadcast. modifyAndSignTransactions() returns the transaction
Fordefi signed, which replaces the one you submitted: always continue from the
returned transaction. Fordefi must be the fee payer and must sign before any
other required signer. The rewrite is not diffed, so inspect the result before
broadcasting.
chain. Fordefi signs raw bytes and does not
broadcast; you assemble and submit the transaction yourself. Use this with a
Fordefi black box vault.
Signer Capabilities
@solana/keychain-core defines one interface per Kit signer shape. Each adds
isAvailable(): Promise<boolean> to the matching @solana/signers interface:
SolanaTransactionSigner(KitTransactionPartialSigner): returns signatures for a transaction you own.SolanaModifyingSigner(KitTransactionModifyingSigner): rewrites the transaction, signs it, and returns the new transaction without broadcasting.SolanaSendingSigner(KitTransactionSendingSigner): signs and broadcasts through its provider.SolanaMessageSigner(KitMessagePartialSigner): signs offchain messages. This is separate from the transaction shapes.
SolanaSigner is the union of the three transaction shapes. Each factory’s
return type names its backend’s exact shape. When the config is only known at
runtime, narrow with isSolanaTransactionSigner, isSolanaModifyingSigner,
isSolanaSendingSigner, or isSolanaMessageSigner. signerCapabilities(signer)
reports all four at once.
| Backend | Shape |
|---|---|
| memory, vault, aws-kms, gcp-kms, privy, turnkey, fireblocks, cdp, dfns, para, openfort, fordefi (black box) | SolanaTransactionSigner & SolanaMessageSigner |
| utila | SolanaTransactionSigner (no message signing) |
| fordefi (native manual) | SolanaModifyingSigner & SolanaMessageSigner |
| fordefi (native auto) | SolanaSendingSigner & SolanaMessageSigner |
| crossmint | SolanaSendingSigner (no message signing) |