Core Concepts

Learn about accounts, programs, instructions, and transactions, the foundation of every Solana application.

Accounts

Everything on Solana exists within an account, a data container on the blockchain that stores SOL and state information. Each account has a public key, which serves as its unique address. It also contains a balance measured in lamports (1 SOL equals 1,000,000,000 lamports), an owner program that defines who can modify it, and an executable flag for program accounts.

Accounts function much like files in an operating system. They hold both metadata and user-defined data.

Technical reference: Solana Docs – Accounts

Example (JSON):

{
  "pubkey": "GvHe...zMQ",
  "lamports": 2039280,
  "owner": "BPFLoader2111111111111111111111111111111111",
  "executable": false,
  "data": "<binary>",
  "rentEpoch": 312
}

Programs

Programs are on-chain executables, immutable pieces of logic written in Rust and compiled to Berkeley Packet Filter (BPF) bytecode. They do not store user data internally. Instead, they act on external accounts provided by the transaction.

For example, the SPL Token Program manages token creation, transfers, and balances using standardized methods.

Technical reference: Solana Docs – Programs


Instructions

An instruction tells a program what operation to perform and which accounts to use. Each instruction includes the program ID, a list of accounts to read or modify, and a data payload that defines the operation.

Technical reference: Solana Docs – Instructions

Example (Python):

from solana.transaction import TransactionInstruction
from solders.pubkey import Pubkey

instruction = TransactionInstruction(
   keys=[
      {"pubkey": Pubkey("SenderPubkey"), "is_signer": True, "is_writable": True},
      {"pubkey": Pubkey("ReceiverPubkey"), "is_signer": False, "is_writable": True},
   ],
   program_id=Pubkey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),
   data=b'\x03'  # transfer operation
)

Transactions

A transaction is a signed container that groups one or more instructions. When sent to the network, it executes atomically, meaning either every instruction succeeds or none of them are applied.

Technical reference: Solana Docs – Transactions

Example (Python):

from solana.transaction import Transaction
from solana.rpc.api import Client

client = Client("https://rpc.carbium.io")
tx = Transaction()
tx.add(instruction)
response = client.send_transaction(tx, signer)
print(response)

Putting It All Together

Accounts store data and SOL. Programs define the logic that operates on those accounts. Instructions describe the operations to perform. Transactions combine those operations into atomic execution units.

This modular separation of logic and data allows Solana to process thousands of transactions per second while maintaining consistency and parallelism.


Technical References