Introducing a new way to review your PRs.

Read the announcement

solana-foundation / solana-web3.js

Solana JavaScript SDK

View on GitHub

23 documents · Updated Nov 16, 2026

docs / address-lookup-table-program

Address lookup table program

The address lookup table program manages on-chain lists of public keys that version 0 (v0) messages can reference by small indexes. It lets a transaction move eligible account addresses out of its static key list while preserving their writable or read-only role. See Programs and instructions for the wider program API and Native program APIs for related native programs.

System role

v0 message lookups

The v0 message format stores a table address plus separate writable and read-only index lists. During compilation, the message checks the supplied table accounts and replaces eligible non-signer account keys with these indexes. During resolution, it loads the addresses in index order and joins them with the static keys. References: src/…/v0.ts• L24-42, src/…/v0.ts• L79-113, src/…/v0.ts• L142-221, src/…/compiled-keys.ts• L106-137

The lookup table must be available when the message is compiled or when its account keys are resolved. A missing table or an index outside the table address list prevents key resolution. The table does not provide signatures; signer keys remain in the message's static account keys. References: src/…/v0.ts• L79-113, src/…/v0.ts• L150-180, src/…/compiled-keys.ts• L109-120

Message integration

Address selection

Message compilation first gathers the accounts required by the transaction instructions. It then compares those accounts with each supplied table and moves matching eligible accounts into writable or read-only lookup entries. A table is included only when it contributes at least one account. References: src/…/v0.ts• L188-221, src/…/compiled-keys.ts• L25-57, src/…/compiled-keys.ts• L106-163

Address resolution

When a v0 message is read, its table lookups contain indexes rather than public keys. Resolution finds the matching AddressLookupTableAccount, reads each writable and read-only index from its ordered address list, and joins those results with the static account keys used by the message. References: src/…/v0.ts• L79-113, src/…/v0.ts• L142-185, src/…/account-keys.ts• L8-42

The version selector treats a message without a version prefix as legacy and supports version 0 for lookup-table messages. Other message versions are rejected by this client. References: src/…/versioned.ts• L5-35, src/…/v0.ts• L427-511

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the ordered address list contract aligned with v0 writable and read-only index resolution. A change to list order or index width can invalidate existing messages.

Important failure modes

TriggerConsequenceGuard
A v0 message is resolved without its referenced table accountAccount-key resolution fails before instruction executionLoad each referenced AddressLookupTableAccount and pass it to message key resolution.
A lookup index is not present in the table address listThe message cannot resolve the referenced accountUse the table state that matches the message and keep its address order unchanged.

Key files

FileWhy to read it
src/…/v0.tsShows how v0 messages compile, serialize, and resolve table-backed account keys.
src/…/compiled-keys.tsExplains which instruction accounts can move from static keys into lookup tables.
src/…/account-keys.tsShows how static keys and resolved lookup keys form one message account-key space.
src/…/versioned.tsDefines the boundary between legacy messages and supported versioned messages.