Sol.College

Learn by example

Each lesson explains one concept, then walks through real excerpts from projects in the stack, pinned to a commit.

Program Derived Addresses (PDAs)

A PDA is an address derived from a program ID plus a list of seeds, deliberately chosen so that it has no private key. Only the deriving program can sign for it (via invo…

6 excerpts from tokengator, poe-solana, w3-solana

Cross-Program Invocations (CPIs)

A CPI is one program calling an instruction on another program, such as the Token Program or System Program. The caller passes the accounts the callee needs. When a PDA m…

6 excerpts from valhalla, kryptpay-solana-contract, poe-solana

SPL Tokens: mints, accounts and transfers

Fungible tokens on Solana are accounts owned by the Token Program. A mint account defines supply and decimals, and a token account holds a balance of one mint for one own…

6 excerpts from valhalla, kryptpay-solana-contract, poe-solana

Token-2022 (Token Extensions)

Token-2022 is a separate token program with the same core layout as the original Token Program, plus optional extensions configured when the mint is created: transfer fee…

3 excerpts from valhalla, tokengator, epoch

Escrow patterns

An escrow holds assets in a program-controlled account, usually a token account whose authority is a PDA, until agreed conditions are met. The usual lifecycle is make (de…

1 excerpts from peer-pay

NFTs with Metaplex

Most Solana NFTs follow Metaplex standards. Token Metadata attaches a metadata account to a supply-1 mint, and Metaplex Core is a newer single-account asset standard. Cod…

2 excerpts from gree, valhalla

Building and sending transactions from a client

A transaction bundles instructions, a recent blockhash and signatures. Clients fetch a recent blockhash, add instructions (often including compute-budget instructions for…

6 excerpts from tokengator, valhalla, poe-solana

Anchor account constraints

In Anchor, the #[derive(Accounts)] struct is where most security lives. Constraints such as init, mut, has_one, seeds/bump, constraint = ... and close are checked before …

6 excerpts from valhalla, Predix, peer-pay