← Driving RustL6 · Accounts, Not Objects
Score 0
1/7 Find the flaw

Where does the state live?

Your agent drew a loyalty program the way it would draw a Python service: a Program object holding a members table, with methods. On Solana one box does not exist. Tap it.

the designL6·1
class LoyaltyProgram:members: Map<Pubkey, Points>award()redeem()client(wallet)callaccountaccountaccount

Tap the part that will not survive contact with reality — or press 14.

2/7 Two designs — pick one

Who pays for the bytes?

Each loyalty member needs a 64-byte account. Two ways to create it. Both are used in production. Choose for a hospitality client whose guests do not own SOL.

the designL6·2
A · the member pays for their own accountmember walletsigns + fundsPDA[member, "card"]members onboardedB · the project pays for every accountproject walletfundsPDA[member, "card"]members onboardedSOL locked as deposits0
3/7 Find the flaw

Unbounded inside a fixed box

The merchant account layout your agent proposed. Account size is fixed when the account is created. Tap the field that fails in production.

the designL6·3
account: Merchant (fixed size at creation)owner: Pubkey · 32 bytesname: [u8; 32]points_total: u64orders: Vec<Order>bump: u8bytes used of allocated

Tap the part that will not survive contact with reality — or press 15.

4/7 Find the flaw

What cannot run on-chain

Your agent’s price-check instruction, drawn as it would run on a server. Tap the step that cannot execute inside a Solana program.

the designL6·4
fetch priceover HTTPScompute feewith f64read std::timefor expirywrite resultoracle account(signed off-chain)Clock sysvarix

Tap the part that will not survive contact with reality — or press 14.

5/7 Judge the agent

Order history in one account

Your agent proposes how a merchant’s orders are stored on-chain. Judge it.

the designL6·5
merchant accountorders: 120 · 12 KBaccount size12 KB
The agent says

One account per merchant keeps reads simple: a single fetch gives you everything. I’ll realloc in 10 KiB steps when it fills, and the merchant pays the extra deposit on each growth.

6/7 Put it in order

The life of a transaction

Order the stages a Solana transaction actually goes through, from the client to committed state. Then run one.

the pipelineL6·6
tx12345
    Level 6 cleared

    What survives this level

    Postgres rowid · columnsfree to storeany code with the password writesthe server keeps time and calls APIs Solana account32-byte address → lamportsdata (sized at creation)owner (a program) · executable?deposit ≈ (bytes+128) × 6,960 programexecutable · stateless only the owner writes PDAhash(program, seeds) · no key · program signs derives + signs for outside worldenters only as a signed account oracle per transaction: 1,232 bytes · 1.4M CU · 5,000 lamports per signature · no clock, no network, no rand
    You can now say to a coding agent“For this instruction, list every account it touches, who owns each, who signs, and who paid for its bytes.”
    Added to your ledger
    Accounts, not objectsA program is stateless code; every piece of state is an account someone created, sized and paid for.
    Rent and rent-exemptionStorage is a refundable deposit of about 6,960 lamports per byte, locked for the life of the account; ask who pays.
    Account sizing and reallocFix the size at creation or plan realloc in 10 KiB steps under a 10 MiB cap; an unbounded list never lives in one account.
    Determinism: no floats, no wall clock, no networkNo network, no randomness, no std::time, floats are slow: anything from outside arrives as a signed account.
    Program-derived addresses and program-owned authorityA PDA is an address only the program can sign for; use it wherever the program, not a person, is the authority.
    Compute-unit and transaction-size limits1,232 bytes and 1.4M compute units per transaction; design accounts so the common path fits in one.
    Oracles and off-chain truthOff-chain truth enters only through someone’s signed account; name that someone and what you trust them with.

    Back to the map Next: L7 Do You Need a Token? →

    What clearing this level buys you
    “For this instruction, list every account it touches, who owns each, who signs, and who paid for its bytes.”