> ## 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.

# How Solana works

> Solana's core building blocks, including accounts, programs, instructions, transactions, fees, program-derived addresses, and cross-program invocations.

Solana is a public network of computers, called validators, that all keep the
same copy of one shared record. The record is made of accounts: some hold data,
such as token balances, and some hold code, called programs, that the network
runs. Apps and wallets make changes by sending the network transactions, which
usually settle in under a second and cost a fraction of a cent.

<Frame caption="Programs and their data live on the network. Apps, wallets, and users work with it from outside.">
  <img className="block dark:hidden" src="/docs-assets/assets/docs/diagrams/solana-layers-light.svg" alt="Layers, top to bottom. The Solana network: validators that each keep the same accounts, where some accounts hold programs (your program, the Token Program) and others hold state (token balances, your program's data). Below it, apps (payments, games, markets) send transactions and read accounts through RPC. Below the apps, wallets hold keys and sign. At the bottom, users." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/diagrams/solana-layers.svg" alt="Layers, top to bottom. The Solana network: validators that each keep the same accounts, where some accounts hold programs (your program, the Token Program) and others hold state (token balances, your program's data). Below it, apps (payments, games, markets) send transactions and read accounts through RPC. Below the apps, wallets hold keys and sign. At the bottom, users." />

  <img className="block dark:hidden" src="/docs-assets/assets/docs/diagrams/solana-layers-sm-light.svg" alt="Layers, top to bottom. The Solana network: validators that each keep the same accounts, where some accounts hold programs (your program, the Token Program) and others hold state (token balances, your program's data). Below it, apps (payments, games, markets) send transactions and read accounts through RPC. Below the apps, wallets hold keys and sign. At the bottom, users." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/diagrams/solana-layers-sm.svg" alt="Layers, top to bottom. The Solana network: validators that each keep the same accounts, where some accounts hold programs (your program, the Token Program) and others hold state (token balances, your program's data). Below it, apps (payments, games, markets) send transactions and read accounts through RPC. Below the apps, wallets hold keys and sign. At the bottom, users." />
</Frame>

Seven concepts make up Solana's execution model. Start with Accounts and
Programs, then see how Instructions become Transactions. PDAs, CPIs, and Fees
build on those. The diagram below follows one transaction from your app,
through the network, to your program and back.

<TxWalkthrough>

<Frame caption="Where your code runs: your app offchain, your program onchain.">
  <img className="block dark:hidden" src="/docs-assets/assets/docs/diagrams/transaction-flow-light.svg" alt="One transaction, step by step. Your app builds a transaction, the wallet signs it, and your app sends it to the network through RPC. The network verifies the signatures and charges the fee, then runs your program's instruction all or nothing: your program derives a PDA, reads state, calls the Token Program through a CPI that the PDA signs, and writes state. Your app then gets the confirmation." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/diagrams/transaction-flow.svg" alt="One transaction, step by step. Your app builds a transaction, the wallet signs it, and your app sends it to the network through RPC. The network verifies the signatures and charges the fee, then runs your program's instruction all or nothing: your program derives a PDA, reads state, calls the Token Program through a CPI that the PDA signs, and writes state. Your app then gets the confirmation." />

  <img className="block dark:hidden" src="/docs-assets/assets/docs/diagrams/transaction-flow-sm-light.svg" alt="One transaction, step by step. Your app builds a transaction, the wallet signs it, and your app sends it to the network through RPC. The network verifies the signatures and charges the fee, then runs your program's instruction all or nothing: your program derives a PDA, reads state, calls the Token Program through a CPI that the PDA signs, and writes state. Your app then gets the confirmation." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/diagrams/transaction-flow-sm.svg" alt="One transaction, step by step. Your app builds a transaction, the wallet signs it, and your app sends it to the network through RPC. The network verifies the signatures and charges the fee, then runs your program's instruction all or nothing: your program derives a PDA, reads state, calls the Token Program through a CPI that the PDA signs, and writes state. Your app then gets the confirmation." />
</Frame>

</TxWalkthrough>

<Columns cols={2}>
  <Card title="Accounts" href="/developers/docs/core/accounts">
    All state lives in accounts, keyed by 32-byte addresses. Each has five
    fields: lamports, data, owner, executable, and rent_epoch.
  </Card>
  <Card title="Programs" href="/developers/docs/core/programs">
    Solana's smart contracts, compiled to sBPF. Programs are stateless: their
    data lives in separate accounts passed in by instructions.
  </Card>
  <Card title="Instructions" href="/developers/docs/core/instructions">
    A call to one program: its ID, the accounts it uses, and data bytes. One
    transaction can hold several.
  </Card>
  <Card title="Transactions" href="/developers/docs/core/transactions">
    Signatures plus a message (accounts, a recent blockhash, and
    instructions) that runs all or nothing. Max 1,232 bytes, or 4,096 with the
    v1 format.
  </Card>
  <Card title="Fees" href="/developers/docs/core/fees">
    5,000 lamports per signature, plus an optional priority fee per compute
    unit requested. Max 1.4M compute units per transaction.
  </Card>
  <Card title="Program-derived addresses (PDAs)" href="/developers/docs/core/pda">
    Addresses derived from a program ID and seeds. Only that program can sign
    for a PDA, via invoke_signed.
  </Card>
  <Card title="Cross-Program Invocations (CPIs)" href="/developers/docs/core/cpi">
    One program calling another via invoke or invoke_signed. Signer and writable
    privileges carry over. Max stack depth of 5, including the top-level
    instruction (9 with SIMD-0268).
  </Card>
</Columns>

## Concepts for app developers

What an app sees when it moves money or assets: who signs, when a payment is
done, and what it costs.

<Columns cols={2}>
<Card title="Wallets & signatures" icon="key-round" href="/developers/docs/core/wallets">
Addresses, private keys, and how transactions and messages are signed.
</Card>
<Card title="Confirmation & finality" icon="circle-check" href="/developers/docs/core/transactions/confirmation">
Processed, confirmed, and finalized, and which one to wait for.
</Card>
<Card title="Fee sponsorship" icon="fuel" href="/developers/docs/core/fees/fee-sponsorship">
Pay network fees for your users so they only hold dollars.
</Card>
<Card title="Rent (storage deposit)" icon="archive" href="/developers/docs/core/rent">
The refundable deposit every account holds for the space it uses.
</Card>
</Columns>

## Additional topics

<Card title="Assets" href="/developers/docs/tokens">
  Fungible and non-fungible digital assets on Solana (SPL Token, Token-2022).
</Card>

Each [cluster](/developers/docs/references/clusters) has a public RPC endpoint:

| Cluster | Public RPC Endpoint              | Use                       |
| ------- | -------------------------------- | ------------------------- |
| Mainnet | `https://api.mainnet.solana.com` | Production                |
| Devnet  | `https://api.devnet.solana.com`  | Developer experimentation |
| Testnet | `https://api.testnet.solana.com` | Validator testing         |
