> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Security

> Authority custody, key management, signing infrastructure, RPC credentials, monitoring, reconciliation, and address checks for a mainnet application.

## Authority Custody

An issued asset has authorities (mint, freeze, pause, metadata, and any
delegate), and losing one can be unrecoverable. Before mainnet, check that:

- No authority is a single hot key on a single machine.
- Each authority is held by the smallest party that needs it, rather than one
  key holding everything. See
  [program and authority design](/developers/docs/tokenization/design/program-and-authority-design).
- Someone other than the original engineer can run a recovery, and that path
  has been rehearsed.

## Key Management

- **Never expose private keys in frontend code.** Use backend signing, hardware
  wallets, multisignature wallets, or key management services.
- **Separate hot and cold wallets.** Hot wallet for operations, cold for
  treasury.
- **Back up all production keys.** Store encrypted backups in multiple secure
  locations. A key lost without a backup cannot be recovered.
- **Use different keys for devnet and mainnet.** Your devnet keys shouldn't be
  your mainnet keys. Use environment-based configuration to ensure the right
  keys load for each network.

## Signing Infrastructure

For production backend signing, use [Keychain](/developers/docs/tools/keychain), a unified
signing library that abstracts multiple key management backends through a single
interface: Memory, Vault, Privy, Turnkey, AWS KMS, Fireblocks, GCP KMS, CDP,
Para, Dfns, Crossmint, Openfort, Utila, and Fordefi, plus an opt-in Ledger
hardware backend in Rust. This lets you develop locally with in-memory keys,
then swap to production-grade backends without changing application code.

Not sure which backend fits? See
[Choosing a backend](/developers/docs/tools/keychain/choosing-a-backend). Keychain is
available for [Rust](https://crates.io/crates/solana-keychain),
[TypeScript](https://www.npmjs.com/package/@solana/keychain),
[Python](https://pypi.org/project/solana-keychain/), and
[Go](https://pkg.go.dev/github.com/solana-foundation/solana-keychain/go/core/v2).

## RPC Security

Treat RPC endpoints like API keys—don't expose them in frontend code where they
can be extracted and abused. Use a backend proxy or environment variables that
aren't bundled into client code.

- [QuickNode: Endpoint Security Best Practices](https://www.quicknode.com/guides/quicknode-products/endpoint-security/endpoint-security-best-practices)
- [Helius: Protect Your Solana API Keys: Security Best Practices](https://www.helius.dev/docs/rpc/protect-your-keys)

## Monitoring

Track these metrics in production:

| Metric                   | Why                    |
| ------------------------ | ---------------------- |
| Transaction success rate | Detect issues early    |
| Confirmation latency     | Monitor network health |
| Priority fee spend       | Cost management        |
| RPC error rate           | Provider health        |

Set up alerts for:

- Transfers above threshold from treasury
- Failed transaction rate spikes
- Unusual recipient patterns
- RPC error rate increases

For real-time transaction monitoring at scale, see our
[Indexing Guide](/developers/docs/payments/accept-payments/indexing).

Take network figures, such as liveness history and validator counts, from
live sources rather than documentation:
[status.solana.com](https://status.solana.com) for cluster status and
incidents, [validators.app](https://www.validators.app) for the validator set
and stake distribution, [solana.com/data](https://solana.com/data) for network
activity, and the
[improvement documents](https://github.com/solana-foundation/solana-improvement-documents)
for proposed and accepted protocol changes.

## Reconciliation

Reconciliation, separately from monitoring, checks that your records match the
chain:

- Record the transaction signature and the commitment level at which you
  accepted it, for every state change that matters.
- Order your own records by slot, not by wall-clock time.
- Reconcile against the chain rather than against your own optimistic writes,
  and against a custodian's view where one holds the asset. See
  [custody integration](/developers/docs/tokenization/custody/custody-integration).
- Alert on transactions that were sent and never confirmed, which leave your
  records and the chain out of step.

## Security Programs

- **[STRIDE](https://stride.asymmetric.re)** (Solana Trust, Resilience and
  Infrastructure for DeFi Enterprises): security assessments of Solana
  protocols, with findings published, run by Asymmetric Research with the
  Solana Foundation. An assessment covers a protocol rather than an issuer's
  mint, so it is relevant to the venues an asset composes with.
- **SIRN** (Solana Incident Response Network): security firms that coordinate
  the response to active incidents.

Both are described in the
[Solana ecosystem security announcement](https://solana.com/news/solana-ecosystem-security).

## Verify Addresses

Every token and program has exactly one correct address on mainnet. Spoofed
tokens mimicking USDC or other stablecoins are common—they'll have the same name
and symbol but a different mint. Your application should hardcode or allowlist
the mint addresses (based on your requirements), never accept them dynamically
from untrusted sources.

**Environment-based configuration:** Devnet and Mainnet often use completely
different token mints. Set up your application config to load the correct
addresses per environment—don't hardcode mainnet addresses and forget to swap
them during testing, or worse, ship devnet addresses to production.

Some common stablecoin mints are:

| Token | Issuer             | Mint Address                                   |
| ----- | ------------------ | ---------------------------------------------- |
| USDC  | Circle             | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` |
| USDT  | Tether             | `Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB` |
| PYUSD | Paxos (for PayPal) | `2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo` |
| USDG  | Paxos              | `2u1tszSeqZ3qBWF3uNGPFc8TzMk2tdiwknnRMWGWjGWH` |

Confirm each against the issuer's own published address before use.

Program addresses matter too. Sending instructions to the wrong program will
fail—or worse, result in irreversible loss of funds. The Token Program addresses
are:

| Program            | Address                                       |
| ------------------ | --------------------------------------------- |
| Token Program      | `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` |
| Token-2022 Program | `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb` |

Allowlisting the right addresses protects against spoofed tokens, but it does
not protect against sending to the wrong _kind_ of account. A recipient address
can be a wallet, a token account, a mint, or a program, and each requires
different handling. Native SOL sent to anything other than a wallet leaves the
sender's control (lost for a program; for a Token-2022 mint, recoverable only
by its mint authority; for a token account, recoverable only by the account
owner), with no failed transaction to warn the user.

<Warning>
  **Validate recipients before sending**

  Classify every recipient address before signing a transfer. See [Verify
  Address](/developers/docs/payments/send-payments/verify-address) for the full decision
  tree and reference code that distinguishes wallets, token accounts, mints, and
  programs.
</Warning>
