Search across all documentation pages
11 pages in this section.
How on-chain Rust differs from ordinary Rust: no_std and limited alloc, entrypoint style, Borsh, safe arithmetic, errors, and CU/size discipline - and how that maps to sBPF on Agave.
Learn Rust for Solana with 10 examples, covering program entrypoints, the no_std environment, and essential on-chain programming concepts.
Understand the Solana program environment: learn about no_std, available syscalls, alloc usage, and the CU budget for SBF compilation.
Learn how to use Borsh for deterministic, little-endian serialization of Solana instruction data and account structs. Define instruction enums and store structured state.
Prevent silent overflows in Solana programs. Learn to use Rust's checked_* and saturating_* methods for safe on-chain arithmetic.
Learn to work with Pubkey and AccountInfo in Solana Rust programs. Validate accounts, enforce signer and writable flags, and prevent privilege escalation.
Learn to handle errors in Solana programs using ProgramResult, ProgramError, and custom error enums for robust on-chain communication.
Learn best practices for writing safe, efficient, and auditable Solana programs in Rust. Prevent common exploits and optimize your on-chain code.
A single-page roundup of every highlight bullet from the 10 pages in the Rust On-Chain section, grouped by source page so you can scan all 60 takeaways without opening each article individually.