What Is Program in Solana?
A program on Solana is executable code stored in an on-chain account (marked executable: true). Programs process instructions sent in transactions, reading and writing data to accounts they own. Solana programs are sometimes called “smart contracts” in other blockchain ecosystems.
Native vs deployed programs
Native programs (System Program, Vote Program, Stake Program, Compute Budget Program) are built into the Solana runtime. Deployed programs are uploaded by developers using the BPF Loader and can be written in Rust, C, or any language that compiles to SBF (Solana Bytecode Format).
Program accounts
A deployed program consists of two accounts: the program account (executable, contains a pointer) and the program data account (stores the actual bytecode). This separation allows programs to be upgraded without changing their address.
Upgradeable programs
Programs deployed with the BPF Loader Upgradeable can be updated by their upgrade authority. The authority can also make a program immutable by revoking the upgrade authority, preventing future changes.
Statelessness
Solana programs are stateless. They do not store data in their own account — they read from and write to separate data accounts passed as instruction inputs. This enables parallel execution because the runtime can identify which accounts a transaction touches before execution.
FAQ
How much does it cost to deploy a program? The cost depends on the program’s compiled binary size. Each byte of program data requires rent-exempt lamports. A typical program binary (100–500 KiB) costs 1–5 SOL to deploy.
Can a program call another program? Yes, via Cross-Program Invocation (CPI). The calling program invokes another program’s instruction within the same transaction.
What languages can I write programs in? Rust is the primary language. The Anchor framework provides a higher-level Rust DSL. C is supported but rarely used. Higher-level languages require compilation to SBF.
Updated: