I spent the past month building on Solana. Sent transfers. Decoded raw bytes. Inspected accounts until my terminal turned into a wall of hex.
Along the way, I had to unlearn some Web2 habits.
One model. No exceptions.
Your wallet is an account. The program that moves your SOL is an account. The token you just bought? Also an account.
Solana doesn't have special types. Every account has the same five fields:
- Lamports (SOL balance, 1 SOL = 1 billion lamports)
- Data (raw bytes. empty for wallets)
- Owner (the program that can modify this account)
- Executable (true if this account holds code)
- Rent epoch (ignore this. it's deprecated)
Run solana account on any address. Same structure every time.
$ solana account 8CtdyqtzBd597eDz9PTZHuuT62vvLc6YXdXjVkHnboqj
Public Key: 8CtdyqtzBd597eDz9PTZHuuT62vvLc6YXdXjVkHnboqj
Balance: 3.93896 SOL
Owner: 11111111111111111111111111111111
Executable: false
Rent Epoch: 18446744073709551615
Who owns what matters
The owner field determines control.
My wallet is owned by the System Program (111...111). Only the System Program can deduct SOL from it. I sign. The program executes.
A token account is owned by the Token Program. Only that program can move tokens.
In Web2, your app authorizes changes. On Solana, the program that owns the account authorizes changes. Your signature proves you approved it.
Programs have no memory
This was the hardest shift.
In Node.js, my app holds variables in memory. App and state live together.
On Solana, a program account holds code. Nothing else. No variables. No state.
State lives in separate data accounts.
A program reads from its data accounts, does math, writes back. It never stores anything itself.
// In Web2, you store state in variables
let counter = 5;
counter = counter + 1;
// On Solana, you read from a data account, modify, write back
const dataAccount = await fetchAccount(counterAddress);
let counter = dataAccount.value;
counter = counter + 1;
await writeAccount(counterAddress, counter);
Why? Update the program without losing data. One program, many data accounts. Programs stay pure.
The Token Program is 36 bytes of code. The mint accounts it controls? Separate accounts. Owned by the Token Program. Code in one place. State in another.
$ solana account TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Public Key: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Owner: BPFLoaderUpgradeab1e11111111111111111111111
Executable: true
Length: 36 bytes
Rent isn't rent
Every account needs a minimum SOL balance based on data size. For a basic wallet with zero data: ~0.00089 SOL.
Pay once. Store forever. Close the account, get your SOL back.
It's a deposit. Not monthly rent.
You already know this
A file has a name, contents, and permissions.
A Solana account has an address, data, and an owner.
Same pattern. Different environment.
Took me a few weeks to stop overcomplicating it.
Top comments (0)