2.5k
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
3 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill openclaw/skills --skill solana-compression-dev- _meta.json297 B
- SKILL.md9.0 KB
Overview
This skill enables Solana client and on-chain programs to create and manage compressed PDAs via CPI to the Light System Program, offering ~160x cost savings and no rent-exemption for per-user state. It provides primitives to create, update, close, burn, and reinitialize compressed accounts for rent-free, low-cost state management. Use it when you need custom compressed state, ZK-proof flows, or address derivation beyond simple Anchor rent-free accounts.
How this skill works
The skill performs manual CPI into the Light System Program: clients obtain ValidityProofs and pack accounts into PackedAccounts, PackedAddressTreeInfo, and PackedStateTreeInfo, then send instructions containing CompressedAccountMeta. On-chain, programs parse CpiAccounts consistent with PackedAccounts and instantiate LightAccount from CompressedAccountMeta. The Light System Program verifies proofs, updates address and state Merkle trees, and applies atomic state transitions (create/update/close/burn/reinit).
When to use it
- Per-user state where rent savings matter (profiles, game state, credentials)
- DePIN device registrations or other device-native registries
- Nullifier PDAs for double-spend or duplicate-execution prevention
- Infrequently accessed accounts where low ongoing cost is required
- When you need custom compressed state formats or ZK proof integration
Best practices
- Prefer this skill only for advanced flows requiring manual CPI; use light-sdk macros for simpler Anchor rent-free accounts
- Always fetch and validate ValidityProofs on the client before building PackedAccounts
- Keep CpiAccounts layout strictly consistent with client-packed data to avoid on-chain parse errors
- Run full SBF builds and tests (cargo build-sbf / cargo test-sbf or anchor build/test) and never skip SBF compilation
- Store RPC keys and payer keypairs in a secure secrets manager in production; local dev can use localnet keyfiles
Example use cases
- Per-user compressed profile storage for social or gaming apps to avoid rent-exemption costs
- DePIN device registration ledger with compressed PDAs to track millions of devices cheaply
- Nullifier PDAs to prevent replay/double-spend in voucher or claim systems
- Airdrop claim systems that track claim state compressed on-chain and decompress to SPL on claim
- ZK-enabled identity or credential programs that verify proofs and update compressed state atomically
FAQ
Compressed PDAs can reduce creation cost dramatically (example: ~5,000 lamports vs ~1,100,000 lamports for a 128-byte PDA), making many-per-user records feasible.
Do I need additional dependencies to use this skill?
Yes. Use light-sdk and light-sdk-types for manual CPI flows. For simpler rent-free Anchor accounts, prefer the light-sdk macros instead of this skill.