Skip to main content
The settlement module handles x402 payment verification and execution, including Light Protocol compressed receipts for cost-efficient on-chain storage at scale.

settle — high-level

The settle function handles the entire settlement flow end-to-end: builds the instruction, fetches the Light Protocol proof, creates a VersionedTransaction with the ALT, signs, sends, confirms, and parses events.
The returned object includes the transaction signature and all parsed events from the settlement transaction (including paymentSettled).

buildVerifyAndSettleIx — low-level

When you need the raw instruction to combine with other instructions in a custom transaction, use the low-level builder. Returns { computeBudgetIx, instruction, lightParams }.

Settlement modes

The payer’s tokens are transferred on-chain via CPI during the settlement transaction. The protocol fee is deducted and sent to the treasury automatically.

Address lookup table

Settlement transactions reference many accounts (Light Protocol CPI, token program, config PDA, etc.). An address lookup table (ALT) keeps VersionedTransaction size within Solana’s 1232-byte limit. The ALT contains 16 static accounts:
The ALT is created once per network deployment and reused across all settlement transactions. Its address is stored in the NetworkConfig as lightAlt.

Light Protocol integration

Settlement receipts are stored as compressed PDAs via Light Protocol, keeping per-receipt cost near zero while maintaining on-chain verifiability.

prepareLightSettlement

Fetches the Light Protocol proof and state tree data needed for the settlement instruction.

deriveCompressedReceiptAddress

Derive the address of a compressed receipt PDA for a given payment ID.

Deploy CLI

The SDK includes CLI commands for managing settlement infrastructure on each network.