Inspect account data
Every wallet, token, NFT, and smart contract on Solana is just an account with the same core structure. Today you’ll inspect them directly from the CLI and see what’s really stored on-chain.
Inspect account data
The Scenario
You’ve been sending SOL back and forth, signing transactions, and watching confirmations roll in. But every time you’ve interacted with the Solana network, something was happening behind the scenes that you haven’t looked at closely yet: the accounts themselves were changing. Balances shifted, ownership was asserted, and data was stored in ways you haven’t directly examined.
In traditional web development, you’d open a database GUI or fire off a SQL query to see what’s actually stored. On Solana, you can do something similar. Every piece of state on the network lives inside an account, and every account has the same basic structure you can inspect right from your terminal. Today, you’re going to look under the hood.
The Challenge
Use the Solana CLI to inspect account data on devnet. You’ll examine your own wallet account, compare it to a program account, and start to see how Solana’s account model organizes everything on-chain.
What You’ll Need
- A terminal with the Solana CLI installed
- Your devnet wallet keypair (from earlier days in this challenge)
- A connection to Solana devnet
Steps
- First, make sure your CLI is pointed at devnet and confirm your wallet address:
solana config set --url https://api.devnet.solana.com
solana address
Copy the address that’s printed. This is the public key of your wallet account.
- If your wallet is empty, give yourself some devnet SOL to work with:
solana airdrop 2
- Now inspect your own wallet account:
solana account $(solana address)
You should see output that looks something like this:
Public Key: YourWa11etAddressHere...
Balance: 2 SOL
Owner: 11111111111111111111111111111111
Executable: false
Rent Epoch: 18446744073709551615
Length: 0 (0x0) bytes
Take note of each field. Your wallet is owned by the System Program (that long string of ones), it is not executable (it’s not a program), and it has 0 bytes of data (wallets don’t store custom data, just a SOL balance).
- Now compare that to a program account. Inspect the SPL Token Program:
solana account TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Notice the differences. This account has Executable: true, its owner is BPFLoader2111111111111111111111111111111111 (the program that loaded it), and the data field contains the compiled program bytecode.
- Finally, look at the System Program itself:
solana account 11111111111111111111111111111111
This is a native built-in program. It’s the only program on Solana that can create new accounts. Compare its fields to what you saw in steps 3 and 4.
- For a richer view, try inspecting your wallet account in JSON format:
solana account $(solana address) --output json
This gives you machine-readable output with the same fields: lamports, data, owner, executable, and rentEpoch. You can also paste your wallet address into the Solana Explorer to see the same information in a visual interface.
What Just Happened
You just looked at the raw building blocks of the Solana network. Every single thing on Solana, whether it’s your wallet, a token, an NFT, or a smart contract, is an account with the same five fields: lamports (the balance in the smallest unit of SOL), data (an arbitrary byte array), owner (the program that controls this account), executable (whether it’s a program or not), and rentEpoch (a legacy field no longer actively used).
This is fundamentally different from blockchains like Ethereum, where smart contracts and user wallets are separate concepts. On Solana, everything is an account. Programs are accounts with executable code. Wallets are accounts with a SOL balance and no data. Token balances, NFT metadata, game state: all accounts, all following the same structure.
The owner field is especially important. Only the owning program can modify an account’s data or deduct its lamports. Your wallet is owned by the System Program, which is why the System Program is the one that handles SOL transfers. Token accounts are owned by the Token Program, which is why only the Token Program can move tokens around. This ownership model is the foundation of security on Solana, and you’ll see it come up again and again as you build more complex programs.
Resources
Submission
Take a screenshot of the output from inspecting your wallet account and the Token Program account side by side. Submit the screenshot here.