Back to Course
5/8
25 XP
reading10 min

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:

  • Program ID — which program to call
  • Accounts — which accounts the program needs
  • Data — serialized arguments
  • 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

    LimitValue
    Max transaction size1,232 bytes
    Max instructions per tx~20 (size dependent)
    Max accounts per tx64 (v0 with ALTs: 256)
    Max compute units1,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.

    Hints

    0/2 revealed
    🔒 Hint 2 — reveal previous hints first