> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Instructions

> Solana instructions are the smallest unit of program execution. Each instruction targets one program and specifies accounts, data, and signer requirements.

An instruction asks one [program](/developers/docs/core/programs) to run one of its
handlers. It names the program, the accounts it needs, and a byte array of data
the program interprets (usually a discriminator that picks the handler, then
serialized arguments). To change state, you add one or more instructions to a
[transaction](/developers/docs/core/transactions) and send it.

<Frame caption="An instruction names a program, the accounts it uses, and the data it passes.">
  <img className="block dark:hidden" src="/docs-assets/assets/docs/core/transactions/instruction-light.svg" alt="An instruction names a program, the accounts it uses, and the data it passes." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/core/transactions/instruction.svg" alt="An instruction names a program, the accounts it uses, and the data it passes." />

  <img className="block dark:hidden" src="/docs-assets/assets/docs/core/transactions/instruction-sm-light.svg" alt="An instruction names a program, the accounts it uses, and the data it passes." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/core/transactions/instruction-sm.svg" alt="An instruction names a program, the accounts it uses, and the data it passes." />
</Frame>

<Columns cols={2}>
  <Card
    title="Instruction Structure"
    href="/developers/docs/core/instructions/instruction-structure"
  >
    The three fields (program_id, accounts, data), AccountMeta, and compiled
    instructions, with a SOL transfer example.
  </Card>
  <Card
    title="Instruction Introspection"
    href="/developers/docs/core/instructions/instruction-introspection"
  >
    How programs read the other instructions in their transaction via the
    Instructions sysvar.
  </Card>
</Columns>

## Key facts

- **Single program**: Each instruction targets exactly one program via
  `program_id`.
- **Account metadata**: The `accounts` array has an `AccountMeta` for every
  account the instruction reads or writes.
- **Opaque data**: The `data` field is a byte array whose format is defined by
  the target program.
