Index of every page on this site: llms.txt
All skills
Run it yourself

Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my Solana program", "deploy to devnet", "send a v1 transaction", "support larger transactions", "fix maxSupportedTransactionVersion", or "explain Solana concepts" (rent, accounts, PDAs, CPIs). Also for program architecture (state layout, compute units, throughput, naming), quick on-chain lookups via public RPC + curl, gasless or sponsored-fee transactions (Kora), server-side signing with KMS/Turnkey/Privy/Fireblocks (Solana Keychain), and issuing stablecoins or allowlisted tokens (Mosaic). Covers wallets, Anchor/Pinocchio, Codama clients, Surfpool/LiteSVM/Mollusk testing, security review, and v1 transactions (SIMD-0385). Prefers @solana/kit 8 plugin clients building transaction v1 by default, @solana/kit-plugin-wallet + @solana/react for wallets, web3.js v3 as the legacy migration target, and Surfpool for local networks.

Use this Skill: https://skilld.dev/gh/solana-foundation/solana-dev-skill/solana-dev

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceskeychain.md

≈2.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Solana Keychain

Solana Keychain is a Solana Foundation library that gives you one signing interface across key-management backends: AWS KMS, GCP KMS, HashiCorp Vault, Privy, Turnkey, Fireblocks and others. It ships for TypeScript, Rust, Python and Go, at parity. The backend is chosen by config, so you can develop with an in-memory key and switch to a KMS or MPC custodian without rewriting call sites. All four SDKs are audited by OtterSec; the audit covers specific commits, listed in AUDIT_STATUS.md.

Contents

When to use Keychain

Use Keychain for server-side signing: backend services, bots, AI agents with managed wallets, treasury and custodial apps, fee payers (including Kora nodes), and apps provisioning wallets for their users. It keeps raw keypair files off servers.

