Transaction Anatomy
Transaction Anatomy
A Solana transaction is a bundle of instructions sent atomically to the network.
Structure
interface Transaction {
signatures: Signature[]; // One per signer
message: {
header: MessageHeader; // Signer counts
accountKeys: PublicKey[]; // All accounts referenced
recentBlockhash: string; // Prevents replay
instructions: Instruction[]; // The actual operations
}
}
Transaction Lifecycle
1. Build → Create transaction with instructions
Sign → Wallet signs with private key
Send → Submit to RPC node
Process → Leader includes in block
Confirm → Network reaches consensus
Finalize → Transaction is permanent
Instructions
Each instruction specifies:
interface TransactionInstruction {
programId: PublicKey;
keys: AccountMeta[]; // { pubkey, isSigner, isWritable }
data: Buffer; // Serialized instruction data
}
A single transaction can contain multiple instructions that execute atomically — if any instruction fails, the entire transaction is rolled back.
Key Limits
| Limit | Value |
|---|---|
| Max transaction size | 1,232 bytes |
| Max instructions per tx | ~20 (size dependent) |
| Max accounts per tx | 64 (v0 with ALTs: 256) |
| Max compute units | 1,400,000 CU |
| Blockhash validity | ~60 seconds |
Versioned Transactions
Solana supports v0 transactions with Address Lookup Tables (ALTs) — these allow referencing up to 256 accounts by storing addresses in on-chain lookup tables.