---description: Distribute compressed tokens via airdropallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Distribute compressed tokens via airdropContext:- Guide: https://zkcompression.com/compressed-tokens/token-distribution- Skills and resources index: https://zkcompression.com/skill.md- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/airdrop- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js, @solana/spl-token- Example repo: https://github.com/Lightprotocol/example-token-distribution- Webapp alternative: https://airship.helius.dev/ (Airship by Helius Labs, up to 200k recipients)Key APIs: LightTokenProgram.compress(), getTokenPoolInfos(), selectTokenPoolInfo(), getStateTreeInfos(), selectStateTreeInfo(), buildAndSignTx(), sendAndConfirmTx()### 1. Index project- Grep `LightTokenProgram|compress|getTokenPoolInfos|selectTokenPoolInfo|getStateTreeInfos|@lightprotocol|airdrop|distribution` across src/- Glob `**/*.ts` for project structure- Identify: existing airdrop/distribution logic, token minting setup, recipient list format- Check package.json for existing @lightprotocol/* or @solana/spl-token dependencies- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel### 2. Read references- WebFetch the guide above — review all three tabs (Localnet Guide, Simple Airdrop, Batched)- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: what scale? (<10k recipients = simple airdrop, 10k+ = batched)- AskUserQuestion: localnet testing first, or production deploy?- AskUserQuestion: do you have an existing SPL mint, or need to create one?- AskUserQuestion: do you need decompression/claim functionality, or just direct distribution?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan- For simple airdrop: create mint → mint SPL tokens → LightTokenProgram.compress() with recipients array- For batched: create instruction batches → manage blockhash refresh → sign and send with retry logic- Address lookup table needed for production (mainnet: 9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ)- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- Add deps if missing: Bash `npm install @lightprotocol/compressed-token @lightprotocol/stateless.js @solana/spl-token`- Set up RPC: `createRpc(RPC_ENDPOINT)` with a ZK Compression endpoint (Helius, Triton)- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Bash `tsc --noEmit`- Bash run existing test suite or execute localnet test airdrop- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Create rent-free nullifier PDAs to prevent duplicate actionsallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Create rent-free nullifier PDAs to prevent duplicate actionsContext:- Guide: https://zkcompression.com/compressed-pdas/nullifier-pda- Skills and resources index: https://zkcompression.com/skill.md- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier- Rust crates: light-nullifier-program, light-client- TS packages: @lightprotocol/nullifier-program, @lightprotocol/stateless.js- Example: https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs- Program source: https://github.com/Lightprotocol/nullifier-program/Key APIs:- Rust: create_nullifier_ix(), fetch_proof(), build_instruction(), derive_nullifier_address()- TS: createNullifierIx(), fetchProof(), buildInstruction(), deriveNullifierAddress()### 1. Index project- Grep `nullifier|create_nullifier|createNullifierIx|deriveNullifierAddress|NFLx5WGPrTHHvdRNsidcrNcLxRruMC92E4yv7zhZBoT` across src/- Glob `**/*.rs` and `**/*.ts` for project structure- Identify: existing transaction building, duplicate prevention logic, payment flow- Check Cargo.toml or package.json for existing light-* dependencies- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel### 2. Read references- WebFetch the guide above — review both Rust and TS code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: Rust or TypeScript?- AskUserQuestion: what is the goal? (prevent duplicate payments, idempotent instruction execution, other use case)- AskUserQuestion: do you need the helper (create_nullifier_ix) or manual proof fetching (fetch_proof + build_instruction)?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's pattern: create unique 32-byte ID → build nullifier instruction → prepend to transaction- If checking existence is needed, add derive_nullifier_address + get_compressed_account check- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- For Rust: Bash `cargo add light-nullifier-program@0.1 light-client@0.23`- For TypeScript: Bash `npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@^0.23.0`- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Rust: Bash `cargo check` + `cargo test` if tests exist- TypeScript: Bash `tsc --noEmit` + run existing test suite if present- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Write client code to interact with compressed PDA programsallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Write client code to interact with compressed PDA programsContext:- Guide: https://zkcompression.com/compressed-pdas/guides/client-guide- Skills and resources index: https://zkcompression.com/skill.md- TS packages: @lightprotocol/stateless.js, @lightprotocol/compressed-token, @solana/web3.js- Rust crates: light-client, light-sdk- TS example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create/tests- Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create/programs/create/tests- All operations: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchorKey APIs:- TS: createRpc(), deriveAddressSeedV2(), deriveAddressV2(), getValidityProofV0(), PackedAccounts, SystemAccountMetaConfig, getStateTreeInfos(), selectStateTreeInfo()- Rust: LightClientConfig, LightClient, derive_address(), get_validity_proof(), PackedAccounts, SystemAccountMetaConfig, get_random_state_tree_info()### 1. Index project- Grep `@lightprotocol|stateless\.js|createRpc|deriveAddress|getValidityProof|PackedAccounts|light_client|light_sdk|derive_address|get_validity_proof` across src/- Glob `**/*.ts` and `**/*.rs` for project structure- Identify: RPC setup, existing compressed account operations, program ID references- Check package.json or Cargo.toml for existing light-* dependencies- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel### 2. Read references- WebFetch the guide above — review both TypeScript and Rust code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: TypeScript or Rust?- AskUserQuestion: what is the goal? (new client from scratch, add client calls to existing project, migrate from regular accounts)- AskUserQuestion: which operations? (create only, full CRUD, specific subset like create + update)- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's step order: Setup → Address derivation → Validity proof → PackedAccounts → Instruction data → Build instruction → Send transaction- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- For TypeScript: Bash `npm install @lightprotocol/stateless.js @lightprotocol/compressed-token @solana/web3.js`- For Rust: Bash `cargo add light-client@0.23 light-sdk@0.23`- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- TypeScript: Bash `tsc --noEmit` + run existing test suite if present- Rust: Bash `cargo check` + `cargo test` if tests exist- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Build a program that creates compressed accounts with addressesallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Build a program that creates compressed accounts with addressesContext:- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-create-compressed-accounts- Skills and resources index: https://zkcompression.com/skill.md- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/createKey SDK API: LightAccount::new_init(), derive_address()### 1. Index project- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo|seeds|init|payer|space` across src/- Glob `**/*.rs` and `**/Cargo.toml` for project structure- Identify: program ID, existing instructions, account structs, framework (Anchor or native)- Read Cargo.toml — note existing dependencies and Solana SDK version- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel### 2. Read references- WebFetch the guide above — review both Anchor and Native Rust code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: what is the goal? (new program from scratch, add account creation to existing program, migrate from regular accounts)- AskUserQuestion: Anchor or Native Rust framework?- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Derive Address → Address Tree Check → Initialize Account → Light System Program CPI- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Bash `cargo build-sbf` or `anchor build`- Bash `cargo test-sbf` or `anchor test` if tests exist- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Build a program that updates compressed accountsallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Build a program that updates compressed accountsContext:- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-update-compressed-accounts- Skills and resources index: https://zkcompression.com/skill.md- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/update- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/updateKey SDK API: LightAccount::new_mut()### 1. Index project- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo|mut|update|modify` across src/- Glob `**/*.rs` and `**/Cargo.toml` for project structure- Identify: program ID, existing instructions, account structs, framework (Anchor or native)- Read Cargo.toml — note existing dependencies and Solana SDK version- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel### 2. Read references- WebFetch the guide above — review both Anchor and Native Rust code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: what is the goal? (new program from scratch, add account update to existing program, migrate from regular accounts)- AskUserQuestion: Anchor or Native Rust framework?- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Update Compressed Account → Light System Program CPI- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Bash `cargo build-sbf` or `anchor build`- Bash `cargo test-sbf` or `anchor test` if tests exist- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Build a program that closes compressed accountsallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Build a program that closes compressed accountsContext:- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-close-compressed-accounts- Skills and resources index: https://zkcompression.com/skill.md- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/close- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/closeKey SDK API: LightAccount::new_close()### 1. Index project- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo|close|delete|remove` across src/- Glob `**/*.rs` and `**/Cargo.toml` for project structure- Identify: program ID, existing instructions, account structs, framework (Anchor or native)- Read Cargo.toml — note existing dependencies and Solana SDK version- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel### 2. Read references- WebFetch the guide above — review both Anchor and Native Rust code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: what is the goal? (new program from scratch, add account close to existing program, migrate from regular accounts)- AskUserQuestion: Anchor or Native Rust framework?- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Close Compressed Account → Light System Program CPI- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Bash `cargo build-sbf` or `anchor build`- Bash `cargo test-sbf` or `anchor test` if tests exist- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Build a program that reinitializes closed compressed accountsallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Build a program that reinitializes closed compressed accountsContext:- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-reinitialize-compressed-accounts- Skills and resources index: https://zkcompression.com/skill.md- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/reinit- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/reinitKey SDK API: LightAccount::new_empty()### 1. Index project- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo|reinit|empty|reset` across src/- Glob `**/*.rs` and `**/Cargo.toml` for project structure- Identify: program ID, existing instructions, account structs, framework (Anchor or native)- Read Cargo.toml — note existing dependencies and Solana SDK version- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel### 2. Read references- WebFetch the guide above — review both Anchor and Native Rust code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: what is the goal? (new program from scratch, add account reinitialization to existing program, migrate from regular accounts)- AskUserQuestion: Anchor or Native Rust framework?- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Reinitialize Closed Account → Light System Program CPI- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Bash `cargo build-sbf` or `anchor build`- Bash `cargo test-sbf` or `anchor test` if tests exist- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---description: Build a program that permanently burns compressed accountsallowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression---## Build a program that permanently burns compressed accountsContext:- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-burn-compressed-accounts- Skills and resources index: https://zkcompression.com/skill.md- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/burn- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/burnKey SDK API: LightAccount::new_burn()### 1. Index project- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo|burn|destroy|permanent` across src/- Glob `**/*.rs` and `**/Cargo.toml` for project structure- Identify: program ID, existing instructions, account structs, framework (Anchor or native)- Read Cargo.toml — note existing dependencies and Solana SDK version- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel### 2. Read references- WebFetch the guide above — review both Anchor and Native Rust code samples- WebFetch skill.md — check for a dedicated skill and resources matching this task- TaskCreate one todo per phase below to track progress### 3. Clarify intention- AskUserQuestion: what is the goal? (new program from scratch, add account burn to existing program, migrate from regular accounts)- AskUserQuestion: Anchor or Native Rust framework?- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?- Summarize findings and wait for user confirmation before implementing### 4. Create plan- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Burn Compressed Account → Light System Program CPI- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)- Present the plan to the user for approval before proceeding### 5. Implement- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)- Follow the guide and the approved plan- Write/Edit to create or modify files- TaskUpdate to mark each step done### 6. Verify- Bash `cargo build-sbf` or `anchor build`- Bash `cargo test-sbf` or `anchor test` if tests exist- TaskUpdate to mark complete### Tools- mcp__zkcompression__SearchLightProtocol("<query>") for API details- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "<q>") for architecture- Task subagent with Grep/Read/WebFetch for parallel lookups- TaskList to check remaining work
---argument-hint: <path_to_program>description: Migrate Light Protocol program from v1 to v2 Merkle treesallowed-tools: [Bash, Read, Glob, Grep, Task, WebFetch]---Migrate this Light Protocol program from v1 to v2 Merkle trees.## GoalProduce a **fully working migration** that builds and tests pass.## Available commandsVia Bash tool:- **cargo build-sbf**, **cargo test-sbf**, **cargo fmt**, **cargo clippy**- **anchor build**, **anchor test**- **grep**, **sed**## Documentation- Migration Guide: https://zkcompression.com/references/migration-v1-to-v2- Reference PR: https://github.com/Lightprotocol/program-examples/commit/54f0e7f15c2972a078f776cfb40b238d83c7e486## Reference reposprogram-examples/counter/anchor/├── programs/counter/src/lib.rs # v2 patterns: derive_address, CpiAccounts├── Cargo.toml # v2 feature flags└── tests/counter.ts # v2 client patterns## Workflow### Phase 1: Index programFind all v1 patterns: grep -r "::v1::" src/ tests/ grep -r "ADDRESS_TREE_V1" src/ grep -r "into_new_address_params_packed" src/ grep -r "get_address_tree_v1" tests/### Phase 2: Update dependenciesUpdate Cargo.toml. V2 is the default - no feature flag needed: # On-chain program [dependencies] light-sdk = { version = "0.17.1", features = ["anchor"] } light-hasher = "5.0.0" # Off-chain client [dependencies] light-client = "0.17.2"Note: V2 is now the default in all crates. Only specify `features = ["v2"]` if you disabled default features.### Phase 3: Rust SDK replacements| v1 Pattern | v2 Replacement ||------------|----------------|| address::v1::derive_address | address::v2::derive_address || cpi::v1::CpiAccounts | cpi::v2::CpiAccounts || cpi::v1::LightSystemProgramCpi | cpi::v2::LightSystemProgramCpi || constants::ADDRESS_TREE_V1 | constants::ADDRESS_TREE_V2 || .into_new_address_params_packed(seed) | .into_new_address_params_assigned_packed(seed, Some(0)) || .add_system_accounts(config) | .add_system_accounts_v2(config) |### Phase 4: TypeScript SDK replacements| v1 Pattern | v2 Replacement ||------------|----------------|| deriveAddress( | deriveAddressV2( || deriveAddressSeed( | deriveAddressSeedV2( || defaultTestStateTreeAccounts().addressTree | batchAddressTree || .newWithSystemAccounts( | .newWithSystemAccountsV2( || get_address_tree_v1() | get_address_tree_v2() || get_random_state_tree_info_v1() | get_random_state_tree_info() |### Phase 5: Build and test loop**Required commands (no shortcuts):**For Anchor programs: **anchor build && anchor test**For Native programs: **cargo build-sbf && cargo test-sbf****NO shortcuts allowed:**- Do NOT use **cargo build** (must use **cargo build-sbf**)- Do NOT use **cargo test** (must use **cargo test-sbf**)- Tests MUST run against real BPF bytecode**On failure:** Spawn debugger agent with error context.**Loop rules:**1. Each debugger gets fresh context + previous debug reports2. Each attempt tries something DIFFERENT3. **NEVER GIVE UP** - keep spawning until fixedDo NOT proceed until all tests pass.## DeepWiki fallbackIf no matching pattern in reference repos: mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "How to migrate {pattern} from v1 to v2?")
Was this page helpful?
⌘I
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"ZK Compression","colors":{"primary":"#0066FF","light":"#0066FF","dark":"#0066FF"},"logo":{"light":"https://mintcdn.com/luminouslabs-cc5545c6/o2wSuvcZYm5eZigT/logo/logo-black.svg?fit=max\u0026auto=format\u0026n=o2wSuvcZYm5eZigT\u0026q=85\u0026s=87a586338301c7d57a53dada00c77620","dark":"https://mintcdn.com/luminouslabs-cc5545c6/1Ne0mlq7dlmZQxaF/logo/logo-white.svg?fit=max\u0026auto=format\u0026n=1Ne0mlq7dlmZQxaF\u0026q=85\u0026s=c0c2cb190bc532da4ef905e8c7bfa391"},"favicon":"https://mintcdn.com/luminouslabs-cc5545c6/6lRTdZmrqTTw-TED/favicon.png?fit=max\u0026auto=format\u0026n=6lRTdZmrqTTw-TED\u0026q=85\u0026s=877e87eb15e99e8a1bbe9b84247fb014","api":{"playground":{"display":"interactive"},"examples":{"defaults":"all","languages":["curl","javascript","python"],"prefill":true}},"appearance":{"default":"light"},"navbar":{"links":[{"icon":"megaphone","href":"https://github.com/Lightprotocol/light-protocol/releases","label":"Changelog"},{"icon":"github","href":"https://github.com/Lightprotocol","label":"GitHub"}]},"footer":{"socials":{"x":"https://x.com/lightprotocol","github":"https://github.com/Lightprotocol/light-protocol","discord":"https://discord.com/invite/CYvjBgzRFP"}},"seo":{"metatags":{"keywords":"payments, stablecoins, solana tokens, rent, spl token, token 2022, light protocol, zk compression, rent-free accounts on solana, scalable solana infrastructure, solana AI agent, cursor MCP, claude code solana, agent skills light protocol, AI coding agent solana"}},"fonts":{"family":"Inter"},"banner":{"content":"Light is joining Helius. [Read the announcement.](https://www.helius.dev/blog/light-protocol-acquisition)","dismissible":false,"color":{"light":"#E84125","dark":"#E84125"}},"contextual":{"options":["mcp",{"title":"Open DeepWiki","description":"Ask Devin for help with debugging","icon":"/images/deepwiki-logo.svg","href":{"base":"https://deepwiki.com/Lightprotocol/light-protocol","query":[{"key":"context","value":"$page"}]}},"chatgpt","claude","perplexity","cursor","vscode","copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"luminouslabs-cc5545c6","hasAudioNarration":false,"actualSubdomain":"luminouslabs-cc5545c6","customDomains":["www.zkcompression.com"],"gitSource":{"type":"github","owner":"lightprotocol","repo":"docs-v2","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"}},"buildId":"6ae9418af4916fe06c075174:success","clientVersion":"0.0.4342","searchFilterCounts":[{"language":"default","tag":"Documentation","count":39},{"language":"default","tag":"API \u0026 SDK Reference","count":23},{"language":"default","tag":"JSON RPC Methods","count":22},{"language":"default","tag":"Compressed Tokens","count":15},{"language":"default","tag":"Compressed PDA","count":11},{"language":"default","tag":"Cookbook","count":10},{"language":"default","tag":"AI Tools","count":8},{"language":"default","tag":"Program Guides","count":6},{"language":"default","tag":"Learn","count":5},{"language":"default","tag":"Core Concepts","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"friends@lightprotocol.com","showHelpButton":true}},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"69a5e7ba2996e2acc42c2668","deploymentId":"690f5a275ae105d6ccd8b838","questionText":"How do Light Token API's compare to SPL and Token 2022?","status":"active","generatedBy":"manual","createdAt":"2026-03-02T19:40:42.778Z","updatedAt":"2026-03-02T19:40:42.778Z","__v":0},{"_id":"69a5e7aa2996e2acc42c261a","deploymentId":"690f5a275ae105d6ccd8b838","questionText":"How do payment flows work with Light Token?","status":"active","generatedBy":"manual","createdAt":"2026-03-02T19:40:26.198Z","updatedAt":"2026-03-23T16:02:43.629Z","__v":0},{"_id":"6931789e9bf34aa166174567","deploymentId":"690f5a275ae105d6ccd8b838","questionText":"Where can I find agent skills?","status":"active","generatedBy":"manual","createdAt":"2025-12-04T12:03:42.450Z","updatedAt":"2026-03-02T19:40:04.971Z","__v":0}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-track{background:rgba(0, 0, 0, 0.02);border-radius:10px;margin:4px}::-webkit-scrollbar-thumb{background:linear-gradient(\n 135deg,\n rgba(0, 102, 255, 0.3) 0%,\n rgba(51, 136, 255, 0.5) 50%,\n rgba(0, 102, 255, 0.3) 100%\n );border-radius:10px;border:2px solid rgba(255, 255, 255, 0.1);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 2px 8px rgba(0, 102, 255, 0.2),\n inset 0 1px 1px rgba(255, 255, 255, 0.3);transition:all 0.3s ease}::-webkit-scrollbar-thumb:hover{background:linear-gradient(\n 135deg,\n rgba(0, 102, 255, 0.5) 0%,\n rgba(51, 136, 255, 0.7) 50%,\n rgba(0, 102, 255, 0.5) 100%\n );box-shadow:0 4px 12px rgba(0, 102, 255, 0.4),\n inset 0 1px 1px rgba(255, 255, 255, 0.5);transform:scale(1.05)}::-webkit-scrollbar-thumb:active{background:linear-gradient(\n 135deg,\n rgba(0, 68, 204, 0.6) 0%,\n rgba(0, 102, 255, 0.8) 50%,\n rgba(0, 68, 204, 0.6) 100%\n )}*{scrollbar-width:thin;scrollbar-color:rgba(0, 102, 255, 0.4) rgba(0, 0, 0, 0.02)}@media (prefers-color-scheme: dark){::-webkit-scrollbar-track{background:rgba(255, 255, 255, 0.03)}::-webkit-scrollbar-thumb{background:linear-gradient(\n 135deg,\n rgba(0, 102, 255, 0.4) 0%,\n rgba(51, 136, 255, 0.6) 50%,\n rgba(0, 102, 255, 0.4) 100%\n );border:2px solid rgba(255, 255, 255, 0.05);box-shadow:0 2px 8px rgba(0, 102, 255, 0.3),\n inset 0 1px 1px rgba(255, 255, 255, 0.2)}::-webkit-scrollbar-thumb:hover{background:linear-gradient(\n 135deg,\n rgba(0, 102, 255, 0.6) 0%,\n rgba(51, 136, 255, 0.8) 50%,\n rgba(0, 102, 255, 0.6) 100%\n );box-shadow:0 4px 12px rgba(0, 102, 255, 0.5),\n inset 0 1px 1px rgba(255, 255, 255, 0.3)}}[data-testid=\"toc-scroll-container\"]::-webkit-scrollbar{width:10px}[data-testid=\"toc-scroll-container\"]::-webkit-scrollbar-thumb{background:linear-gradient(\n 180deg,\n rgba(0, 102, 255, 0.35) 0%,\n rgba(51, 136, 255, 0.55) 50%,\n rgba(0, 102, 255, 0.35) 100%\n )}[class*=\"callout\"][class*=\"note\"],.note,[data-callout=\"note\"]{background:rgba(148, 163, 184, 0.1)!important;border-color:rgba(148, 163, 184, 0.3)!important}[class*=\"callout\"][class*=\"tip\"],.tip,[data-callout=\"tip\"]{background:rgba(99, 102, 241, 0.08)!important;border-color:rgba(99, 102, 241, 0.25)!important}[class*=\"callout\"][class*=\"warning\"],.warning,[data-callout=\"warning\"]{background:rgba(245, 158, 11, 0.08)!important;border-color:rgba(245, 158, 11, 0.3)!important}[class*=\"callout\"][class*=\"info\"],.info,[data-callout=\"info\"]{background:rgba(71, 85, 105, 0.08)!important;border-color:rgba(71, 85, 105, 0.25)!important}[class*=\"callout\"][class*=\"success\"],[class*=\"callout\"][class*=\"check\"],.success,.check,[data-callout=\"success\"],[data-callout=\"check\"]{background:rgba(34, 197, 94, 0.08)!important;border-color:rgba(34, 197, 94, 0.3)!important}[class*=\"callout\"][class*=\"danger\"],[class*=\"callout\"][class*=\"error\"],.danger,.error,[data-callout=\"danger\"],[data-callout=\"error\"]{background:rgba(239, 68, 68, 0.08)!important;border-color:rgba(239, 68, 68, 0.3)!important}@keyframes fadeIn{from{opacity:0}to{opacity:1}}article,[data-testid=\"content\"],main>div:first-child{animation:fadeIn 0.6s ease-out}"},{"filePath":"style.css","content":"html{font-family:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif}body,h1,h2,h3,h4,h5,h6,p,span,div,a,button{font-family:inherit}*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}@keyframes cubePulse{0%{transform:scale(0.85);opacity:0.2}20%{transform:scale(1);opacity:0.6}80%{transform:scale(1);opacity:0.6}100%{transform:scale(0.85);opacity:0.2}}.hero-cube-grid{position:absolute;inset:0;pointer-events:none;--grid-bg-start: #f8fafc;--grid-bg-end: #f1f5f9;--tile-fill: #e2e8f0;--tile-stroke: #0066ff}html.dark .hero-cube-grid{--grid-bg-start: #0f172a;--grid-bg-end: #1e293b;--tile-fill: #334155;--tile-stroke: #3b82f6}.hero-cube-grid svg{width:100%;height:100%}.hero-cube-grid .grid-bg-start{stop-color:var(--grid-bg-start)}.hero-cube-grid .grid-bg-end{stop-color:var(--grid-bg-end)}.hero-cube-grid .tile-fill{fill:var(--tile-fill)}.hero-cube-grid .tile-stroke{stroke:var(--tile-stroke)}.cube-tile{transform-box:fill-box;transform-origin:center;transform:scale(0.85);opacity:0.2;animation:cubePulse 5s ease-in-out infinite backwards}.glass-pill{position:relative;display:inline-block;transform-style:preserve-3d;perspective:1000px;max-width:calc(100vw - 48px);margin:0 auto}.glass-pill-bg{position:absolute;inset:-20px -28px;z-index:0;border-radius:9999px;overflow:hidden;background:transparent;backdrop-filter:blur(1px) saturate(120%);-webkit-backdrop-filter:blur(1px) saturate(120%);border:1px solid rgba(255, 255, 255, 0.35);box-shadow:0 4px 20px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.25)}html.dark .glass-pill-bg{border:1px solid rgba(255, 255, 255, 0.12);box-shadow:0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08)}@media (min-width: 640px){.glass-pill-bg{inset:-22px -44px}}@media (min-width: 768px){.glass-pill-bg{inset:-28px -64px}}.glass-pill-bg::before{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(\n 135deg,\n rgba(255, 255, 255, 0.20) 0%,\n transparent 30%,\n transparent 100%\n );pointer-events:none}.glass-pill-bg::after{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(\n to bottom,\n transparent 70%,\n rgba(0, 0, 0, 0.06) 100%\n );pointer-events:none}html.dark .glass-pill-bg::before{background:linear-gradient(\n 135deg,\n rgba(255, 255, 255, 0.08) 0%,\n transparent 30%,\n transparent 100%\n )}html.dark .glass-pill-bg::after{background:linear-gradient(\n to bottom,\n transparent 70%,\n rgba(0, 0, 0, 0.2) 100%\n )}.glass-pill-inner{position:absolute;inset:1px;border-radius:inherit;border:1px solid rgba(255, 255, 255, 0.18);background:transparent;pointer-events:none}html.dark .glass-pill-inner{border:1px solid rgba(255, 255, 255, 0.06)}.glass-pill-content{position:relative;z-index:1}.hero-title{font-size:1.25rem;font-weight:500;color:#111827;margin:0;white-space:nowrap}html.dark .hero-title{color:#f9fafb}@media (min-width: 400px){.hero-title{font-size:1.5rem}}@media (min-width: 500px){.hero-title{font-size:1.875rem}}@media (min-width: 640px){.hero-title{font-size:2.25rem}}@media (min-width: 768px){.hero-title{font-size:2.75rem}}@media (min-width: 1024px){.hero-title{font-size:3rem}}.partner-logos{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:6px;pointer-events:none}.partner-logos img{height:18px;width:auto}.partner-divider{color:#9ca3af;font-size:10px}@media (min-width: 640px){.partner-logos{gap:20px;margin-top:10px}.partner-logos img{height:22px}.partner-divider{font-size:11px}}@media (min-width: 768px){.partner-logos{gap:24px;margin-top:14px}.partner-logos img{height:26px}.partner-divider{font-size:12px}}.light-wordmark{filter:invert(1)}html.dark .light-wordmark{filter:none}.logo-dark{display:none}html.dark .logo-light{display:none}html.dark .logo-dark{display:block}html.dark .partner-divider{color:#6b7280}"},{"filePath":"custom.css","content":"#pagination{display:none}.pagination-next,.pagination-prev,.pagination-title{display:none}#Sidebar{display:flex!important;flex-direction:column!important;justify-content:space-between!important}.nav-anchors{order:999!important;margin-top:auto!important;padding-top:1rem!important;border-top:1px solid rgba(0, 0, 0, 0.1)!important}#navbar img[alt*=\"logo\"],#navbar img[src*=\"logo\"],nav img[alt*=\"logo\"],nav img[src*=\"logo\"],header img[alt*=\"logo\"],header img[src*=\"logo\"]{height:auto!important;max-height:52px!important;width:auto!important}footer img[alt*=\"logo\"],footer img[src*=\"logo\"]{height:auto!important;width:auto!important}footer.docs-footer{border-top:1px solid #e5e7eb}html.dark footer.docs-footer{border-top-color:#1f2937}"}]}
{"page":{"pagePath":"ai-tools/prompts","slug":"/ai-tools/prompts","pageMetadata":{"title":"AI Prompts","description":"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.","keywords":["AI prompts solana","AI coding prompts light protocol","solana agent prompts","cursor prompts solana","claude code solana prompts","compressed token AI prompts"],"href":"/ai-tools/prompts"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Accordion,CodeBlock,Heading,Prompt}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Prompt)_missingMdxReference(`Prompt`,true);return _jsxs(_Fragment,{children:[`\n`,_jsx(Heading,{level:`2`,id:`token-distribution`,children:`Token Distribution`}),`\n`,_jsxs(Accordion,{title:`Token distribution`,id:`token-distribution`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-tokens/token-distribution`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Distribute compressed tokens via airdrop`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Distribute compressed tokens via airdrop\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Distribute compressed tokens via airdrop\n\n Context:\n - Guide: https://zkcompression.com/compressed-tokens/token-distribution\n - Skills and resources index: https://zkcompression.com/skill.md\n - Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/airdrop\n - Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js, @solana/spl-token\n - Example repo: https://github.com/Lightprotocol/example-token-distribution\n - Webapp alternative: https://airship.helius.dev/ (Airship by Helius Labs, up to 200k recipients)\n\n Key APIs: LightTokenProgram.compress(), getTokenPoolInfos(), selectTokenPoolInfo(), getStateTreeInfos(), selectStateTreeInfo(), buildAndSignTx(), sendAndConfirmTx()\n\n ### 1. Index project\n - Grep \\\\\\`LightTokenProgram|compress|getTokenPoolInfos|selectTokenPoolInfo|getStateTreeInfos|@lightprotocol|airdrop|distribution\\\\\\` across src/\n - Glob \\\\\\`**/*.ts\\\\\\` for project structure\n - Identify: existing airdrop/distribution logic, token minting setup, recipient list format\n - Check package.json for existing @lightprotocol/* or @solana/spl-token dependencies\n - Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review all three tabs (Localnet Guide, Simple Airdrop, Batched)\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: what scale? (\u003c10k recipients = simple airdrop, 10k+ = batched)\n - AskUserQuestion: localnet testing first, or production deploy?\n - AskUserQuestion: do you have an existing SPL mint, or need to create one?\n - AskUserQuestion: do you need decompression/claim functionality, or just direct distribution?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan\n - For simple airdrop: create mint → mint SPL tokens → LightTokenProgram.compress() with recipients array\n - For batched: create instruction batches → manage blockhash refresh → sign and send with retry logic\n - Address lookup table needed for production (mainnet: 9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ)\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - Add deps if missing: Bash \\\\\\`npm install @lightprotocol/compressed-token @lightprotocol/stateless.js @solana/spl-token\\\\\\`\n - Set up RPC: \\\\\\`createRpc(RPC_ENDPOINT)\\\\\\` with a ZK Compression endpoint (Helius, Triton)\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Bash \\\\\\`tsc --noEmit\\\\\\`\n - Bash run existing test suite or execute localnet test airdrop\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`62`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`62`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Distribute compressed tokens via airdrop`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Distribute compressed tokens via airdrop`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-tokens/token-distribution`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/airdrop`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js, @solana/spl-token`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Example repo: https://github.com/Lightprotocol/example-token-distribution`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Webapp alternative: https://airship.helius.dev/ (Airship by Helius Labs, up to 200k recipients)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key APIs: LightTokenProgram.compress(), getTokenPoolInfos(), selectTokenPoolInfo(), getStateTreeInfos(), selectStateTreeInfo(), buildAndSignTx(), sendAndConfirmTx()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `LightTokenProgram|compress|getTokenPoolInfos|selectTokenPoolInfo|getStateTreeInfos|@lightprotocol|airdrop|distribution` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.ts` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: existing airdrop/distribution logic, token minting setup, recipient list format`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Check package.json for existing @lightprotocol/* or @solana/spl-token dependencies`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review all three tabs (Localnet Guide, Simple Airdrop, Batched)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what scale? (\u003c10k recipients = simple airdrop, 10k+ = batched)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: localnet testing first, or production deploy?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: do you have an existing SPL mint, or need to create one?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: do you need decompression/claim functionality, or just direct distribution?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- For simple airdrop: create mint → mint SPL tokens → LightTokenProgram.compress() with recipients array`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- For batched: create instruction batches → manage blockhash refresh → sign and send with retry logic`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Address lookup table needed for production (mainnet: 9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Add deps if missing: Bash `npm install @lightprotocol/compressed-token @lightprotocol/stateless.js @solana/spl-token`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Set up RPC: `createRpc(RPC_ENDPOINT)` with a ZK Compression endpoint (Helius, Triton)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `tsc --noEmit`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Bash run existing test suite or execute localnet test airdrop`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`compressed-pda`,children:`Compressed PDA`}),`\n`,_jsxs(Accordion,{title:`Nullifier PDAs`,id:`nullifier-pdas`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/nullifier-pda`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Create rent-free nullifier PDAs to prevent duplicate actions`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Create rent-free nullifier PDAs to prevent duplicate actions\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Create rent-free nullifier PDAs to prevent duplicate actions\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/nullifier-pda\n - Skills and resources index: https://zkcompression.com/skill.md\n - Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier\n - Rust crates: light-nullifier-program, light-client\n - TS packages: @lightprotocol/nullifier-program, @lightprotocol/stateless.js\n - Example: https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs\n - Program source: https://github.com/Lightprotocol/nullifier-program/\n\n Key APIs:\n - Rust: create_nullifier_ix(), fetch_proof(), build_instruction(), derive_nullifier_address()\n - TS: createNullifierIx(), fetchProof(), buildInstruction(), deriveNullifierAddress()\n\n ### 1. Index project\n - Grep \\\\\\`nullifier|create_nullifier|createNullifierIx|deriveNullifierAddress|NFLx5WGPrTHHvdRNsidcrNcLxRruMC92E4yv7zhZBoT\\\\\\` across src/\n - Glob \\\\\\`**/*.rs\\\\\\` and \\\\\\`**/*.ts\\\\\\` for project structure\n - Identify: existing transaction building, duplicate prevention logic, payment flow\n - Check Cargo.toml or package.json for existing light-* dependencies\n - Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both Rust and TS code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: Rust or TypeScript?\n - AskUserQuestion: what is the goal? (prevent duplicate payments, idempotent instruction execution, other use case)\n - AskUserQuestion: do you need the helper (create_nullifier_ix) or manual proof fetching (fetch_proof + build_instruction)?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's pattern: create unique 32-byte ID → build nullifier instruction → prepend to transaction\n - If checking existence is needed, add derive_nullifier_address + get_compressed_account check\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - For Rust: Bash \\\\\\`cargo add light-nullifier-program@0.1 light-client@0.23\\\\\\`\n - For TypeScript: Bash \\\\\\`npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@^0.23.0\\\\\\`\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Rust: Bash \\\\\\`cargo check\\\\\\` + \\\\\\`cargo test\\\\\\` if tests exist\n - TypeScript: Bash \\\\\\`tsc --noEmit\\\\\\` + run existing test suite if present\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`63`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`63`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Create rent-free nullifier PDAs to prevent duplicate actions`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Create rent-free nullifier PDAs to prevent duplicate actions`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/nullifier-pda`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Rust crates: light-nullifier-program, light-client`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TS packages: @lightprotocol/nullifier-program, @lightprotocol/stateless.js`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Example: https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Program source: https://github.com/Lightprotocol/nullifier-program/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key APIs:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Rust: create_nullifier_ix(), fetch_proof(), build_instruction(), derive_nullifier_address()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TS: createNullifierIx(), fetchProof(), buildInstruction(), deriveNullifierAddress()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `nullifier|create_nullifier|createNullifierIx|deriveNullifierAddress|NFLx5WGPrTHHvdRNsidcrNcLxRruMC92E4yv7zhZBoT` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.rs` and `**/*.ts` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: existing transaction building, duplicate prevention logic, payment flow`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Check Cargo.toml or package.json for existing light-* dependencies`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both Rust and TS code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: Rust or TypeScript?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (prevent duplicate payments, idempotent instruction execution, other use case)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: do you need the helper (create_nullifier_ix) or manual proof fetching (fetch_proof + build_instruction)?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's pattern: create unique 32-byte ID → build nullifier instruction → prepend to transaction`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If checking existence is needed, add derive_nullifier_address + get_compressed_account check`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- For Rust: Bash `cargo add light-nullifier-program@0.1 light-client@0.23`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- For TypeScript: Bash `npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@^0.23.0`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Rust: Bash `cargo check` + `cargo test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- TypeScript: Bash `tsc --noEmit` + run existing test suite if present\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`Client guide (TypeScript \u0026 Rust)`,id:`client-guide-typescript-and-rust`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/guides/client-guide`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Write client code to interact with compressed PDA programs`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Write client code to interact with compressed PDA programs\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Write client code to interact with compressed PDA programs\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/guides/client-guide\n - Skills and resources index: https://zkcompression.com/skill.md\n - TS packages: @lightprotocol/stateless.js, @lightprotocol/compressed-token, @solana/web3.js\n - Rust crates: light-client, light-sdk\n - TS example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create/tests\n - Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create/programs/create/tests\n - All operations: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor\n\n Key APIs:\n - TS: createRpc(), deriveAddressSeedV2(), deriveAddressV2(), getValidityProofV0(), PackedAccounts, SystemAccountMetaConfig, getStateTreeInfos(), selectStateTreeInfo()\n - Rust: LightClientConfig, LightClient, derive_address(), get_validity_proof(), PackedAccounts, SystemAccountMetaConfig, get_random_state_tree_info()\n\n ### 1. Index project\n - Grep \\\\\\`@lightprotocol|stateless\\\\.js|createRpc|deriveAddress|getValidityProof|PackedAccounts|light_client|light_sdk|derive_address|get_validity_proof\\\\\\` across src/\n - Glob \\\\\\`**/*.ts\\\\\\` and \\\\\\`**/*.rs\\\\\\` for project structure\n - Identify: RPC setup, existing compressed account operations, program ID references\n - Check package.json or Cargo.toml for existing light-* dependencies\n - Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both TypeScript and Rust code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: TypeScript or Rust?\n - AskUserQuestion: what is the goal? (new client from scratch, add client calls to existing project, migrate from regular accounts)\n - AskUserQuestion: which operations? (create only, full CRUD, specific subset like create + update)\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's step order: Setup → Address derivation → Validity proof → PackedAccounts → Instruction data → Build instruction → Send transaction\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - For TypeScript: Bash \\\\\\`npm install @lightprotocol/stateless.js @lightprotocol/compressed-token @solana/web3.js\\\\\\`\n - For Rust: Bash \\\\\\`cargo add light-client@0.23 light-sdk@0.23\\\\\\`\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - TypeScript: Bash \\\\\\`tsc --noEmit\\\\\\` + run existing test suite if present\n - Rust: Bash \\\\\\`cargo check\\\\\\` + \\\\\\`cargo test\\\\\\` if tests exist\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`62`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`62`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Write client code to interact with compressed PDA programs`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Write client code to interact with compressed PDA programs`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/guides/client-guide`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TS packages: @lightprotocol/stateless.js, @lightprotocol/compressed-token, @solana/web3.js`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Rust crates: light-client, light-sdk`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TS example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create/tests`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create/programs/create/tests`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- All operations: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key APIs:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TS: createRpc(), deriveAddressSeedV2(), deriveAddressV2(), getValidityProofV0(), PackedAccounts, SystemAccountMetaConfig, getStateTreeInfos(), selectStateTreeInfo()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Rust: LightClientConfig, LightClient, derive_address(), get_validity_proof(), PackedAccounts, SystemAccountMetaConfig, get_random_state_tree_info()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `@lightprotocol|stateless\\\\.js|createRpc|deriveAddress|getValidityProof|PackedAccounts|light_client|light_sdk|derive_address|get_validity_proof` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.ts` and `**/*.rs` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: RPC setup, existing compressed account operations, program ID references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Check package.json or Cargo.toml for existing light-* dependencies`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both TypeScript and Rust code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: TypeScript or Rust?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (new client from scratch, add client calls to existing project, migrate from regular accounts)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: which operations? (create only, full CRUD, specific subset like create + update)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's step order: Setup → Address derivation → Validity proof → PackedAccounts → Instruction data → Build instruction → Send transaction`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- For TypeScript: Bash `npm install @lightprotocol/stateless.js @lightprotocol/compressed-token @solana/web3.js`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- For Rust: Bash `cargo add light-client@0.23 light-sdk@0.23`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- TypeScript: Bash `tsc --noEmit` + run existing test suite if present\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Rust: Bash `cargo check` + `cargo test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`Create compressed accounts`,id:`create-compressed-accounts`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/guides/how-to-create-compressed-accounts`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Build a program that creates compressed accounts with addresses`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Build a program that creates compressed accounts with addresses\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Build a program that creates compressed accounts with addresses\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/guides/how-to-create-compressed-accounts\n - Skills and resources index: https://zkcompression.com/skill.md\n - Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)\n - Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create\n - Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/create\n\n Key SDK API: LightAccount::new_init(), derive_address()\n\n ### 1. Index project\n - Grep \\\\\\`declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|seeds|init|payer|space\\\\\\` across src/\n - Glob \\\\\\`**/*.rs\\\\\\` and \\\\\\`**/Cargo.toml\\\\\\` for project structure\n - Identify: program ID, existing instructions, account structs, framework (Anchor or native)\n - Read Cargo.toml — note existing dependencies and Solana SDK version\n - Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both Anchor and Native Rust code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: what is the goal? (new program from scratch, add account creation to existing program, migrate from regular accounts)\n - AskUserQuestion: Anchor or Native Rust framework?\n - AskUserQuestion: does the program already have compressed account instructions, or is this the first one?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Derive Address → Address Tree Check → Initialize Account → Light System Program CPI\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - Add deps: Bash \\\\\\`cargo add light-sdk@0.23\\\\\\` (add \\\\\\`anchor_lang@0.31\\\\\\` for Anchor or \\\\\\`solana-program@2.2\\\\\\` + \\\\\\`borsh@0.10\\\\\\` for Native Rust)\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Bash \\\\\\`cargo build-sbf\\\\\\` or \\\\\\`anchor build\\\\\\`\n - Bash \\\\\\`cargo test-sbf\\\\\\` or \\\\\\`anchor test\\\\\\` if tests exist\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`57`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`57`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Build a program that creates compressed accounts with addresses`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Build a program that creates compressed accounts with addresses`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-create-compressed-accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/create`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key SDK API: LightAccount::new_init(), derive_address()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|seeds|init|payer|space` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.rs` and `**/Cargo.toml` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: program ID, existing instructions, account structs, framework (Anchor or native)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Read Cargo.toml — note existing dependencies and Solana SDK version`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both Anchor and Native Rust code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (new program from scratch, add account creation to existing program, migrate from regular accounts)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: Anchor or Native Rust framework?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Derive Address → Address Tree Check → Initialize Account → Light System Program CPI`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo build-sbf` or `anchor build`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo test-sbf` or `anchor test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`Update compressed accounts`,id:`update-compressed-accounts`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/guides/how-to-update-compressed-accounts`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Build a program that updates compressed accounts`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Build a program that updates compressed accounts\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Build a program that updates compressed accounts\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/guides/how-to-update-compressed-accounts\n - Skills and resources index: https://zkcompression.com/skill.md\n - Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)\n - Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/update\n - Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/update\n\n Key SDK API: LightAccount::new_mut()\n\n ### 1. Index project\n - Grep \\\\\\`declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|mut|update|modify\\\\\\` across src/\n - Glob \\\\\\`**/*.rs\\\\\\` and \\\\\\`**/Cargo.toml\\\\\\` for project structure\n - Identify: program ID, existing instructions, account structs, framework (Anchor or native)\n - Read Cargo.toml — note existing dependencies and Solana SDK version\n - Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both Anchor and Native Rust code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: what is the goal? (new program from scratch, add account update to existing program, migrate from regular accounts)\n - AskUserQuestion: Anchor or Native Rust framework?\n - AskUserQuestion: does the program already have compressed account instructions, or is this the first one?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Update Compressed Account → Light System Program CPI\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - Add deps: Bash \\\\\\`cargo add light-sdk@0.23\\\\\\` (add \\\\\\`anchor_lang@0.31\\\\\\` for Anchor or \\\\\\`solana-program@2.2\\\\\\` + \\\\\\`borsh@0.10\\\\\\` for Native Rust)\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Bash \\\\\\`cargo build-sbf\\\\\\` or \\\\\\`anchor build\\\\\\`\n - Bash \\\\\\`cargo test-sbf\\\\\\` or \\\\\\`anchor test\\\\\\` if tests exist\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`57`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`57`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Build a program that updates compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Build a program that updates compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-update-compressed-accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/update`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/update`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key SDK API: LightAccount::new_mut()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|mut|update|modify` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.rs` and `**/Cargo.toml` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: program ID, existing instructions, account structs, framework (Anchor or native)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Read Cargo.toml — note existing dependencies and Solana SDK version`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both Anchor and Native Rust code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (new program from scratch, add account update to existing program, migrate from regular accounts)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: Anchor or Native Rust framework?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Update Compressed Account → Light System Program CPI`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo build-sbf` or `anchor build`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo test-sbf` or `anchor test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`Close compressed accounts`,id:`close-compressed-accounts`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/guides/how-to-close-compressed-accounts`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Build a program that closes compressed accounts`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Build a program that closes compressed accounts\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Build a program that closes compressed accounts\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/guides/how-to-close-compressed-accounts\n - Skills and resources index: https://zkcompression.com/skill.md\n - Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)\n - Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/close\n - Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/close\n\n Key SDK API: LightAccount::new_close()\n\n ### 1. Index project\n - Grep \\\\\\`declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|close|delete|remove\\\\\\` across src/\n - Glob \\\\\\`**/*.rs\\\\\\` and \\\\\\`**/Cargo.toml\\\\\\` for project structure\n - Identify: program ID, existing instructions, account structs, framework (Anchor or native)\n - Read Cargo.toml — note existing dependencies and Solana SDK version\n - Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both Anchor and Native Rust code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: what is the goal? (new program from scratch, add account close to existing program, migrate from regular accounts)\n - AskUserQuestion: Anchor or Native Rust framework?\n - AskUserQuestion: does the program already have compressed account instructions, or is this the first one?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Close Compressed Account → Light System Program CPI\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - Add deps: Bash \\\\\\`cargo add light-sdk@0.23\\\\\\` (add \\\\\\`anchor_lang@0.31\\\\\\` for Anchor or \\\\\\`solana-program@2.2\\\\\\` + \\\\\\`borsh@0.10\\\\\\` for Native Rust)\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Bash \\\\\\`cargo build-sbf\\\\\\` or \\\\\\`anchor build\\\\\\`\n - Bash \\\\\\`cargo test-sbf\\\\\\` or \\\\\\`anchor test\\\\\\` if tests exist\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`57`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`57`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Build a program that closes compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Build a program that closes compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-close-compressed-accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/close`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/close`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key SDK API: LightAccount::new_close()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|close|delete|remove` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.rs` and `**/Cargo.toml` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: program ID, existing instructions, account structs, framework (Anchor or native)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Read Cargo.toml — note existing dependencies and Solana SDK version`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both Anchor and Native Rust code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (new program from scratch, add account close to existing program, migrate from regular accounts)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: Anchor or Native Rust framework?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Close Compressed Account → Light System Program CPI`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo build-sbf` or `anchor build`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo test-sbf` or `anchor test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`Reinitialize compressed accounts`,id:`reinitialize-compressed-accounts`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/guides/how-to-reinitialize-compressed-accounts`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Build a program that reinitializes closed compressed accounts`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Build a program that reinitializes closed compressed accounts\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Build a program that reinitializes closed compressed accounts\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/guides/how-to-reinitialize-compressed-accounts\n - Skills and resources index: https://zkcompression.com/skill.md\n - Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)\n - Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/reinit\n - Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/reinit\n\n Key SDK API: LightAccount::new_empty()\n\n ### 1. Index project\n - Grep \\\\\\`declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|reinit|empty|reset\\\\\\` across src/\n - Glob \\\\\\`**/*.rs\\\\\\` and \\\\\\`**/Cargo.toml\\\\\\` for project structure\n - Identify: program ID, existing instructions, account structs, framework (Anchor or native)\n - Read Cargo.toml — note existing dependencies and Solana SDK version\n - Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both Anchor and Native Rust code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: what is the goal? (new program from scratch, add account reinitialization to existing program, migrate from regular accounts)\n - AskUserQuestion: Anchor or Native Rust framework?\n - AskUserQuestion: does the program already have compressed account instructions, or is this the first one?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Reinitialize Closed Account → Light System Program CPI\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - Add deps: Bash \\\\\\`cargo add light-sdk@0.23\\\\\\` (add \\\\\\`anchor_lang@0.31\\\\\\` for Anchor or \\\\\\`solana-program@2.2\\\\\\` + \\\\\\`borsh@0.10\\\\\\` for Native Rust)\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Bash \\\\\\`cargo build-sbf\\\\\\` or \\\\\\`anchor build\\\\\\`\n - Bash \\\\\\`cargo test-sbf\\\\\\` or \\\\\\`anchor test\\\\\\` if tests exist\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`57`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`57`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Build a program that reinitializes closed compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Build a program that reinitializes closed compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-reinitialize-compressed-accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/reinit`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/reinit`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key SDK API: LightAccount::new_empty()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|reinit|empty|reset` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.rs` and `**/Cargo.toml` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: program ID, existing instructions, account structs, framework (Anchor or native)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Read Cargo.toml — note existing dependencies and Solana SDK version`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both Anchor and Native Rust code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (new program from scratch, add account reinitialization to existing program, migrate from regular accounts)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: Anchor or Native Rust framework?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Reinitialize Closed Account → Light System Program CPI`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo build-sbf` or `anchor build`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo test-sbf` or `anchor test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`Burn compressed accounts`,id:`burn-compressed-accounts`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/compressed-pdas/guides/how-to-burn-compressed-accounts`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Build a program that permanently burns compressed accounts`,actions:[`copy`,`cursor`],children:`{\\`---\n description: Build a program that permanently burns compressed accounts\n allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression\n ---\n\n ## Build a program that permanently burns compressed accounts\n\n Context:\n - Guide: https://zkcompression.com/compressed-pdas/guides/how-to-burn-compressed-accounts\n - Skills and resources index: https://zkcompression.com/skill.md\n - Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)\n - Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/burn\n - Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/burn\n\n Key SDK API: LightAccount::new_burn()\n\n ### 1. Index project\n - Grep \\\\\\`declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|burn|destroy|permanent\\\\\\` across src/\n - Glob \\\\\\`**/*.rs\\\\\\` and \\\\\\`**/Cargo.toml\\\\\\` for project structure\n - Identify: program ID, existing instructions, account structs, framework (Anchor or native)\n - Read Cargo.toml — note existing dependencies and Solana SDK version\n - Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel\n\n ### 2. Read references\n - WebFetch the guide above — review both Anchor and Native Rust code samples\n - WebFetch skill.md — check for a dedicated skill and resources matching this task\n - TaskCreate one todo per phase below to track progress\n\n ### 3. Clarify intention\n - AskUserQuestion: what is the goal? (new program from scratch, add account burn to existing program, migrate from regular accounts)\n - AskUserQuestion: Anchor or Native Rust framework?\n - AskUserQuestion: does the program already have compressed account instructions, or is this the first one?\n - Summarize findings and wait for user confirmation before implementing\n\n ### 4. Create plan\n - Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes\n - Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Burn Compressed Account → Light System Program CPI\n - If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)\n - Present the plan to the user for approval before proceeding\n\n ### 5. Implement\n - Add deps: Bash \\\\\\`cargo add light-sdk@0.23\\\\\\` (add \\\\\\`anchor_lang@0.31\\\\\\` for Anchor or \\\\\\`solana-program@2.2\\\\\\` + \\\\\\`borsh@0.10\\\\\\` for Native Rust)\n - Follow the guide and the approved plan\n - Write/Edit to create or modify files\n - TaskUpdate to mark each step done\n\n ### 6. Verify\n - Bash \\\\\\`cargo build-sbf\\\\\\` or \\\\\\`anchor build\\\\\\`\n - Bash \\\\\\`cargo test-sbf\\\\\\` or \\\\\\`anchor test\\\\\\` if tests exist\n - TaskUpdate to mark complete\n\n ### Tools\n - mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details\n - mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture\n - Task subagent with Grep/Read/WebFetch for parallel lookups\n - TaskList to check remaining work\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`57`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`57`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Build a program that permanently burns compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Build a program that permanently burns compressed accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Context:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Guide: https://zkcompression.com/compressed-pdas/guides/how-to-burn-compressed-accounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Skills and resources index: https://zkcompression.com/skill.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Anchor example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/burn`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Native Rust example: https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/burn`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Key SDK API: LightAccount::new_burn()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 1. Index project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Grep `declare_id|#\\\\[program\\\\]|entrypoint!|Pubkey|AccountInfo|burn|destroy|permanent` across src/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Glob `**/*.rs` and `**/Cargo.toml` for project structure\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Identify: program ID, existing instructions, account structs, framework (Anchor or native)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Read Cargo.toml — note existing dependencies and Solana SDK version`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 2. Read references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch the guide above — review both Anchor and Native Rust code samples`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- WebFetch skill.md — check for a dedicated skill and resources matching this task`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskCreate one todo per phase below to track progress`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 3. Clarify intention`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: what is the goal? (new program from scratch, add account burn to existing program, migrate from regular accounts)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: Anchor or Native Rust framework?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- AskUserQuestion: does the program already have compressed account instructions, or is this the first one?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Summarize findings and wait for user confirmation before implementing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 4. Create plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Based on steps 1–3, draft an implementation plan: which files to modify, what code to add, dependency changes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide's step order: Dependencies → Constants → Account Struct → Instruction Data → Burn Compressed Account → Light System Program CPI`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If anything is unclear or ambiguous, loop back to step 3 (AskUserQuestion)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Present the plan to the user for approval before proceeding`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 5. Implement`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Follow the guide and the approved plan`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Write/Edit to create or modify files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark each step done`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### 6. Verify`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo build-sbf` or `anchor build`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Bash `cargo test-sbf` or `anchor test` if tests exist\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskUpdate to mark complete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__zkcompression__SearchLightProtocol(\"\u003cquery>\") for API details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"\u003cq>\") for architecture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Task subagent with Grep/Read/WebFetch for parallel lookups`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- TaskList to check remaining work`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(Accordion,{title:`v1 to v2 Merkle tree migration`,id:`v1-to-v2-merkle-tree-migration`,children:[_jsxs(_components.p,{children:[`Copy the prompt below or view the `,_jsx(_components.a,{href:`/resources/migration-v1-to-v2`,children:`guide`}),`.`]}),_jsx(Prompt,{description:`Migrate Light Protocol program from v1 to v2 Merkle trees`,actions:[`copy`,`cursor`],children:`{\\`---\n argument-hint: \u003cpath_to_program>\n description: Migrate Light Protocol program from v1 to v2 Merkle trees\n allowed-tools: [Bash, Read, Glob, Grep, Task, WebFetch]\n ---\n\n Migrate this Light Protocol program from v1 to v2 Merkle trees.\n\n ## Goal\n\n Produce a **fully working migration** that builds and tests pass.\n\n ## Available commands\n\n Via Bash tool:\n - **cargo build-sbf**, **cargo test-sbf**, **cargo fmt**, **cargo clippy**\n - **anchor build**, **anchor test**\n - **grep**, **sed**\n\n ## Documentation\n\n - Migration Guide: https://zkcompression.com/references/migration-v1-to-v2\n - Reference PR: https://github.com/Lightprotocol/program-examples/commit/54f0e7f15c2972a078f776cfb40b238d83c7e486\n\n ## Reference repos\n\n program-examples/counter/anchor/\n ├── programs/counter/src/lib.rs # v2 patterns: derive_address, CpiAccounts\n ├── Cargo.toml # v2 feature flags\n └── tests/counter.ts # v2 client patterns\n\n ## Workflow\n\n ### Phase 1: Index program\n\n Find all v1 patterns:\n\n grep -r \"::v1::\" src/ tests/\n grep -r \"ADDRESS_TREE_V1\" src/\n grep -r \"into_new_address_params_packed\" src/\n grep -r \"get_address_tree_v1\" tests/\n\n ### Phase 2: Update dependencies\n\n Update Cargo.toml. V2 is the default - no feature flag needed:\n\n # On-chain program\n [dependencies]\n light-sdk = { version = \"0.17.1\", features = [\"anchor\"] }\n light-hasher = \"5.0.0\"\n\n # Off-chain client\n [dependencies]\n light-client = \"0.17.2\"\n\n Note: V2 is now the default in all crates. Only specify \\\\\\`features = [\"v2\"]\\\\\\` if you disabled default features.\n\n ### Phase 3: Rust SDK replacements\n\n | v1 Pattern | v2 Replacement |\n |------------|----------------|\n | address::v1::derive_address | address::v2::derive_address |\n | cpi::v1::CpiAccounts | cpi::v2::CpiAccounts |\n | cpi::v1::LightSystemProgramCpi | cpi::v2::LightSystemProgramCpi |\n | constants::ADDRESS_TREE_V1 | constants::ADDRESS_TREE_V2 |\n | .into_new_address_params_packed(seed) | .into_new_address_params_assigned_packed(seed, Some(0)) |\n | .add_system_accounts(config) | .add_system_accounts_v2(config) |\n\n ### Phase 4: TypeScript SDK replacements\n\n | v1 Pattern | v2 Replacement |\n |------------|----------------|\n | deriveAddress( | deriveAddressV2( |\n | deriveAddressSeed( | deriveAddressSeedV2( |\n | defaultTestStateTreeAccounts().addressTree | batchAddressTree |\n | .newWithSystemAccounts( | .newWithSystemAccountsV2( |\n | get_address_tree_v1() | get_address_tree_v2() |\n | get_random_state_tree_info_v1() | get_random_state_tree_info() |\n\n ### Phase 5: Build and test loop\n\n **Required commands (no shortcuts):**\n\n For Anchor programs: **anchor build \u0026\u0026 anchor test**\n\n For Native programs: **cargo build-sbf \u0026\u0026 cargo test-sbf**\n\n **NO shortcuts allowed:**\n\n - Do NOT use **cargo build** (must use **cargo build-sbf**)\n - Do NOT use **cargo test** (must use **cargo test-sbf**)\n - Tests MUST run against real BPF bytecode\n\n **On failure:** Spawn debugger agent with error context.\n\n **Loop rules:**\n\n 1. Each debugger gets fresh context + previous debug reports\n 2. Each attempt tries something DIFFERENT\n 3. **NEVER GIVE UP** - keep spawning until fixed\n\n Do NOT proceed until all tests pass.\n\n ## DeepWiki fallback\n\n If no matching pattern in reference repos:\n\n mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"How to migrate {pattern} from v1 to v2?\")\\`}\n`}),_jsx(CodeBlock,{filename:``,numberOfLines:`109`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`109`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`argument-hint: \u003cpath_to_program>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`description: Migrate Light Protocol program from v1 to v2 Merkle trees`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`allowed-tools: [Bash, Read, Glob, Grep, Task, WebFetch]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Migrate this Light Protocol program from v1 to v2 Merkle trees.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Goal`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Produce a **fully working migration** that builds and tests pass.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Available commands`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Via Bash tool:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **cargo build-sbf**, **cargo test-sbf**, **cargo fmt**, **cargo clippy**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **anchor build**, **anchor test**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **grep**, **sed**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Documentation`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Migration Guide: https://zkcompression.com/references/migration-v1-to-v2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Reference PR: https://github.com/Lightprotocol/program-examples/commit/54f0e7f15c2972a078f776cfb40b238d83c7e486`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Reference repos`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`program-examples/counter/anchor/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── programs/counter/src/lib.rs # v2 patterns: derive_address, CpiAccounts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── Cargo.toml # v2 feature flags`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└── tests/counter.ts # v2 client patterns`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## Workflow`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Phase 1: Index program`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Find all v1 patterns:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` grep -r \"::v1::\" src/ tests/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` grep -r \"ADDRESS_TREE_V1\" src/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` grep -r \"into_new_address_params_packed\" src/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` grep -r \"get_address_tree_v1\" tests/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Phase 2: Update dependencies`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Update Cargo.toml. V2 is the default - no feature flag needed:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` # On-chain program`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` [dependencies]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` light-sdk = { version = \"0.17.1\", features = [\"anchor\"] }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` light-hasher = \"5.0.0\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` # Off-chain client`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` [dependencies]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` light-client = \"0.17.2\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:'Note: V2 is now the default in all crates. Only specify `features = [\"v2\"]` if you disabled default features.'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Phase 3: Rust SDK replacements`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| v1 Pattern | v2 Replacement |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`|------------|----------------|`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| address::v1::derive_address | address::v2::derive_address |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| cpi::v1::CpiAccounts | cpi::v2::CpiAccounts |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| cpi::v1::LightSystemProgramCpi | cpi::v2::LightSystemProgramCpi |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| constants::ADDRESS_TREE_V1 | constants::ADDRESS_TREE_V2 |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| .into_new_address_params_packed(seed) | .into_new_address_params_assigned_packed(seed, Some(0)) |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| .add_system_accounts(config) | .add_system_accounts_v2(config) |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Phase 4: TypeScript SDK replacements`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| v1 Pattern | v2 Replacement |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`|------------|----------------|`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| deriveAddress( | deriveAddressV2( |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| deriveAddressSeed( | deriveAddressSeedV2( |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| defaultTestStateTreeAccounts().addressTree | batchAddressTree |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| .newWithSystemAccounts( | .newWithSystemAccountsV2( |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| get_address_tree_v1() | get_address_tree_v2() |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| get_random_state_tree_info_v1() | get_random_state_tree_info() |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Phase 5: Build and test loop`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`**Required commands (no shortcuts):**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`For Anchor programs: **anchor build \u0026\u0026 anchor test**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`For Native programs: **cargo build-sbf \u0026\u0026 cargo test-sbf**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`**NO shortcuts allowed:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Do NOT use **cargo build** (must use **cargo build-sbf**)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Do NOT use **cargo test** (must use **cargo test-sbf**)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Tests MUST run against real BPF bytecode`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`**On failure:** Spawn debugger agent with error context.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`**Loop rules:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Each debugger gets fresh context + previous debug reports`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Each attempt tries something DIFFERENT`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. **NEVER GIVE UP** - keep spawning until fixed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Do NOT proceed until all tests pass.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`## DeepWiki fallback`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`If no matching pattern in reference repos:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` mcp__deepwiki__ask_question(\"Lightprotocol/light-protocol\", \"How to migrate {pattern} from v1 to v2?\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"AI Prompts","description":"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.","keywords":["AI prompts solana","AI coding prompts light protocol","solana agent prompts","cursor prompts solana","claude code solana prompts","compressed token AI prompts"],"href":"/ai-tools/prompts"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Token Distribution","slug":"token-distribution","depth":2,"children":[]},{"title":"Compressed PDA","slug":"compressed-pda","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/luminouslabs-cc5545c6/221f1b876b1e5ab2/.eslintrc.js","/_mintlify/custom/luminouslabs-cc5545c6/b12ae2b78e43c680/scripts/generate-llms-txt.js"],"subdomain":"luminouslabs-cc5545c6","siteName":"ZK Compression","title":"AI Prompts - ZK Compression","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-09T01:33:23.296Z","originalFileLocation":"ai-tools/prompts.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.\">\u003cmeta data-mint-head name=\"keywords\" content=\"payments, stablecoins, solana tokens, rent, spl token, token 2022, light protocol, zk compression, rent-free accounts on solana, scalable solana infrastructure, solana AI agent, cursor MCP, claude code solana, agent skills light protocol, AI coding agent solana\">\u003cmeta data-mint-head name=\"application-name\" content=\"ZK Compression\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"AI Prompts - ZK Compression\">\u003cmeta data-mint-head property=\"og:description\" content=\"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ZK Compression\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.zkcompression.com/ai-tools/prompts\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://luminouslabs-cc5545c6.mintlify.site/_mintlify/api/og/v2?division=AI+Tools\u0026amp;title=AI+Prompts\u0026amp;description=Ready-to-use+AI+prompts+for+Light+Protocol.+Copy+a+prompt%2C+paste+into+your+AI+coding+agent%2C+and+let+it+implement+the+recipe+in+your+project.\u0026amp;theme=dc7b57ddcac189a0ff0b223b\u0026amp;signature=df886565dd6943a4f0722dc4369aedd20b59e39ba681dcebd34f6706ad533500\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"AI Prompts - ZK Compression\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://luminouslabs-cc5545c6.mintlify.site/_mintlify/api/og/v2?division=AI+Tools\u0026amp;title=AI+Prompts\u0026amp;description=Ready-to-use+AI+prompts+for+Light+Protocol.+Copy+a+prompt%2C+paste+into+your+AI+coding+agent%2C+and+let+it+implement+the+recipe+in+your+project.\u0026amp;theme=dc7b57ddcac189a0ff0b223b\u0026amp;signature=df886565dd6943a4f0722dc4369aedd20b59e39ba681dcebd34f6706ad533500\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/luminouslabs-cc5545c6/hDQoEietm2XPbFit/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ZK Compression\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0066FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.zkcompression.com/ai-tools/prompts\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ai-tools/prompts.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.zkcompression.com/#organization\",\"name\":\"ZK Compression\",\"url\":\"https://www.zkcompression.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/luminouslabs-cc5545c6/o2wSuvcZYm5eZigT/logo/logo-black.svg?fit=max\u0026auto=format\u0026n=o2wSuvcZYm5eZigT\u0026q=85\u0026s=87a586338301c7d57a53dada00c77620\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.zkcompression.com#website\",\"name\":\"ZK Compression\",\"url\":\"https://www.zkcompression.com\",\"publisher\":{\"@id\":\"https://www.zkcompression.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.zkcompression.com/ai-tools/prompts#webpage\",\"url\":\"https://www.zkcompression.com/ai-tools/prompts\",\"name\":\"AI Prompts\",\"description\":\"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.\",\"dateModified\":\"2026-06-09T01:33:23.296Z\",\"isPartOf\":{\"@id\":\"https://www.zkcompression.com#website\"},\"breadcrumb\":{\"@id\":\"https://www.zkcompression.com/ai-tools/prompts#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.zkcompression.com/ai-tools/prompts#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"AI Tools\",\"item\":\"https://www.zkcompression.com/ai-tools/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI Prompts\",\"item\":\"https://www.zkcompression.com/ai-tools/prompts\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://www.zkcompression.com/ai-tools/prompts#article\",\"headline\":\"AI Prompts\",\"name\":\"AI Prompts\",\"description\":\"Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project.\",\"url\":\"https://www.zkcompression.com/ai-tools/prompts\",\"mainEntityOfPage\":{\"@id\":\"https://www.zkcompression.com/ai-tools/prompts#webpage\"},\"dateModified\":\"2026-06-09T01:33:23.296Z\",\"keywords\":\"AI prompts solana, AI coding prompts light protocol, solana agent prompts, cursor prompts solana, claude code solana prompts, compressed token AI prompts\",\"publisher\":{\"@id\":\"https://www.zkcompression.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.zkcompression.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ZK Compression\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ZK Compression\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/ai-tools/prompts.md","siteName":"ZK Compression","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book","pages":[{"title":"Documentation","href":"/home"}]},{"anchor":"API \u0026 SDK Reference","icon":"code","pages":[{"title":"API \u0026 SDK Reference","href":"/api-reference/sdk"}]},{"anchor":"AI Tools","icon":"robot","groups":[{"group":"AI Tools","pages":[{"title":"AI tools","sidebarTitle":"Overview","href":"/ai-tools/overview"},{"title":"Agent skills","href":"/ai-tools/agent-skills"},{"title":"MCP","description":"Connect AI apps to Light Protocol data sources and tools via the Model Context Protocol (MCP). Includes installation for Claude Code, Codex, Cursor, and more.","href":"/ai-tools/mcp"},{"title":"AI Prompts","href":"/ai-tools/prompts"}]}]},{"anchor":"Support","icon":"headset","pages":[{"title":"Support","href":"/support"}]}]},"basePath":"","title":"AI Prompts - ZK Compression","deploymentId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","buildId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","dynamics":["10e4515597","869c33ed97"],"chunks":["BannerMarkdown-BUsnMns2.js","dist-OmDnwAnM.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","Prompt-qK3j_QtB.js"]}