Keychain checks the signing hop, not the transaction. It does no simulation, content check or policy enforcement. Validate in your app (and simulate before signing, per the skill's guardrails), or use the provider's policy engine.

Packages

Package Version Purpose
solana-keychain (crates.io, PyPI) 2.0.0 Rust crate with one feature per backend; Python package with extras
@solana/keychain 2.0.0 Umbrella: createKeychainSigner(config) plus all backend factories (createPrivySigner, …)
@solana/keychain-core 2.0.0 Interfaces, SignerErrorCode, capability guards, signAndSendTransaction
@solana/keychain-<backend> 2.0.0 One package per backend (-aws-kms, -vault, -turnkey, …). Install only the one you use
@solana/keychain-kit-plugin 2.0.0 keychainSigner, keychainPayer, keychainIdentity Kit client plugins. Peer @solana/kit >=8.1.0

Every TypeScript signer except Crossmint and Fordefi native mode is a Kit TransactionPartialSigner. It signs transaction v1 (Fireblocks useProgramCall: true is the exception: legacy and v0 only).

Kit plugin client (TypeScript)

pnpm add @solana/keychain-kit-plugin @solana/kit @solana/kit-plugin-rpc
import { createClient, lamports } from '@solana/kit';
import { solanaRpc } from '@solana/kit-plugin-rpc';
import { keychainSigner } from '@solana/keychain-kit-plugin';

const rpcUrl = 'https://api.devnet.solana.com';
const client = await createClient()
  .use(keychainSigner({
    backend: 'aws-kms',
    keyId: process.env.KMS_KEY_ID!,
    publicKey: process.env.KMS_PUBLIC_KEY!,  // base58 address of the KMS key
    region: 'us-east-1',
  }))
  .use(solanaRpc({ rpcUrl, transactionConfig: { version: 1, priorityFeeLamports: lamports(5_000n) } }));

await client.sendTransaction([instruction]);
  • The signer plugin is async and must come before the RPC plugin, the same as every Kit signer plugin. await the final client.
  • keychainSigner sets payer and identity to the same signer. keychainPayer and keychainIdentity set one role each and can use different backends, e.g. a KMS fee payer with a Turnkey authority.
  • Each plugin creates a new signer when it is applied. To share one signer across clients, create it once and install it with the standard signer plugin: createClient().use(signer(await createKeychainSigner(config))).
  • Call await client.payer.isAvailable() as a health check before relying on a remote backend.
  • Config is a tagged union on backend: memory, vault, aws-kms, gcp-kms, privy, turnkey, fireblocks, cdp, crossmint, dfns, openfort, para, utila, fordefi. The fields for each backend are listed in the TypeScript guide.

Rust, Python, Go

  • Rust: cargo add solana-keychain, with default-features = false plus the backend features you need. Pick exactly one of sdk-v2 (default), sdk-v3 or sdk-v4. Transaction v1 needs sdk-v4. Construct with Signer::from_* (e.g. Signer::from_aws_kms(...)) and reach the capability via as_transaction_signer().
  • Python: pip install "solana-keychain[aws-kms]" (extras for backends that need a provider SDK; memory, vault and para need none). Built on solders; unified factory create_keychain_signer(backend, config).
  • Go: per-backend modules under github.com/solana-foundation/solana-keychain/go/signers/<backend>/v2, built on solana-go v2.

Gotchas

  • Crossmint and Fordefi native mode can't be a client payer or identity. They rewrite or broadcast server-side, and the Kit plugins reject them at compile time and at runtime (SIGNER_CONFIG_ERROR). Create them with createKeychainSigner() instead:
    • Crossmint and Fordefi native auto (chain set, pushMode omitted or 'auto') are sending signers. Send with signAndSendTransactionMessageWithSigners() from @solana/signers.
    • Fordefi native manual (pushMode: 'manual') is a modifying signer. modifyAndSignTransactions() returns a rewritten transaction; broadcast that one yourself, never the one you passed in.
  • SIGNER_BROADCAST_UNCONFIRMED means the transaction may have landed. Reconcile with the provider before retrying (providerMayHaveAccepted(error) from @solana/keychain-core). Resending the byte-identical transaction is safe. A rebuilt transaction with a new blockhash is a second transfer.
  • Not every backend signs messages. Utila and Crossmint have no signMessages, and CDP signs UTF-8 messages only. Narrow with isSolanaMessageSigner before calling it.
  • Swapping backends changes call sites only when the shape changes. Moving to or from Crossmint or Fordefi native mode changes the capability (sending or modifying signer instead of partial signer). Every other swap is config-only.
  • Key rotation means a new address. The key is the address, so plan rotation as a migration of authorities and funds.

Production rules

  • Separate hot signers (automated, low balance) from cold signers (treasury, MPC or HSM with approvals), and use distinct keys per environment.
  • Grant least privilege. AWS KMS needs only kms:Sign, kms:DescribeKey and kms:GetPublicKey on the specific key. Prefer IAM roles over static credentials.
  • Load provider secrets from a secret manager or env vars. Never hard-code or commit them, and never log key material.
  • Retry sign-only failures with backoff. Don't blindly retry backends that broadcast (see SIGNER_BROADCAST_UNCONFIRMED).
  • Monitor signing latency and failures, and turn on provider-side audit logs.
  • Python and Go cannot zeroize key buffers, so treat process memory as sensitive with the memory backend. In Rust, never enable the unsafe-debug feature in production.

Full list: production best practices.

Full documentation

Every page is served as Markdown. Fetch the .md URL for details beyond this file.

Topic URL
Overview https://solana.com/docs/tools/keychain.md
TypeScript (per-backend config, Kit client, capabilities) https://solana.com/docs/tools/keychain/getting-started/typescript.md
Rust https://solana.com/docs/tools/keychain/getting-started/rust.md
Python https://solana.com/docs/tools/keychain/getting-started/python.md
Go https://solana.com/docs/tools/keychain/getting-started/go.md
Choosing a backend https://solana.com/docs/tools/keychain/choosing-a-backend.md
Production best practices https://solana.com/docs/tools/keychain/production-best-practices.md
Signing in production (concepts) https://solana.com/docs/core/transactions/signing-in-production.md
Adding a backend https://solana.com/docs/tools/keychain/adding-signers.md
Source https://github.com/solana-foundation/solana-keychain

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning18d5 checks · Risk SAFE
  • Gen Agent Trust Hub19d

    This skill is a legitimate and comprehensive developer resource for Solana blockchain development. It identifies and mitigates common security risks through explicit instructions on handling untrusted on-chain data and enforces transaction safety via user-review guardrails. All external dependencies and tool installations originate from trusted, official Solana ecosystem providers.

  • Socket18d

    No alerts

  • Snyk19d

    Risk: LOW · No issues

  • Runlayer8mo

    3/15 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at c9da262. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 3 weeks ago
compatibility
Requires Node.js 20.18+, Rust toolchain, Solana CLI, Anchor CLI
metadata
{
  "author": "Solana Foundation",
  "version": "2.8.0"
}

README badge

README badge for solana-foundation/solana-dev-skill