Solana instructions › How to tell which instruction a Solana transaction called

How to tell which instruction a Solana transaction called

Each instruction in a Solana transaction names a program ID, a list of accounts, and a byte string of instruction data. The program ID says which program is invoked. The first bytes of the data say which of that program's instructions is being called, once you know how that program encodes them.

A practical sequence:

  1. Open the transaction (the Rugsight transaction explainer is one way; explorers are another) and note the program ID of the instruction you care about.
  2. Look at the start of the instruction data. If the program is built with Anchor, the first 8 bytes are the discriminator. If it is the System Program, the first 4 bytes are a little-endian index. If it is SPL Token, Token-2022, Compute Budget or the Associated Token Account program, the first byte is the tag.
  3. Look that prefix up, together with the program ID, in a reference such as this one. The same 8-byte value can appear in more than one program when they share an instruction name; the same 1-byte tag is reused constantly. The program ID is what disambiguates them.

You do not need to simulate the transaction to name the instruction. Simulation and logs answer a different question: whether it succeeded and, if it failed, which error the program returned.

Related: How Anchor instruction discriminators work and the instruction decoder.

To see which instructions a confirmed transaction actually ran, paste its signature into the Rugsight transaction explainer.

Instruction lists and published discriminators come from solana-idls@1.2.1 (MIT) and, for the System Program, Compute Budget and Associated Token Account programs, from their public instruction enums (Apache-2.0). Snapshot date 2026-11-17. Programs can upgrade, so a live program may differ from this snapshot. Computed Anchor discriminators are the first 8 bytes of sha256("global:<snake_case_name>") and are labelled as computed.