This document covers the fundamental concepts of Solana blockchain development.
- Mainnet: The main Solana network where real transactions occur
- Devnet: Development network for testing with free SOL tokens
- Testnet: Test network for final testing before mainnet deployment
- Token Account: An account that holds specific token balances
- Mint Account: The account that controls token creation and supply
- Token 2022: Upgraded token standard with enhanced features
- Associated Token Account (ATA):
- A unique account created for each token type a user owns
- Requires SOL for rent payment
- Can be closed to reclaim rent when no longer needed
- Addresses without private keys
- Used for:
- Program authority over other accounts
- Signing transactions
- Data storage
- Deterministically generated from seeds
- Lamports: Smallest unit of SOL (like wei in Ethereum)
- 1 SOL = 1,000,000,000 lamports
- Priority Fees:
- Additional SOL paid to validators
- Higher fees = faster transaction processing
- Dynamic based on network congestion
- SOL payment required for storing data/code on-chain
- Based on account size
- Can be reclaimed by closing the account
- Rent Exemption:
- Pay two years of rent upfront to become rent-exempt
- Account can be used indefinitely without further rent payments
- Minimum rent threshold depends on account size
- Required for all new accounts
- Code and Data Separation:
- Unlike Ethereum, Solana separates program code from account data
- Improves scalability but increases development complexity
- Programs are stateless, data is stored in accounts
- Two main approaches:
- Using Solana CLI and SPL Token program in terminal
- Using Metaplex.js library
- Token Authorities:
- Freeze Authority: Can freeze token accounts
- Mint Authority: Controls token supply (minting)
- Solana CLI
- Anchor Framework
- Rust Programming Language
- Web3.js/TypeScript SDK
- Phantom Wallet: Popular browser extension wallet for Solana
- Helius: www.helius.dev
- Public Node: scana.publicnode.com
- Account Creation
- Token Management
- Program Deployment
- Cross-Program Invocation (CPI)
- Transaction Signing
- State Management
- Always check account ownership
- Validate all inputs
- Handle rent collection properly
- Use PDAs for program-controlled accounts
- Implement proper error handling
- Follow security guidelines