Build with ZK Compression on Solana using Light Protocol. Use when creating compressed tokens, compressed PDAs, or integrating ZK compression into Solana programs. Covers compressed account model, state trees, validity proofs, and client integration with Helius/Photon RPC.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/tenequm/claude-plugins/blob/main/solana/skills/solana-compression/SKILL.md -a claude-code --skill solana-compressionInstallation paths:
.claude/skills/solana-compression/# ZK Compression on Solana
ZK Compression enables rent-free tokens and PDAs on Solana by storing state on the ledger instead of in accounts, using zero-knowledge proofs to validate state transitions. Built by Light Protocol and indexed by Helius Photon.
## When to Use ZK Compression
**Use ZK Compression when:**
- Creating millions of token accounts (5000x cheaper than regular accounts)
- Minting to many recipients (airdrops, loyalty programs, gaming assets)
- Building apps with many user accounts that are infrequently updated
- Reducing rent costs for PDAs with low update frequency
**Use regular accounts when:**
- Account is updated frequently (>1000 lifetime writes)
- Account stores large data accessed in on-chain transactions
- Compute budget is critical (compression adds ~100k CU overhead)
## Quick Start
### Installation
```bash
# TypeScript client
npm install @lightprotocol/stateless.js @lightprotocol/compressed-token
# Rust SDK for programs
cargo add light-sdk
# CLI for development
npm install -g @lightprotocol/zk-compression-cli
```
### Local Development
```bash
# Start local validator with compression support
light test-validator
# Initialize a new Anchor project with compression
light init my-program
```
### Mint Compressed Tokens (TypeScript)
```typescript
import { createRpc } from '@lightprotocol/stateless.js';
import { createMint, mintTo, transfer } from '@lightprotocol/compressed-token';
const rpc = createRpc(); // or createRpc('https://mainnet.helius-rpc.com?api-key=YOUR_KEY')
// Create mint with token pool for compression
const { mint } = await createMint(rpc, payer, payer.publicKey, 9);
// Mint compressed tokens (creates compressed token accounts)
await mintTo(rpc, payer, mint, recipient, payer, 1_000_000_000);
// Transfer compressed tokens
await transfer(rpc, payer, mint, 500_000_000, owner, recipient);
// Query compressed token accounts
const accounts = await rpc.getCompressedTokenAccountsByOwner(owner, { mint });
```
### Build P