skills/compressed-token/SKILL.md
For compressed token operations on Solana ~400x cheaper than SPL: create mints with interface PDAs, mint, transfer, approve, revoke, compress, decompress, merge, and Token-2022 with compression. Compressed token accounts are always rent-free. @lightprotocol/compressed-token (TypeScript) with createRpc() from @lightprotocol/stateless.js.
npx skillsauth add lightprotocol/skills compressed-tokenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build token applications with @lightprotocol/compressed-token (TypeScript). Compressed token accounts are always rent-free. The SPL mint and interface PDA still pay rent, but each holder's compressed token account costs a fraction of an SPL account.
| Creation cost | SPL | Compressed | | :---------------- | :------------------ | :------------------- | | Token account | ~2,000,000 lamports | ~5,000 lamports |
Compressed token accounts store balance, owner, mint, and delegate like SPL token accounts. They require no associated token account (ATA) and no rent-exempt balance, and convert to and from SPL tokens at any time with compress() and decompress(). Wallets like Phantom and Backpack display them alongside SPL tokens.
Compressed tokens use a standard SPL (or Token-2022) mint plus an interface PDA. The interface PDA is an omnibus account that locks SPL tokens while they are compressed and releases them on decompression. Create it with the mint via createMint(), or add one to an existing mint with createTokenPool().
SPL mint --register--> interface PDA (omnibus PDA)
mintTo / compress --> compressed token accounts (rent-free, in state tree)
decompress --> back to SPL token account
Each mint supports a maximum of 4 interface PDAs. They get write-locked during compression and decompression, so add more with addTokenPools() to raise per-block write-lock capacity for high-throughput distribution.
Examples run on localnet by default. For devnet or mainnet, set the API_KEY env var (Helius or Triton RPC key) and provide a Solana keypair at ~/.config/solana/id.json. In production, load both from a secrets manager.
import { createRpc } from '@lightprotocol/stateless.js';
// Localnet (defaults to http://127.0.0.1:8899):
const rpc = createRpc();
// Devnet or mainnet:
const rpc = createRpc(`https://devnet.helius-rpc.com?api-key=${process.env.API_KEY!}`);
| Task | Reference | |------|-----------| | Create a mint with interface PDA, add more | references/create-mint.md | | Mint compressed tokens | references/mint-to.md | | Transfer compressed tokens | references/transfer.md | | Approve and revoke delegates | references/approve-revoke.md | | Compress and decompress SPL tokens | references/compress-decompress.md | | Merge fragmented compressed accounts | references/merge-token-accounts.md | | Token-2022 with compression | references/token-2022.md | | Token distribution and airdrops | references/distribution.md | | Query balances, accounts, and history | references/queries.md |
All functions are in @lightprotocol/compressed-token unless noted. RPC helpers come from @lightprotocol/stateless.js.
createMint (SPL mint + pool), createTokenPool (pool for existing mint), addTokenPools (max 4 per mint).mintTo, approveAndMintTo, transfer, transferDelegated.approve, revoke.compress, decompress, decompressDelegated, compressSplTokenAccount.mergeTokenAccounts (up to 8 accounts).CompressedTokenProgram.* methods (compress, decompress, transfer, createTokenPool, deriveTokenPoolPda) and the standalone createMintInstruction export.getTokenPoolInfos, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, selectMinCompressedTokenAccountsForTransfer.Rpc): createRpc, getValidityProof, getCompressedTokenAccountsByOwner, getCompressedTokenAccountsByDelegate, getCompressedTokenBalancesByOwnerV2, getCompressionSignaturesForTokenOwner, selectStateTreeInfo.buildAndSignTx, sendAndConfirmTx, dedupeSigner.If cloned locally, scope Read, Glob, Grep to these repositories and the current project directory only.
AskUserQuestion to resolve blind spots before execution.Task subagents for parallel research; track progress with TodoWrite.Read, Glob, Grep, and DeepWiki MCP access, loading skills/ask-mcp. Scope reads to skill references, example repos, and docs.Install dependencies and run a script against localnet, devnet, or mainnet by setting the RPC URL in createRpc().
npm install @lightprotocol/stateless.js @lightprotocol/compressed-token @solana/web3.js @solana/spl-token
npx tsx your-script.ts
@lightprotocol/compressed-token — API docs@lightprotocol/stateless.js — API docsIf no matching pattern in the reference repos, ask mcp__deepwiki__ask_question against Lightprotocol/light-protocol, for example "How to mint compressed tokens with @lightprotocol/compressed-token?".
This skill provides code patterns and documentation references only.
API_KEY (Helius or Triton RPC key) and read ~/.config/solana/id.json for the payer keypair. Neither is needed on localnet. In production, load both from a secrets manager.Read, Glob, Grep must stay within the current project directory and the reference repos above.npx skills add Lightprotocol/skills installs from the public GitHub repository (Lightprotocol/skills). Verify the source before running.documentation
For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.
tools
For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.
tools
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.
tools
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.