Skip to main content
SPLLight
Get AccountgetAccount()getAtaInterface()
Use the payments agent skill to add light-token payment support to your project:
Add the marketplace and install:
/plugin marketplace add Lightprotocol/skills
/plugin install solana-rent-free-dev
For orchestration, install the general skill:
npx skills add https://zkcompression.com

Understanding Solana addresses

Solana has two types of addresses:
  • On-curve addresses (wallets): derived from a keypair, can sign transactions.
  • Off-curve addresses (PDAs): program-derived addresses, can only sign via CPI when used as smart wallets.

Verification flow

Before sending a payment:
  1. Check if the address is on-curve (wallet) or off-curve (PDA).
  2. If the address has an on-chain account, check the account owner and type.
  3. For Light Token, derive the associated token account to verify it matches the expected mint.
import {
  getAssociatedTokenAddressInterface,
  getAtaInterface,
} from "@lightprotocol/compressed-token/unified";

// Derive the expected associated token account for this recipient and mint
const expectedAta = getAssociatedTokenAddressInterface(mint, recipientWallet);

// Check if the account exists and is active
try {
  const account = await getAtaInterface(rpc, expectedAta, recipientWallet, mint);
  console.log("Account exists, balance:", account.parsed.amount);
} catch {
  console.log("Account does not exist yet — will be created on first transfer");
}
Use getAssociatedTokenAddressInterface() instead of SPL’s getAssociatedTokenAddressSync() to derive Light Token associated token account addresses. The derivation uses the Light Token Program ID.
When you send a payment with transferInterface() or createTransferInterfaceInstructions(), the SDK automatically creates the recipient’s associated token account if it doesn’t exist. Address verification is a safety check, not a prerequisite.

Basic payment

Send a single token transfer.

Receive payments

Load cold accounts and prepare to receive.

Verify payments

Query balances and transaction history.

Didn’t find what you were looking for?

Reach out! Telegram | email | Discord