Instruction Introspection

Programming Model · Abyss

A technique where a Solana program reads the Instructions sysvar (Sysvar1nstructions1111111111111111111111111) to inspect other instructions within the same transaction, enabling cross-instruction validation without CPI. The primary use cases are verifying that an Ed25519 or Secp256k1 precompile instruction exists earlier in the transaction (proving a signature was verified), enforcing that specific instructions co-occur (e.g., requiring a memo), and detecting whether the current instruction was invoked via CPI. Programs call load_instruction_at or get_instruction_relative to read sibling instructions.

Related terms