Chapter VI · Solana authorization
Solana wallet and PDA authorization
A wallet and a PDA can both receive signer privilege. Let's trace how each one proves its authority.
What signer privilege means
When your Solana program receives an account, it can check whether that account has signer privilege for the current instruction. Anchor's Signer constraint requires it.
A keypair gets this privilege from an Ed25519 signature. A PDA gets it from runtime derivation during invoke_signed.
is_signer records authority for this instruction. It does not imply that the address has a private key.Wallet signatures
When a client builds a transaction, the message contains account keys, a recent blockhash, and compiled instructions. Each required signer signs those serialized bytes.
Client builds the exact transaction message bytes.
Wallet signs those bytes with its Ed25519 private key.
Transaction carries the message and its signatures.
Runtime verifies each signature against the matching public key.
Program receives the verified account with signer privilege.
The runtime verifies transaction signatures before program execution and supplies the resulting account privileges.
A program may explicitly verify other signed data for a special protocol, but ordinary transaction-signer checks do not happen inside each program.
Quick check 1
Who verifies a normal transaction signature before your program runs?
PDA authorization with invoke_signed
A PDA is off-curve, so it has no private scalar and cannot produce an Ed25519 signature. When your program needs the PDA to authorize a CPI, it uses invoke_signed instead:
Program builds a child instruction for a CPI.
Program supplies the PDA's seeds and bump to `invoke_signed`.
Runtime combines those values with the calling program's ID.
Runtime re-derives the PDA and checks that the address matches.
Callee receives that PDA with signer privilege for the CPI.
Quick check 2
What grants a PDA signer privilege during a CPI?
Address, owner, and signer are different properties
| Question | Wallet signer | PDA signer |
|---|---|---|
| Has private key? | Yes | No |
| Proof | Ed25519 signature | Matching derivation |
| Checked during | Transaction processing | `invoke_signed` CPI |
| Authorizes | Exact transaction message | That child instruction |
An account's owner names the program allowed to modify its data. Signer privilege identifies who approved the current instruction. Neither implies the other. A program-owned account is not automatically a signer, and a signer does not need to own the accounts it authorizes.
Check your understanding
Try to answer each question before you open the solutions.
- What exact content does a wallet's Ed25519 signature authorize?
- Who checks that signature before program execution?
- Why can a PDA never provide the same kind of signature?
- What does `invoke_signed` prove to the runtime?
- Why is account ownership different from signer privilege?
Show numbered solutions
-
The wallet signs the exact serialized message containing the header, account addresses, recent blockhash, and instructions. Changing any of those bytes invalidates the signature.
-
The runtime verifies ordinary transaction signatures before executing instructions. Programs receive account metadata with signer privileges already set. A program may separately verify signed data when a special protocol requires it.
-
A PDA is off the Ed25519 curve. It is not a point of the form kG and has no matching private scalar.
-
invoke_signedproves that the seeds, bump, and calling program ID derive the PDA used by the child instruction. A match grants signer privilege for the CPI. No cryptographic signature is created. -
Address identifies the account. Ownership identifies the program allowed to modify its data. Signer privilege identifies who approved the instruction. An owned account is not automatically a signer, and a signer may authorize accounts it does not own.
Primary reading
- Solana transaction structure documents the serialized message and Ed25519 signature array.
- Solana CPI documentation explains privilege propagation and `invoke_signed`.
- Solana PDA documentation explains off-curve derivation and the absence of private keys.