{
  "schema_version": 1,
  "title": "Solana wallet and PDA authorization",
  "url": "/writing/understanding-elliptic-curves/lessons/0006-solana-wallet-and-pda-authorization.html",
  "author": "Abhineet Biju",
  "text": "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 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_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. 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.",
  "headings": [
    {
      "level": 1,
      "id": null,
      "text": "Solana wallet and PDA authorization"
    },
    {
      "level": 2,
      "id": null,
      "text": "What signer privilege means"
    },
    {
      "level": 2,
      "id": null,
      "text": "Wallet signatures"
    },
    {
      "level": 3,
      "id": null,
      "text": "Quick check 1"
    },
    {
      "level": 2,
      "id": null,
      "text": "PDA authorization with invoke_signed"
    },
    {
      "level": 3,
      "id": null,
      "text": "Quick check 2"
    },
    {
      "level": 2,
      "id": null,
      "text": "Address, owner, and signer are different properties"
    },
    {
      "level": 2,
      "id": null,
      "text": "Check your understanding"
    },
    {
      "level": 3,
      "id": null,
      "text": "Primary reading"
    }
  ],
  "sections": [
    {
      "id": "privilege",
      "heading": "What signer privilege means",
      "text": "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."
    },
    {
      "id": "wallet",
      "heading": "Wallet signatures",
      "text": "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?"
    },
    {
      "id": "pda",
      "heading": "PDA authorization with invoke_signed",
      "text": "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?"
    },
    {
      "id": "compare",
      "heading": "Address, owner, and signer are different properties",
      "text": "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."
    },
    {
      "id": "close",
      "heading": "Check your understanding",
      "text": "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_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. 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."
    }
  ],
  "links": [
    {
      "label": "writing",
      "url": "/#writing"
    },
    {
      "label": "Chapter V",
      "url": "/writing/understanding-elliptic-curves/lessons/0005-signature-creation-and-verification.html"
    },
    {
      "label": "Authority map",
      "url": "/writing/understanding-elliptic-curves/reference/0003-solana-authority-map.html"
    },
    {
      "label": "Solana transaction structure",
      "url": "https://solana.com/docs/core/transactions/transaction-structure"
    },
    {
      "label": "Solana CPI documentation",
      "url": "https://solana.com/docs/core/cpi"
    },
    {
      "label": "Solana PDA documentation",
      "url": "https://solana.com/docs/core/pda"
    },
    {
      "label": "Previous: Creating and verifying signatures",
      "url": "/writing/understanding-elliptic-curves/lessons/0005-signature-creation-and-verification.html"
    },
    {
      "label": "Next: back to the guide",
      "url": "/writing/understanding-elliptic-curves/"
    }
  ]
}
