name: solana-compression description: "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." metadata: source: https://github.com/Lightprotocol/skills documentation: https://www.zkcompression.com openclaw: requires: env: ["API_KEY"] # Helius or Triton RPC key; only needed for devnet/mainnet config: ["~/.config/solana/id.json"] # Solana keypair; only needed for devnet/mainnet bins: ["node", "solana", "anchor", "cargo", "light"] allowed-tools: Bash(git:), Bash(cargo:), Bash(anchor:), Bash(light:), Read, Edit, Glob, Grep, Write, Task, WebFetch, WebSearch, mcp__deepwiki__ask_question
Build Solana programs with compressed accounts via CPI to the Light System Program. No rent-exemption required.
| Creation cost | Solana account | Compressed account |
|---|---|---|
| PDA (128 bytes) | ~1,100,000 lamports | ~5,000 lamports |
| Criteria | Light-PDA (easy) | Compressed PDA (advanced) |
|---|---|---|
| When | Rent-free version of existing Anchor accounts | Custom compressed state with ZK proofs |
| Skill | light-sdk (Anchor macro pattern) |
This skill (solana-compression) |
| Macro | #[light_account(init)] |
LightAccount::new_init() manual CPI |
| Dependencies | light-sdk, light-compressible |
light-sdk, light-sdk-types |
If you just want rent-free Anchor accounts, use the light-sdk skill instead. This skill is for programs that require manual CPI to the Light System Program (custom compressed state, ZK proofs, address derivation).
├─ Client
│ ├─ Get ValidityProof from RPC.
│ ├─ pack accounts with PackedAccounts into PackedAddressTreeInfo and PackedStateTreeInfo.
│ ├─ pack CompressedAccountMeta.
│ ├─ Build Instruction from PackedAccounts and CompressedAccountMetas.
│ └─ Send transaction.
│
└─ Custom Program
├─ CpiAccounts parse accounts consistent with PackedAccounts.
├─ LightAccount instantiates from CompressedAccountMeta.
│
└─ Light System Program CPI
├─ Verify ValidityProof.
├─ Update State Merkle tree.
├─ Update Address Merkle tree.
└─ Complete atomic state transition.
| Topic | Reference |
|---|---|
| Program operations (create, update, close, burn, reinit) | references/compressed-pdas.md |
| Client SDK (TypeScript + Rust) | references/client.md |
| Nullifier PDAs (double-spend prevention) | references/nullifier-pdas.md |
| Error codes (6000-16034) | references/error-codes.md |
Basic operations — create, update, close, reinit, burn (each with Anchor and Native variants)
Counter — full lifecycle (create, increment, decrement, reset, close):
- counter/anchor — Anchor with Rust and TypeScript tests
- counter/native — Native with light-sdk and Rust tests
- counter/pinocchio — Pinocchio with light-sdk-pinocchio and Rust tests
Other examples: - create-and-update — Create and update with a single validity proof in one instruction - read-only — Create and read a compressed account onchain - account-comparison — Compressed vs regular Solana accounts
Nullifier:
- nullifier-program — Rent-free PDA for duplicate execution prevention. SDK: light-nullifier-program | example client
Airdrop claim: - simple-claim — Compressed tokens decompressed to SPL on claim with cliff - merkle-distributor — SPL tokens with compressed PDA claim tracking, linear vesting, partial claims, clawback - example-token-distribution — Simple client-side distribution
ZK programs: - zk-id — Identity verification with Groth16 proofs - zk/nullifier — Simple nullifier creation program
Additional: examples-zk-compression — More ZK compression examples
Canonical source: program-examples README. If cloned locally, scope Read, Glob, Grep to these repositories and the current project directory only.
AskUserQuestion to resolve blind spots小蔥技能7w4.net有更新,你可以訪問看下。
AskUserQuestion for anything unclear — never guess or assumeTask tool with subagents for parallel researchSkill toolTodoWriteRead, Glob, Grep, and DeepWiki MCP access, loading skills/ask-mcp. Scope reads to skill references, example repos, and docs.Anchor programs:
anchor build
anchor test
Native programs:
cargo build-sbf
cargo test-sbf
cargo build (must use cargo build-sbf)cargo test (must use cargo test-sbf)On failure, spawn debugger agent with error context.
Loop rules: 1. Each debugger gets fresh context + previous debug reports 2. Each attempt tries something DIFFERENT 3. NEVER GIVE UP - keep spawning until fixed 4. Max 5 attempts per error
Do NOT proceed until all tests pass.
| Package | Link |
|---|---|
light-sdk |
docs.rs |
light-client |
docs.rs |
@lightprotocol/stateless.js |
API docs |
light-program-test |
docs.rs |
If no matching pattern in reference repos:
mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "How to {operation}?")
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, and Grep must be limited to the current project directory and the reference repos listed above. Do not read outside these paths.Read, Glob, Grep scoped to skill references, example repos, and docs.npx skills add Lightprotocol/skills from Lightprotocol/skills.這是一個高質量的 Solana 壓縮程式開發技能包,文件組織清晰、參考資料豐富,涵蓋完整的程式和客戶端開發指南。主要優點是提供了多語言示例和詳細的工作流程指導;不足是部分文件內容過於冗長,對新手不夠友好,某些高階概念的解釋不夠通俗易懂。