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

overview

Knowledge Base updated: 2026-11-15

Solana Web3.js knowledge base

Solana Web3.js is the JavaScript/TypeScript client library for constructing Solana transactions, communicating with RPC nodes, and integrating browser wallets.

The core library lives in src/; its Connection client manages HTTP JSON-RPC and WebSocket subscriptions, while transaction, message, key, account, and program modules model protocol data.

Workspace packages provide React wallet integration and a controllable test wallet. Transaction state is assembled in messages and transactions, signed by keypairs or wallets, serialized to bytes, then submitted and confirmed through Connection.

flowchart TD
  App[Application] --> Conn[Connection]
  Conn --> Rpc[HTTP JSON-RPC]
  Conn --> Ws[WebSocket subscriptions]
  App --> Ix[TransactionInstruction]
  Ix --> Msg[Legacy / v0 Message]
  Msg --> Tx[Transaction / VersionedTransaction]
  Keys[PublicKey / Keypair] --> Tx
  Tx --> Conn
  Native[Native program builders] --> Ix
  Alt[Address lookup tables] --> Msg
  Rpc --> Cluster[Solana cluster]
  Ws --> Cluster
  Wallet[Wallet adapter React packages] --> Conn
  Wallet --> Tx
  TestWallet[Test wallet package] --> Wallet

Glossary

  • Connection — the web3.js RPC client combining HTTP requests and WebSocket listener management.
  • Commitment — the requested Solana confirmation level used by RPC reads and transaction confirmation.
  • Versioned transaction — a transaction carrying a versioned message, including v0 address lookup table support.
  • Address lookup table (ALT) — an on-chain account that supplies addresses compactly to v0 messages.
  • Wallet adapter — the React-oriented package layer that presents wallet capability and connection state to applications.

Invariants

  • Public keys and transaction message account ordering must remain canonical; see src/publickey.ts and src/message/**.
  • Serialized transaction bytes must match the signatures and compiled message they contain; see src/transaction/** and src/versioned-transaction.ts.
  • RPC listener IDs and client-side subscription state must be coordinated across reconnects; see src/connection.ts.
  • Native program instruction data must use the program-specific binary layouts expected on chain; see src/programs/**.
  • Wallet UI state must be driven through provider/controller state rather than independent connection state; see packages/wallet-adapter-react/src/**.

Routing table