> ## 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.

# Program-derived addresses (PDAs)

> Program-derived addresses (PDAs) are deterministic addresses derived from seeds and a program ID. They have no private key; only that program can sign for them.

## In short

A PDA is an address derived from a program plus some seeds. It has no private key, so only that program can sign for it, which makes it handy for storing app state at predictable addresses.

<div className="sol-usedin not-prose" data-concept="pda">
<span className="sol-usedin-label">You've used this in:</span> [Trade settlement <span className="sol-usedin-step">Step 1</span>](/developers/docs/defi/settle-trade/try-it)
</div>

A program-derived address (PDA) is a 32-byte address derived from a program ID
and a set of seeds. It's guaranteed to be off the Ed25519 curve, so no private
key exists for it. Only the program that derived it can "sign" for it, through
[`invoke_signed`](/developers/docs/core/cpi) in a cross-program invocation (CPI).

<Frame caption="Seeds and a program ID derive an off-curve address that only the program can sign for.">
  <img className="block dark:hidden" src="/docs-assets/assets/docs/core/pda/pda-light.svg" alt="Seeds and a program ID derive an off-curve address that only the program can sign for." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/core/pda/pda.svg" alt="Seeds and a program ID derive an off-curve address that only the program can sign for." />

  <img className="block dark:hidden" src="/docs-assets/assets/docs/core/pda/pda-sm-light.svg" alt="Seeds and a program ID derive an off-curve address that only the program can sign for." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/core/pda/pda-sm.svg" alt="Seeds and a program ID derive an off-curve address that only the program can sign for." />
</Frame>

<Columns cols={2}>
  <Card title="PDA Derivation" href="/developers/docs/core/pda/pda-derivation">
    The derivation algorithm and canonical bump, with examples for different
    seed types.
  </Card>
  <Card title="PDA Accounts" href="/developers/docs/core/pda/pda-accounts">
    Creating accounts at PDAs and signing for them, with Anchor patterns.
  </Card>
</Columns>

## Key facts

- **Deterministic**: The same seeds and program ID always produce the same
  address.
- **Off-curve**: If the hash lands on the Ed25519 curve, derivation fails and
  the next bump seed is tried.

<Security title="PDA checklist">
  - Derive or verify every PDA inside the program. Don't trust an address
    because the caller passed it in the right position.
  - Use the canonical bump, stored at creation. Never take a bump from
    instruction data.
  - Use fixed-length seeds or separators so two seed sets can't produce the
    same address.
  - Put the user, pool, or mint in the seeds of any PDA that signs for funds.

  See [PDA Derivation](/developers/docs/core/pda/pda-derivation) for each rule in
  detail.
</Security>

## When to use PDAs

- **Program signing**: Only the owning program can sign via `invoke_signed`,
  enabling programs to act as autonomous authorities.
- **User-scoped state**: Derive per-user accounts from user pubkey seeds (e.g.,
  `["user", user_pubkey]`).
- **No keypair management**: No private key to store or lose.

## Limits

| Limit                                  | Value                            | Source                                                                                                                       |
| -------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Max seeds                              | 16, including the bump (15 of your own) | [`MAX_SEEDS`](https://github.com/anza-xyz/solana-sdk/blob/clock%40v2.2.3/pubkey/src/lib.rs#L47)                              |
| Max seed length                        | 32 bytes maximum per seed        | [`MAX_SEED_LEN`](https://github.com/anza-xyz/solana-sdk/blob/clock%40v2.2.3/pubkey/src/lib.rs#L45)                           |
| Bump range                             | 0-255 (1 byte)                   | Appended as the final seed element                                                                                           |
| `create_program_address` cost          | 1,500 CUs                        | [`create_program_address_units`](https://github.com/anza-xyz/agave/blob/v3.1.8/program-runtime/src/execution_budget.rs#L200) |
| `find_program_address` worst-case cost | 1,500 entry + 1,500 x iterations | 1,500 on entry + 1,500 per failed bump                                                                                       |
| Max PDA signers per CPI                | 16                               | [`MAX_SIGNERS`](https://github.com/anza-xyz/agave/blob/v3.1.8/program-runtime/src/cpi.rs#L62)                                |
