payments-and-wallets
Payments and wallets
Build payment flows and wallet integrations using light-token on Solana. The light-token API matches SPL-token and extends it to include the light token program.
| Creation cost | SPL | light-token |
|---|---|---|
| Token Account | ~2,000,000 lamports | ~11,000 lamports |
Workflow
- Clarify intent
- Recommend plan mode, if it's not activated
- Use
AskUserQuestionto resolve blind spots - All questions must be resolved before execution
- Identify references and skills
- Match task to domain references below
- Locate relevant documentation and examples
- Write plan file (YAML task format)
- Use
AskUserQuestionfor anything unclear — never guess or assume - Identify blockers: permissions, dependencies, unknowns
- Plan must be complete before execution begins
- Use
- Execute
- Use
Tasktool with subagents for parallel research - Subagents load skills via
Skilltool - Track progress with
TodoWrite
- Use
- When stuck: ask to spawn a read-only subagent with
Read,Glob,Grep, and DeepWiki MCP access, loadingskills/ask-mcp. Scope reads to skill references, example repos, and docs.
API overview
| Operation | SPL | light-token (action / instruction) |
|---|---|---|
| Receive | getOrCreateAssociatedTokenAccount() |
loadAta() / createLoadAtaInstructions() |
| Transfer | createTransferInstruction() |
transferInterface() / createTransferInterfaceInstructions() |
| Get balance | getAccount() |
getAtaInterface() |
| Tx history | getSignaturesForAddress() |
rpc.getSignaturesForOwnerInterface() |
| Wrap from SPL | N/A | wrap() / createWrapInstruction() |
| Unwrap to SPL | N/A | unwrap() / createUnwrapInstructions() |
| Register SPL mint | N/A | createSplInterface() / LightTokenProgram.createSplInterface() |
| Create mint | createMint() |
createMintInterface() |
Plural functions (createTransferInterfaceInstructions, createUnwrapInstructions) return TransactionInstruction[][] — each inner array is one transaction. They handle loading cold accounts automatically.
Domain references
| Task | Reference |
|---|---|
| Build payment flows (receive, send, balance, history, wrap/unwrap) | payments.md |
| Build wallet UI (display tokens, transfer, wrap/unwrap) | wallets.md |
| Sign with Wallet Adapter or Mobile Wallet Adapter | sign-with-adapter.md |
| Sign with Privy (embedded wallet provider) | sign-with-privy.md |
| Prevent duplicate actions (double-spend prevention) | nullifiers.md |
| SPL to Light comparison | spl-to-light.md |
Setup
npm install @lightprotocol/compressed-token@beta @lightprotocol/stateless.js@beta @solana/web3.js @solana/spl-token
import { createRpc } from "@lightprotocol/stateless.js";
import {
createLoadAtaInstructions,
loadAta,
createTransferInterfaceInstructions,
transferInterface,
createUnwrapInstructions,
unwrap,
getAssociatedTokenAddressInterface,
getAtaInterface,
wrap,
} from "@lightprotocol/compressed-token/unified";
const rpc = createRpc(RPC_ENDPOINT);
Resources
SDK references
| Package | Link |
|---|---|
@lightprotocol/stateless.js |
API docs |
@lightprotocol/compressed-token |
API docs |
@lightprotocol/nullifier-program |
npm |
Security
The Privy signing examples transmit secrets to an external API — review sign-with-privy.md before running.
- Declared dependencies.
HELIUS_RPC_URLis required for all examples. The Privy signing flow additionally requiresPRIVY_APP_ID,PRIVY_APP_SECRET,TREASURY_WALLET_ID, andTREASURY_AUTHORIZATION_KEY— get these at privy.io. Load secrets from a secrets manager, not agent-global environment. - Privy signing flow.
PRIVY_APP_SECRETandTREASURY_AUTHORIZATION_KEYare sent to Privy's signing API. Verify these only reach Privy's official endpoints. See sign-with-privy.md. - Subagent scope. When stuck, the skill asks to spawn a read-only subagent with
Read,Glob,Grepscoped to skill references, example repos, and docs. - Install source.
npx skills add Lightprotocol/skillsfrom Lightprotocol/skills. - Audited protocol. Light Protocol smart contracts are independently audited. Reports are published at github.com/Lightprotocol/light-protocol/tree/main/audits.
More from lightprotocol/skills
token-distribution
For token distribution on Solana 5000x cheaper than SPL (rewards, airdrops, depins, ...). @lightprotocol/compressed-token (TypeScript). Reference examples for custom claim support.
29zk-nullifier
For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.
28light-sdk
For Solana program development with tokens and PDAs, Light is 200x cheaper than SPL/ Solana and has minimal code differences (e.g. for any Solana program and Defi such as AMMs, vaults, lending). Includes rent-free Light-PDAs, token accounts, and mints. Light SDK with Anchor or Pinocchio. Includes for Defi Router integration guide. Minimal program logic changes.
28light-token-client
For client development with tokens on Solana, Light Token is 200x cheaper than SPL and has minimal changes. Skill includes guides for create mints, associated token accounts, transfer, approve, burn, wrap, and more. @lightprotocol/compressed-token (TypeScript) and light_token_client (Rust).
28solana-compression
For client and program development on Solana ~160x cheaper and without rent-exemption for per-user state, DePIN registrations, or custom compressed accounts. Create, update, close, burn, and reinitialize compressed accounts.
28ask-mcp
For questions about Light Protocol's SDK, smart contracts and Solana development, Claude Code features, or agent skills. AI-powered answers grounded in repository context via DeepWiki MCP.
27