Chapter VI · Solana authorization

Solana wallet and PDA authorization

Objective
trace is_signer
Compare
wallet and PDA
Focus
runtime 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.

account.is_signer = trueThe destination looks the same. The proof that produced it may differ.

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.

A signature authorizes the exact bytes the wallet signed, not a vague description such as "send this payment." Change any signed message byte, such as an amount, account, instruction, or blockhash, and the existing signature no longer verifies.

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.

No signature is forged. The runtime substitutes a derivation proof for a cryptographic signature within the CPI boundary.

Quick check 2

What grants a PDA signer privilege during a CPI?

Address, owner, and signer are different properties

QuestionWallet signerPDA signer
Has private key?YesNo
ProofEd25519 signatureMatching derivation
Checked duringTransaction processing`invoke_signed` CPI
AuthorizesExact transaction messageThat 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.

  1. What exact content does a wallet's Ed25519 signature authorize?
  2. Who checks that signature before program execution?
  3. Why can a PDA never provide the same kind of signature?
  4. What does `invoke_signed` prove to the runtime?
  5. Why is account ownership different from signer privilege?
Show numbered solutions
  1. The wallet signs the exact serialized message containing the header, account addresses, recent blockhash, and instructions. Changing any of those bytes invalidates the signature.

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

  3. A PDA is off the Ed25519 curve. It is not a point of the form kG and has no matching private scalar.

  4. invoke_signed proves 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.

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