Independent discussion of crypto, wallets, cards and markets
Forum Home > Crypto Trading & Markets > Solana > solana program derived addresses: why accounts look the way they do
solana program derived addresses: why accounts look the way they do70 replies · 2,870 views
Thread ToolsShow Printable Version · Subscribe to this Thread · Search Thread
Where to open an account: Open a Trustee account.

Program derived addresses: why accounts look the way they do

Half the addresses on Solana are not owned by a keypair anyone holds. They are

program derived addresses - accounts whose address is computed from seeds and

a program, not from a private key. Once you see why they exist, the account

model stops looking weird.

The problem PDAs solve

Normal accounts need a keypair to sign. Programs cannot hold private keys

safely - there is no place to store one that an attacker cannot reach. So how

does a program own state? It derives an address from public inputs: a list of

seeds plus the program's own ID. The address is deterministic, anyone can

compute it, and no keypair exists for it. The program is allowed to sign for

it during execution because the derivation is verifiable on the spot.

What you actually see

A PDA looks like any other address, but it is owned by the program that

derived it. That ownership is the point:

  • User positions are PDAs seeded with the user's wallet, so one user's

position is one canonical address, reproducible by anyone.

  • Global state - pools, configs, mints - lives in PDAs seeded with constants,

so there is exactly one and the program controls it.

  • Vault and escrow accounts are PDAs the program controls, so funds move only

through program logic, not through a human signature.

Because the program ID is part of the derivation, two programs cannot collide

on the same derived space. Seeds alone do not identify a PDA; seeds plus

program ID do.

The bugs this class of address creates

PDAs are convenient and they are a footgun. Three failure modes show up

constantly:

  1. Missing or misordered seeds. Derive with the wrong seed list and you get a

valid address that owns nothing. The transaction fails or, worse, reads

empty state and produces a wrong answer.

  1. Forgetting the bump. The derivation appends a bump byte to prove the

address is off the signing curve. Hardcode a stale bump and your code

disagrees with programs that re-derive with the current one.

  1. Assuming uniqueness across programs. Reuse a seed scheme in a second

program and you derive different addresses than you expect, because the

program ID changed under you.

The takeaway

When you read an account explorer, ask one question first: who owns this

address - a keypair or a program? If it is a program, find the seed scheme

before you conclude anything about the state. And if you write programs,

derive every PDA through the same helper and never hardcode addresses or

bumps by hand.

Thread Statistics70 replies · 2,870 views