Inspecting Accounts & Programs
Use solana account and solana program to read on-chain state, owners, and executable bytecode metadata without writing a client.
Search across all documentation pages
Use solana account and solana program to read on-chain state, owners, and executable bytecode metadata without writing a client.
Quick-reference recipe card - copy-paste ready.
solana account <ACCOUNT_PUBKEY>
solana account <PUBKEY> --output json
solana program show <PROGRAM_ID>
solana program dump <PROGRAM_ID> program.soWhen to reach for this:
.so bytecode for size or hash comparison.# Inspect the System Program (native program)
solana program show 11111111111111111111111111111111
# Inspect a wallet or data account
solana account "$(solana address)"
# JSON for scripting
solana account "$(solana address)" --output json-compact | jq '.account.lamports, .account.owner'
# Dump program binary from devnet/mainnet
solana program dump TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA spl_token.so
ls -la spl_token.soWhat this demonstrates:
program show lists owner loader, programdata address, authority, and last deploy slot.account prints lamports, owner, executable flag, and raw data length.program dump writes the on-chain ELF to disk for inspection or verification.executable owned by a loader (BPF Loader v3 for upgradeable programs).solana account fetches via getAccountInfo RPC under the hood.| Field | Meaning |
|---|---|
| Lamports | Spendable balance + rent-exempt reserve |
| Owner | Program allowed to write data |
| Executable | true for deployed programs |
| Data Length | Byte size of account data |
| Allocated | Total allocated space (may exceed data length) |
# Show only program metadata without dumping
solana program show <PROGRAM_ID> --programs
# Multiple accounts in one RPC round-trip via client libraries
# CLI inspects one at a time - use @solana/kit for batchesspl-token layout tools.solana config get before debugging missing accounts.ProgramData Address from program show.--output json and parse selectively; avoid piping raw binary to terminal.finalized commitment for authority-sensitive checks.| Alternative | Use When | Don't Use When |
|---|---|---|
| Solana Explorer / Solscan | Rich UI and token decoding | Scripting or offline workflows |
@solana/kit getAccountInfo | Batch reads in TypeScript apps | One-off terminal inspection |
anchor account | Anchor IDL-typed decode | Native programs without IDL |
spl-token account-info | SPL token account layout | Non-token accounts |
The program pubkey permitted to mutate account data. Only the owner program can debit lamports or resize data per the runtime rules.
PDAs appear as pubkeys off the Ed25519 curve. The CLI does not label PDAs - derive expected addresses client-side and compare.
System-owned wallet accounts hold lamports only - no custom data payload.
No - closed accounts are removed from chain state. Keep transaction signatures to prove historical existence.
Allocated is reserved space; data length is bytes currently used. Programs may realloc between them.
Use anchor account <Type> <PUBKEY> in Anchor projects, or fetch raw bytes and deserialize with your IDL client.
Dump writes executable ELF bytes only. Use program show for authority, slot, and loader metadata.
Use spl-token display <MINT> for human-readable mint fields, or solana account for raw bytes.
Yes - point solana config at http://127.0.0.1:8899 and use the same commands.
JSON includes base64 data fields suitable for scripts; text output truncates large data for readability.
program show validates after deploygetAccountInfo detailsStack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 16, 2026