Every Solana program eventually hits the same question: where do I put my data, and how do I find it again later?
Programs are stateless, so a program's data lives in separate accounts, each at an address. The moment you store something, you owe an answer to a problem databases tend to hide from you: what address does this live at, and how does the program find it again tomorrow? Program Derived Addresses are Solana's answer. The name scares people off, but the idea is mostly "an address you compute instead of remember, that only your program can control."
The problem, in code
Say each user gets a counter account. The normal way to make an account is to generate a fresh keypair and store data at its public key:
import { Keypair } from "@solana/web3.js";







