Solana  

Solana Cheatsheet – A Beginner-Friendly Guide

Introduction

Solana is a high-speed blockchain platform. It supports smart contracts and decentralized applications. This cheatsheet gives you key topics on Solana. You get a clear definition, a short code example, and one important point for each topic. This will help you start building or understanding Solana quickly.

1. RPC Endpoint

Definition: This is the network address your program uses to connect to Solana.

Code example (JavaScript / TypeScript):

const { Connection } = require('@solana/web3.js');
const connection = new Connection('https://api.mainnet-beta.solana.com');

Important point: Use the right endpoint for your environment (mainnet, testnet, devnet).

2. Keypair

Definition: A keypair holds your public and private keys. It lets you sign transactions.

Code example:

const { Keypair } = require('@solana/web3.js');
const keypair = Keypair.generate();
console.log(keypair.publicKey.toBase58());

Important point: Keep your private key secret. Losing it means losing access to funds.

3. Airdrop

Definition: A test network tool to get SOL for development. Works on devnet or testnet only.

Code example:

await connection.requestAirdrop(keypair.publicKey, 1e9); // 1 SOL

Important point: Airdrop only works on non-main networks and may have limits.

4. Transaction

Definition: A transaction bundles instructions and sends them to the network.

Code example:

const { Transaction, SystemProgram } = require('@solana/web3.js');
let tx = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: keypair.publicKey,
    toPubkey: recipientPubkey,
    lamports: 1000,
  })
);
await connection.sendTransaction(tx, [keypair]);

Important point: Make sure fees are covered and the transaction is signed by required keys.

5. Program (on-chain smart contract)

Definition: A compiled and deployed piece of logic running on Solana blockchain.

Important point: You call a program with instructions. Program ID is needed to reference it.

6. Instruction

Definition: A low-level command sent in a transaction for a program to execute.

Code example:

const instruction = new TransactionInstruction({
  keys: [{ pubkey: accountPubkey, isSigner: false, isWritable: true }],
  programId: programId,
  data: Buffer.from([0]), // method index, params
});
tx.add(instruction);

Important point: The structure of data depends on your on-chain program interface.

7. Accounts

Definition: Data storage units on Solana. Programs use them to read or write state.

Important point: Accounts must be created and initialized before use. They cost rent or need rent exemption.

8. PDAs (Program Derived Addresses)

Definition: Deterministic addresses derived from program logic. Used to control accounts.

Code example:

const [pda, bump] = await PublicKey.findProgramAddress(
  [Buffer.from('seed')],
  programId
);

Important point: PDAs give you control without private key. Bump is needed to find a valid point.

9. BPF Programs & Anchor

Definition: BPF is the bytecode format that Solana programs use. Anchor is a framework to simplify writing them.

Important point: If you use Anchor you get layout, serialization, IDL automatically. Saves time.

10. Rent & Rent-Exemption

Definition: Solana charges rent for storing data in accounts. You can pay a lump sum to be rent-exempt.

Important point: Pay for rent exemption at account creation to avoid your account being deleted over time.

11. SPL Tokens

Definition: Token standard on Solana, similar to ERC-20.

Code example (mint new token):

const mint = await Token.createMint(
  connection,
  payerKeypair,
  mintAuthority,
  null,
  9, // decimals
  TOKEN_PROGRAM_ID
);

Important point: Use the official SPL Token library. You need to create an associated token account before transferring.

12. Associated Token Account

Definition: A wallet-specific account to hold SPL tokens.

Code example:

const ata = await mint.getOrCreateAssociatedAccountInfo(
  userPublicKey
);

Important point: Always use associated token accounts when possible for clarity and compatibility.

13. Confirm Transaction

Definition: Wait for network to finalize your transaction.

Code example:

const signature = await connection.sendTransaction(tx, [keypair]);
await connection.confirmTransaction(signature);

Important point: There are options—processed, confirmed, finalized. Choose based on your risk tolerance.

14. Cluster Types

Definition: Solana networks—mainnet-beta (live), testnet (testing features), devnet (for development).

Important point: Do not use mainnet for tests. Always deploy first on devnet or testnet.

15. Blockhash & Fee Payer

Definition: Transaction needs a recent blockhash and a fee payer.

Code example:

tx.recentBlockhash = (await connection.getRecentBlockhash()).blockhash;
tx.feePayer = keypair.publicKey;

Important point: Always get a fresh blockhash before sending. Old blockhashes lead to failures.

16. Proof of History (PoH) & Tower BFT

Definition: PoH creates a time record in the chain. It lets Solana order events without waiting. Tower BFT is the consensus method that uses PoH to reach agreement faster.

Important point: PoH gives speed. Tower BFT uses that time record to limit validator messaging.

17. Gulf Stream, Sealevel, Pipelining, Archivers

Definition:

  • Gulf Stream: Solana does not use a mempool. It pre-forwards transactions to validators.

  • Sealevel: The runtime that runs smart contracts in parallel.

  • Pipelining: System where stages run in sequence like washing-drying-folding.

  • Archivers: Nodes that store historical data off the main chain.
    Important point: These let Solana process many transactions quickly.

18. Ownership & Authority

Definition: Each account has an owner program. That program can only change that account's data, except for transferring lamports.

Important point: Ownership enforces security and permissions. 

19. Cryptography (Ed25519, Keypair, Mnemonic)

Definition: Solana uses Ed25519 keys. Your wallet starts from a seed phrase—usually 12 or 24 words. Those words recreate all your addresses.

Important point: Keep your seed phrase safe. Losing it means losing everything.

20. CLI Tools

Definition: Solana CLI lets you manage accounts, deploy programs, get info.

Code examples:

solana balance
solana transfer <RECIPIENT> <AMOUNT>
solana program deploy <PROGRAM_PATH>
solana account <ADDRESS>
solana cluster-version

Important point: Use CLI for quick testing and deployment

21. Cross-Program Invocation (CPI)

Definition: One Solana program can call another. This lets programs build on each other.

Important point: Use CPIs to share logic across programs. It's how composability works. 

22. Fees & Prioritization

Definition:

  • Transaction fees: Small cost per transaction.

  • Prioritization fees: Extra fee to push your txn higher in priority.

Important point: You can pay extra to speed up confirmation.

23. Security Issues & Best Practices

Definition: Many smart contract bugs can slip in if checks are wrong. OWASP lists top risks for Solana programs.

Important point: Validate accounts, avoid overflows, handle instruction checks carefully. 

24. Solana Tokenomics (Inflation & Supply)

Definition: SOL uses disinflation. Inflation starts around 8%, drops about 15% each year, and targets long-term 1.5%. Some fees are burned.

Important point: No fixed supply—rewards to stakers and burns affect total supply.

25. Parallel Execution & Account Model

Definition: Solana stores data in accounts. These accounts can state data or programs. Multiple transactions run in parallel if they do not touch the same accounts.

Important point: To avoid conflicts, design your accounts for concurrency.

26. Archival & Node Storage

Definition: Solana generates a lot of data. Archivers store chain history to keep validators lean.

Important point: Full chain history lives off validators. Use explorers or archivers to read old data.

27. Scalability & Comparison

Definition: Solana hits ~65,000 TPS with ~400ms slot times using PoH, parallel runtime, pipelining, Gulf Stream. No sharding needed.

Important point: Solana can scale on one layer. It beats many chains in speed. 

Conclusion

Solana is fast. That matters. But building right means staying precise, thinking in parallel, and avoiding shortcuts.