Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
A Solana transaction is a list of instructions, each of which names the program to call, the accounts it touches, and the data (opcode + args) to pass. That list is submitted atomically: all succeed or all roll back. This structure — programs + accounts + data — is radically simpler than Ethereum's 'call a function on a contract' frame; it's closer to 'hand a list of accounts and opcodes to the runtime.' Understanding the wire-level transaction layout lets you read any Solana transaction in an explorer and see exactly what it does.
Send 0.01 SOL with one instruction. The instruction names SystemProgram, names two accounts (from, to), and carries the opcode Transfer with amount 10_000_000. The transaction is signed by the sender and submitted. On arrival, the runtime loads both accounts, passes them to the System program, which mutates both balances, and the transaction commits. That's the whole model.
// Rust — construct and send a transfer using solana-sdk
use solana_sdk::{
signature::{Keypair, Signer},
system_instruction::transfer,
transaction::Transaction,
commitment_config::CommitmentConfig,
pubkey::Pubkey,
};
use solana_client::rpc_client::RpcClient;
use std::str::FromStr;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = RpcClient::new_with_commitment(
"https://api.devnet.solana.com".to_string(),
CommitmentConfig::confirmed(),
);
let from = Keypair::new(); // funded via airdrop for demo
let to = Pubkey::from_str("11111111111111111111111111111111")?; // example
let ix = transfer(&from.pubkey(), &to, 10_000_000); // 0.01 SOL
let blockhash = client.get_latest_blockhash()?;
let tx = Transaction::new_signed_with_payer(
&[ix], Some(&from.pubkey()), &[&from], blockhash,
);
let sig = client.send_and_confirm_transaction(&tx)?;
println!("Tx: {}", sig);
Ok(())
}
cargo runUse these three in order. Each builds on the one before.
In one paragraph, explain a Solana transaction's structure — what's in it, who signs it, and what the runtime does when it arrives.
Walk me through what happens step by step when you submit a transaction: from the RPC call, through validator forwarding, through Sealevel's parallel executor, to the commitment on-chain.
Given I need to execute a complex DeFi operation that touches 30 accounts, walk me through how Versioned Transactions + address lookup tables shrink the transaction size, and what the cost model is for creating + using a lookup table.