AgentSkillsCN

solana-rent-free-dev

掌握基于 Light Protocol 免租原语的 Solana 开发技能。涵盖客户端开发(TypeScript、Rust)以及程序开发(Rust),适用于 Anchor、原生 Rust 和 Pinocchio 等多种开发框架。重点聚焦 DeFi 与支付领域(Light Token、Light-PDA)。此外,还可应用于空投与代币分发(压缩代币),以及用户/应用状态与零知识证明,助力支付与 ZK 应用的实现(压缩 PDA)。

SKILL.md
--- frontmatter
name: solana-rent-free-dev
description: >
  Skill for Solana development using rent-free primitives from Light Protocol.
  Covers client development (TypeScript, Rust) and program development (Rust) across Anchor, native Rust, and Pinocchio.
  Focus areas include DeFi and Payments (Light Token, Light-PDA). Other use cases include airdrops and token distribution (Compressed Token),
  and user/app state plus nullifiers for payments and ZK applications (Compressed PDA).
compatibility: >
  Requires ZK Compression CLI, Solana CLI, Anchor CLI, and Node.js.
allowed-tools:
  - mcp__zkcompression__SearchLightProtocol
  - WebFetch(https://zkcompression.com/*)
  - WebFetch(https://github.com/Lightprotocol/*)
primitives and use cases:
  - name: Light Token
    use_case: >
      Most token use cases (launchpads, DeFi, payments).
      Rent-free mint and token accounts.
      ~200x cheaper than SPL and more compute-unit efficient on the hot path.
  - name: Light-PDA
    use_case: >
      DeFi program state such as AMM pools and vaults.
      ~98% cheaper than PDAs.
      Auto-compress when inactive.
  - name: Compressed Token
    use_case: >
      Airdrops and token distribution only.
      Prefer Light Token for other purposes.
      Used by Light Token under the hood for rent-free storage of inactive Light Tokens.
      Supported by Phantom and Backpack.
    constraints: >
      Do not use for general-purpose token features.
      SDK is not maintained.
  - name: Compressed PDA
    use_case: >
      User state and app state, nullifiers (payments and ZK applications),
      DePIN nodes, and stake accounts.
      Similar to program-derived addresses without a rent-exempt balance.
    constraints: >
      Not for shared state, pool accounts, or config accounts.

Capabilities

Light Token allows agents to build scalable Solana applications with rent-free token and mint accounts and PDA's.

PrimitiveUse caseConstraints
Light TokenMost token use cases (launchpads, DeFi, payments). Rent-free mint and token accounts. ~200x cheaper than SPL and more compute-unit efficient on the hot path.
Light-PDADeFi program state such as AMM pools and vaults. ~98% cheaper than PDAs. Auto-compress when inactive.
Compressed TokenOnly for Airdrops and token distribution. Prefer Light Token for other purposes. Used by Light Token under the hood for rent-free storage of inactive Light Tokens. Supported by Phantom and Backpack.Do not use for general-purpose token features. SDK is not maintained.
Compressed PDAUser state and app state, nullifiers (payments and ZK applications), DePIN nodes, and stake accounts. Similar to program-derived addresses without a rent-exempt balance.Not for shared state, pool accounts, or config accounts.

Comparing creation cost and CU usage:

Light-TokenSPL-Token
Mint Account0.00001 SOL0.0015 SOL
Token Account0.00001 SOL0.002 SOL
ATA Creation4,348 CU14,194 CU
Transfer312 CU4,645 CU
Transfer (rent-free)1,885 CU4,645 CU

Install this reference skill:

bash
npx skills add https://zkcompression.com

Workflow

  1. Clarify intent
    • Recommend plan mode, if it's not activated
    • Use AskUserQuestion to resolve blind spots
    • All questions must be resolved before execution
  2. Identify references and skills
  3. Write plan file (YAML task format)
    • Use AskUserQuestion for anything unclear — never guess or assume
    • Identify blockers: permissions, dependencies, unknowns
    • Plan must be complete before execution begins
  4. Execute
    • Use Task tool with subagents for parallel research
    • Subagents load skills via Skill tool
    • Track progress with TodoWrite
  5. When stuck: spawn subagent with Read, Glob, Grep, DeepWiki MCP access and load skills/ask-mcp

Skills

Use caseSkill
Build DeFi programs (AMMs, vaults, lending) with Anchor or Pinocchiodefi-program
Integrate rent-free markets into routers and aggregatorsdefi-router
Stream account state via Laserstream gRPCdata-streaming
Wallets and payment flows with light-token. Includes privy, wallet adapter, mobile wallet adapter signing. Optional nullifier to prevent your onchain instruction from being executed more than once.payments-and-wallets
Airdrops, DePIN, token distributionairdrop
Anti-double-spend nullifiers for Privacy-preserving ZK programszk-nullifier
Testing programs and clients on localnet, devnet, mainnettesting
Help with Debugging and Questions via DeepWiki MCPask-mcp

Skills for compressed PDAs and more are in development.

Install to Claude Code

Add the marketplace and install:

code
/plugin marketplace add Lightprotocol/skills
/plugin install solana-rent-free-dev

All skills are included. Use them by name (/defi-program, /airdrop, /testing, etc.) or let Claude invoke them based on task context.

Install to Cursor

  1. Open Settings (Cmd+Shift+J / Ctrl+Shift+J)
  2. Navigate to Rules & CommandsProject RulesAdd RuleRemote Rule (GitHub)
  3. Enter: https://github.com/Lightprotocol/skills.git

Skills are auto-discovered based on context. Ask about light-token, defi, payments, or program migration and the agent uses the relevant skill automatically.

Install to Any Agent

code
npx skills add Lightprotocol/skills

Context

light-token

A token standard functionally equivalent to SPL that stores mint and token accounts more efficiently.

Mint accounts represent a unique mint and optionally store token-metadata. Functionally equivalent to SPL mints.

Token accounts hold balances from any light, SPL, or Token-2022 mint, without paying rent-exemption.

The token program pays rent-exemption cost for you. When an account has no remaining sponsored rent, the account is automatically compressed. Your tokens are cryptographically preserved as a compressed token account (rent-free). The account is loaded into hot account state in-flight when someone interacts with it again.

Use for: Launchpads, DeFi, token transfers, payments, ... .

light-PDA

The Light-SDK pays rent-exemption for your PDAs, token accounts, and mints (98% cost savings). Your program logic stays the same.

After extended inactivity (multiple epochs without writes), accounts auto-compress to cold state. Your program only interacts with hot accounts. Clients load cold accounts back on-chain via create_load_instructions.

AreaChange
State structDerive LightAccount, add compression_info: CompressionInfo
Accounts structDerive LightAccounts, add #[light_account] on init accounts
Program moduleAdd #[light_program] above #[program]
InstructionsNo changes

Use for: DeFi program state, AMM pools, vaults.

Compressed token (Only use for Token Distribution)

Compressed token accounts store token balance, owner, and other information of tokens like SPL and light-tokens. Compressed token accounts are rent-free. Any light-token or SPL token can be compressed/decompressed at will. Supported by Phantom and Backpack.

Only Use for: airdrops, token distribution without paying upfront rent per recipient.

Compressed PDA

Compressed PDAs are derived using a specific program address and seed, like regular PDAs. Custom programs invoke the Light System program to create and update accounts, instead of the System program.

Persistent unique identification. Program ownership. CPI between compressed and regular PDAs.

Use rent-free PDAs for: user state, app state, nullifiers for payments, DePIN node accounts, stake accounts, nullifiers for zk applications. Not for shared state, pool, and config accounts.

Guidelines

  • light-token ≠ compressed token. light-token is a Solana account in hot state. Compressed token is a compressed account, always compressed, rent-free.
  • light-PDA ≠ compressed PDA. light-PDA is a Solana PDA that transitions to compressed state when inactive. Compressed PDA is always compressed, derived like a PDA and requires a validity proof.
  • light-token accounts hold SPL and Token-2022 balances, not just light-mint balances.
  • When sponsored rent on a light-token or light-PDA runs out, the account compresses. It decompresses on next interaction.

Documentation and Examples

TypeScript Client (@lightprotocol/compressed-token)

OperationDocs guideGitHub example
createMintInterfacecreate-mintaction
createAtaInterfacecreate-ataaction | instruction
mintToInterfacemint-toaction | instruction
transferInterfacetransfer-interfaceaction | instruction
approveapprove-revokeaction
revokeapprove-revokeaction
wrapwrap-unwrapaction | instruction
unwrapwrap-unwrapaction | instruction
loadAtaload-ataaction | instruction

Rust Client (light_token_client)

Program (light_token)

Examples
Description
cp-swap-referenceFork of Raydium AMM that creates markets without paying rent-exemption
create-and-transferCreate account via macro and transfer via CPI
pinocchio-swapLight Token swap reference implementation
Macros
Description
counterCreate PDA with sponsored rent-exemption
create-ataCreate associated light-token account
create-mintCreate light-token mint
create-token-accountCreate light-token account
CPI Instructions

CPI calls can be combined with existing and/or light macros. The API is a superset of SPL-token.

OperationDocs guideGitHub example
CreateAssociatedAccountCpicreate-atasrc
CreateTokenAccountCpicreate-token-accountsrc
CreateMintCpicreate-mintsrc
MintToCpimint-tosrc
MintToCheckedCpimint-tosrc
BurnCpiburnsrc
TransferCheckedCpitransfer-checkedsrc
TransferInterfaceCpitransfer-interfacesrc
ApproveCpiapprove-revokesrc
RevokeCpiapprove-revokesrc
FreezeCpifreeze-thawsrc
ThawCpifreeze-thawsrc
CloseAccountCpiclose-token-accountsrc

General References

TypeScript SDK

Packagenpm
@lightprotocol/stateless.jsnpm
@lightprotocol/compressed-tokennpm

Rust Crates and SDK

Cratedocs.rs
light-sdkdocs.rs/light-sdk
light-sdk-pinocchiodocs.rs/light-sdk-pinocchio
light-tokendocs.rs/light-token
light-token-clientdocs.rs/light-token-client
light-compressed-token-sdkdocs.rs/light-compressed-token-sdk
light-clientdocs.rs/light-client
light-program-testdocs.rs/light-program-test
light-account-pinocchiodocs.rs/light-account-pinocchio
light-token-pinocchiodocs.rs/light-token-pinocchio
light-hasherdocs.rs/light-hasher
light-accountdocs.rs/light-account

For additional documentation and navigation, see: https://www.zkcompression.com/llms.txt For additional skills, see: https://www.zkcompression.com/ai-tools/skills