DEV Community

Gopichand
Gopichand

Posted on

Week 2 on Solana: When the "Public Database" Finally Clicked

I'm doing the 100 Days of Solana challenge by MLH, and Week 2 just changed how I think about blockchain data entirely.

Week 1 was about identity — generating keypairs, understanding wallets, getting devnet SOL. That part felt familiar, like setting up a dev environment.

Week 2 was different. Week 2 was about reading the chain — and that's where the mental model shift actually happened.

What I expected vs what I got

I expected reading blockchain data to feel like calling a mysterious, slow, complex API. Something with heavy setup, authentication tokens, and confusing docs.

What I got was this:

const { value: lamports } = await rpc.getBalance(address).send();
const sol = Number(lamports) / 1_000_000_000;
Enter fullscreen mode Exit fullscreen mode

No API key. No login. No permissions. Anyone can call this for any address, anytime.

In Web2, if I want someone's account balance, I need DB credentials, role permissions, and middleware. On Solana, I just ask. Publicly. That's not a flaw — that's the design.

The moment it clicked

Day 11 was a conceptual challenge: compare Solana accounts to Web2 databases. I ran:

solana account $(solana address)
Enter fullscreen mode Exit fullscreen mode

Output:
Public Key: AWKYsCGBcfGLSz6QpmXzRn7EJ9fRhiJsjYSLDV3c9L9y
Balance: 2.5 SOL
Owner: 11111111111111111111111111111111
Executable: false

Then I ran:

solana account TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Enter fullscreen mode Exit fullscreen mode

Output:
Owner: BPFLoaderUpgradeab1e11111111111111111111111
Executable: true
Length: 36 bytes

Same command. Same account model. One is a wallet holding SOL. The other is the Token Program — compiled code that manages every SPL token on Solana. Both are just "accounts."

That's when "everything is an account" stopped being a slogan and started being a mental model.

The devnet vs mainnet surprise

Day 12 was the most satisfying. One script. Two RPC connections:

const devnetRpc  = createSolanaRpc(devnet("https://api.devnet.solana.com"));
const mainnetRpc = createSolanaRpc(mainnet("https://api.mainnet-beta.solana.com"));
Enter fullscreen mode Exit fullscreen mode

Same address. Same getBalance call. Completely different output:
DEVNET → 0.001159846 SOL | Slot: 459,981,397
MAINNET → 0.069875097 SOL | Slot: 417,486,413

Different balances. Different slots. Completely different transaction histories. I already knew they were separate — but seeing it side by side in the terminal made it real in a way docs never did.

What's still confusing

PDAs — Program Derived Addresses. I understand they're derived from a program + seed with no private key, so only the program can sign for them. But I haven't used one yet. I can describe them but I can't feel them. That's my Week 3 target.

What I'd tell Week-1-me

Stop thinking in tables and rows. Start thinking in accounts and owners. Every piece of state on Solana is an account. Every account has an owner program. Only that program can modify it. That's not a restriction — that's what makes the system trustless.

Also: devnet is your playground. Break things there first.


If you're also doing #100DaysOfSolana, drop your DEV.to link below — I want to read what clicked for you.

→ My code: https://github.com/gopichandchalla16/100-days-of-solana

Top comments (0)