Goal: Use Program‑Derived Addresses correctly.
Cover: Seeds and bump, PDA signing (invoke_signed), canonical seeds, authority models, ATA derivation.
Activity: Create a PDA‑owned vault and restrict writes to PDA authority.
Takeaway: “I can gate actions with PDAs instead of private keys.”
Program‑Derived Addresses (PDAs) are deterministic addresses that don’t have private keys (they’re forced off the Ed25519 curve). Your program can still “sign” for them during CPIs via invoke_signed, using the exact seeds and bump used to derive the PDA. Use PDAs to own your state, act as authorities, and create safe vaults—without ever managing secret keys on‑chain.
Pubkey::find_program_address / try_find_program_addressPublicKey.findProgramAddressSyncThese return (pda, bump); pass the same seeds + bump to the program (or re‑compute in‑program) when you need PDA signing.
invoke_signed(instruction, accounts, &[&seeds_with_bump]).