diff --git a/.context/program-examples b/.context/program-examples
deleted file mode 160000
index bf2705a4..00000000
--- a/.context/program-examples
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit bf2705a42094fb0568be74cc2e8c9599464c30df
diff --git a/.entire/.gitignore b/.entire/.gitignore
new file mode 100644
index 00000000..2cffdefa
--- /dev/null
+++ b/.entire/.gitignore
@@ -0,0 +1,4 @@
+tmp/
+settings.local.json
+metadata/
+logs/
diff --git a/.entire/settings.json b/.entire/settings.json
new file mode 100644
index 00000000..f6821f94
--- /dev/null
+++ b/.entire/settings.json
@@ -0,0 +1,5 @@
+{
+ "strategy": "auto-commit",
+ "enabled": true,
+ "telemetry": false
+}
diff --git a/.gitignore b/.gitignore
index f6f2388f..4c892c3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,7 @@ node_modules/
stash
docs-audit.md
-docs-audit.txt
\ No newline at end of file
+docs-audit.txt
+docs-anchor.json
+product-docs.json
+tabs-docs.json
\ No newline at end of file
diff --git a/ai-tools/guide.mdx b/ai-tools/guide.mdx
index 7fc4325e..4f7e499d 100644
--- a/ai-tools/guide.mdx
+++ b/ai-tools/guide.mdx
@@ -2,36 +2,51 @@
title: "AI Tools Guide"
description: "Guidance to AI tools when working with ZK Compression. Includes Agent Skill, MCP server, DeepWiki, and AI Search guides."
---
+import InstallAgentSkills from "/snippets/setup/install-agent-skills.mdx";
# For Docs
- **Docs AI Search** - Search documentation with AI in the search bar.
- **Markdown Export** - Append `.md` to any page URL for raw markdown.
+* **View [`/llms.txt`](https://zkcompression.com/llms.txt)** for an index of the docs - It lists key pages with descriptions
+so agents can navigate to answers quickly.
# For Development
-## AI agents
-
-### `skill.md`
+## Agent Skills
-`skill.md` is a structured capability file that tells agents what they can do
-with Light Protocol and ZK Compression. If you're
-building with agents, start here.
+View or install [`/skill.md`](https://zkcompression.com/skill.md), a structured capability file that tells agents what they can do
+with Light Protocol and ZK Compression. If you're building with agents, start here.
-* View: [`/skill.md`](https://zkcompression.com/skill.md)
+Install or view dedicated agent skills:
-### `llms.txt`
+| Use case | Skill |
+| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
+| Build rent-free Solana programs with Light SDK (Anchor or Pinocchio). Includes router integration. | [light-sdk](https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk) |
+| Use Light Token client SDKs (TypeScript and Rust) for mints, ATAs, transfers | [light-token-client](https://github.com/Lightprotocol/skills/tree/main/skills/light-token-client) |
+| Stream account state via Laserstream gRPC | [data-streaming](https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming) |
+| Wallets and payment flows with light-token. Includes privy, wallet adapter, mobile wallet adapter signing. Optional nullifier to prevent your onchain instruction from being executed more than once. | [payments-and-wallets](https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets) |
+| Airdrops, DePIN, token distribution | [token-distribution](https://github.com/Lightprotocol/skills/tree/main/skills/token-distribution) |
+| Anti-double-spend nullifiers for Privacy-preserving ZK programs | [zk-nullifier](https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier) |
+| Testing programs and clients on localnet, devnet, mainnet | [testing](https://github.com/Lightprotocol/skills/tree/main/skills/testing) |
+| For per-user state, DePIN nodes, and infrequently accessed app state with compressed PDAs | [solana-compression](https://github.com/Lightprotocol/skills/tree/main/skills/solana-compression) |
+| Help with Debugging and Questions via DeepWiki MCP | [ask-mcp](https://github.com/Lightprotocol/skills/tree/main/skills/ask-mcp) |
-`llms.txt` is an index of the docs. It lists key pages with descriptions
-so agents can navigate to answers quickly.
+> View all skills here: https://github.com/Lightprotocol/skills.
-* View: [`/llms.txt`](https://zkcompression.com/llms.txt)
+All skills are included and are auto-discovered based on context. Ask about light-token, defi, payments, or program migration and the agent uses the relevant skill automatically.
-### `llms-full.txt`
+
-`llms-full.txt` is the full, expanded index for agents that want complete coverage of the documentation.
+## AI Prompts
-* View: [`/llms-full.txt`](https://zkcompression.com/llms-full.txt)
+
## MCP
@@ -175,14 +190,9 @@ mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "your question")
You can specify any public GitHub repo that is indexed with DeepWiki. When you connect to the MCP, you specify the repository when calling the tools. Learn more [here](https://docs.devin.ai/work-with-devin/deepwiki-mcp).
-
-
+## Error codes
| Code | Message | Description |
-| :------ | :-------------------- | :-------------------------------------------- |
-| -32600 | Invalid Request | The JSON sent is not a valid Request object |
-| -32601 | Method not found | The method does not exist / is not available |
-| -32602 | Invalid params | Invalid method parameter(s) |
-| -32603 | Internal error | Internal JSON-RPC error |
-| -32000 | Account not found | The compressed account was not found |
-| -32001 | Invalid account hash | The provided account hash is invalid |
-
-# Next Steps
-
-
+| :----- | :------------------- | :------------------------------------------- |
+| -32600 | Invalid Request | The JSON sent is not a valid Request object. |
+| -32601 | Method not found | The method does not exist / is not available. |
+| -32602 | Invalid params | Invalid method parameter(s). |
+| -32603 | Internal error | Internal JSON-RPC error. |
+| -32000 | Account not found | The compressed account was not found. |
+| -32001 | Invalid account hash | The provided account hash is invalid. |
+
+## Methods
+
+These methods are called internally by the Light Token SDK. Call them
+directly for custom indexing, block explorers, or debugging.
+
+
\ No newline at end of file
diff --git a/api-reference/overview.mdx b/api-reference/overview.mdx
new file mode 100644
index 00000000..a954fcb2
--- /dev/null
+++ b/api-reference/overview.mdx
@@ -0,0 +1,15 @@
+---
+title: API Reference Overview
+description: Reference documentation for Light Protocol SDKs, Anchor constraints, and JSON RPC methods.
+---
+
+
+
+ TypeScript and Rust client SDKs for Light Token and ZK Compression.
+
+
+ Syntax reference for #[light_account] constraints: init PDAs, token accounts, ATAs, and mints.
+
+
+ Photon indexer methods for querying compressed state on Solana.
+
diff --git a/api-reference/sdk.mdx b/api-reference/sdk.mdx
new file mode 100644
index 00000000..488d0888
--- /dev/null
+++ b/api-reference/sdk.mdx
@@ -0,0 +1,8 @@
+---
+title: SDK Reference
+description: Client and program SDKs for Light Token and ZK Compression.
+---
+
+import SdkReference from "/snippets/overview-tables/sdk-reference.mdx";
+
+
\ No newline at end of file
diff --git a/changelog.md b/changelog.md
new file mode 100644
index 00000000..684e51ee
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,112 @@
+# Automated changelog generation
+
+When a version bump PR merges on `Lightprotocol/light-protocol`, a GitHub Action generates a Mintlify `` changelog entry and opens a PR on this docs repo.
+
+The real changes are in the ~20 PRs merged between consecutive version bumps (fixes, features, security items), not in the bump PR itself.
+
+## How it works
+
+1. **Trigger**: `repository_dispatch` from light-protocol after release, or manual `workflow_dispatch` with PR number
+2. **Context fetch**: bash step fetches the release PR body and all inter-release PRs via `gh` CLI
+3. **Generation**: `claude-code-action@v1` reads the context, categorizes PRs, and writes a new `` entry in `changelog.mdx`
+4. **PR creation**: `peter-evans/create-pull-request@v5` opens a PR for human review
+
+## Triggers
+
+| Trigger | When | Payload |
+|:--------|:-----|:--------|
+| `repository_dispatch` type `new-release` | Automated: light-protocol sends after release | `{ pr_number, version, commit }` |
+| `workflow_dispatch` | Manual fallback | Paste the bump PR number (e.g. 2293) |
+
+## Release patterns
+
+| PR | Labels | Generated by |
+|:---|:-------|:-------------|
+| #2272 | `[release]` | `create-release-pr.sh` (automated, body has `old -> new` versions) |
+| #2293 | none | `publish-local.sh` (manual, body has only new versions) |
+
+Individual release tags (e.g., `light-sdk-v0.22.0`) have empty bodies. The workflow reads the **bump PR** to find versions and the **inter-release PRs** for actual changes.
+
+## Context fetching
+
+The bash step fetches four things:
+
+1. **Release PR body** -> `/tmp/release-pr.json` (version bump list, merge date)
+2. **Primary version** — extracts `light-sdk` version as canonical (e.g., `0.22.0`). Falls back to first crate listed.
+3. **Previous bump PR merge date** — most recent merged PR with "bump" in the title before this one. Falls back to epoch if none found.
+4. **Inter-release PRs** -> `/tmp/inter-release-prs.json` — all PRs merged between the two bump dates, excluding bump PRs
+
+## Claude prompt design
+
+Claude receives the context files and `changelog.mdx`. It:
+
+1. Categorizes PRs:
+ - **Security**: titles with `(L-xx)`, `(M-xx)`, `(H-xx)` suffixes (audit findings)
+ - **Features**: `feat:` prefix
+ - **Fixes**: `fix:` prefix
+ - **Refactors**: `refactor:` prefix
+ - Skips `chore:` / `test:` from highlights (keeps them in the table)
+
+2. Selects tags from: `SDK`, `Programs`, `Security`, `Token`, `Tooling`
+
+3. Writes the `` block:
+
+```mdx
+
+
+### Highlights
+
+- 3-5 terse bullets, most important first
+- Link PR numbers: [#123](https://github.com/Lightprotocol/light-protocol/pull/123)
+
+### Breaking changes
+
+(only if applicable, otherwise omitted)
+
+### All changes
+
+| PR | Description |
+|:---|:------------|
+| [#xxx](link) | one-line description |
+
+
+```
+
+4. Inserts after frontmatter, before existing entries
+
+### Style rules
+
+- No promotional language ("exciting", "comprehensive", "enables")
+- Imperative mood ("fix", "add", "reject" — not "fixed", "added")
+- One sentence per bullet, max 15 words
+- Sentence case headings
+- Drop `fix:` / `feat:` prefixes in table descriptions
+
+### Constraints
+
+- `--max-turns 10` prevents runaway
+- `--model claude-sonnet-4-5-20250929`
+- Restricted tools: `Read`, `Edit`, `Bash`
+
+## Secrets
+
+| Secret | Repo | Purpose |
+|:-------|:-----|:--------|
+| `ANTHROPIC_API_KEY` | docs repo | Claude Code API |
+| `GITHUB_TOKEN` | docs repo (auto) | Read public light-protocol PRs |
+| `DOCS_DISPATCH_TOKEN` | light-protocol repo | POST `repository_dispatch` to docs repo |
+
+## Edge cases
+
+1. **No inter-release PRs** (`pr_count=0`): Claude and PR creation steps skip via `if` condition
+2. **Manual release** (no dispatch): use `workflow_dispatch` with PR number
+3. **PR body format differs**: regex handles both `X.Y.Z -> A.B.C` and `crate: A.B.C`
+4. **No previous bump PR found**: falls back to epoch, captures all history
+5. **Duplicate runs**: branch name includes version (`changelog/v0.22.0`), re-run updates the same PR
+
+## Testing
+
+1. Manually trigger `workflow_dispatch` with PR `2293`
+2. Check the generated PR edits `changelog.mdx` correctly
+3. Run `npm run format:check && npm run lint && npm run spellcheck` on the branch
+4. Verify the `` block renders in Mintlify preview
diff --git a/compressed-pdas/program-examples.mdx b/compressed-pdas/program-examples.mdx
deleted file mode 100644
index 7e14d3d8..00000000
--- a/compressed-pdas/program-examples.mdx
+++ /dev/null
@@ -1,66 +0,0 @@
----
-title: Program Examples
-description: Program example repository for compressed accounts with tests.
----
-
-## Basic Operations
-
-* [**basic-operations/anchor**](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor) - Anchor program with Rust and TypeScript tests
-* [**basic-operations/native**](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native) - Native Solana program with `light-sdk` and Rust tests.
-
-
-Basic Operations include:
-- **create** - Initialize a new compressed account
-- **update** - Modify data of an existing compressed account
-- **close** - Close a compressed account (it can be initialized again).
-- **reinit** - Reinitialize a closed account
-- **burn** - Permanently delete a compressed account (it cannot be initialized again).
-
-
-## Counter Program
-
-Full compressed account lifecycle (create, increment, decrement, reset, close):
-
-* [**counter/anchor**](https://github.com/Lightprotocol/program-examples/tree/main/counter/anchor) - Anchor program with Rust and TypeScript tests
-* [**counter/native**](https://github.com/Lightprotocol/program-examples/tree/main/counter/native) - Native Solana program with `light-sdk` and Rust tests.
-* [**counter/pinocchio**](https://github.com/Lightprotocol/program-examples/tree/main/counter/pinocchio) - Pinocchio program with `light-sdk-pinocchio` and Rust tests.
-
-## Create-and-update Program
-
-* [**create-and-update**](https://github.com/Lightprotocol/program-examples/tree/main/create-and-update) - Create a new compressed account and update an existing compressed account with a single validity proof in one instruction.
-
-## Create-and-read Program
-
-* [**read-only**](https://github.com/Lightprotocol/program-examples/tree/main/read-only) - Create a new compressed account and read it on-chain.
-
-## Compare Programs with Solana and Compressed Accounts
-
-* [**account-comparison**](https://github.com/Lightprotocol/program-examples/tree/main/account-comparison) - Compare compressed vs regular Solana accounts.
-
-## Nullifier Program
-
-* [**nullifier-program**](https://github.com/Lightprotocol/nullifier-program) - For some use cases, such as sending payments, you might want to prevent your onchain instruction from being executed more than once. Creates a rent-free PDA derived from an id. If the id has been used before, the PDA already exists, causing the instruction to fail.
-
-## Token Claim Reference Implementations
-
-* **Basic**: [**simple-claim**](https://github.com/Lightprotocol/program-examples-airdrop-implementations/simple-claim) - Distributes compressed tokens that get decompressed to SPL on claim.
-* **Advanced**: [**merkle-distributor**](https://github.com/Lightprotocol/distributor) - Distributes SPL tokens, uses compressed PDAs to track claims with linear vesting, partial claims, clawback and admin controls.
-
-
-For simple client side distribution visit [this example](https://github.com/Lightprotocol/example-token-distribution).
-
-
-## ZK-ID Program
-
-* [**zk-id**](https://github.com/Lightprotocol/program-examples/tree/main/zk-id) - A minimal Solana program that uses zero-knowledge proofs for identity verification with compressed accounts.
-
-
-# Next Steps
-
-
\ No newline at end of file
diff --git a/compressed-tokens/advanced-guides.mdx b/compressed-tokens/advanced-guides.mdx
deleted file mode 100644
index 94066669..00000000
--- a/compressed-tokens/advanced-guides.mdx
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: Advanced Guides
-description: "Reference table to advanced guides. Includes guides for airdrops, using token-2022, wallet support for compressed tokens, and client examples."
-sidebarTitle: "Overview"
----
-
-import AdvancedGuidesTable from '/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx';
-
-
diff --git a/compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx b/compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx
deleted file mode 100644
index 8f7c9112..00000000
--- a/compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx
+++ /dev/null
@@ -1,640 +0,0 @@
----
-title: Add Wallet Support for Compressed Tokens
-description: Guide to add Compressed Token Support to Your Wallet Application
-keywords: ["wallet integration compressed tokens", "wallet infrastructure on solana"]
----
-
-import InstallDependencies from '/snippets/setup/install-dependencies-codegroup.mdx';
-import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
-
-
-Leading Solana Wallets like Phantom and Backpack already support compressed tokens.
-
-
-# Integration Steps
-
-
-
-
-### Display Compressed Token Balances
-
-```javascript
-import { Rpc, createRpc } from '@lightprotocol/stateless.js';
-import { PublicKey } from '@solana/web3.js';
-
-const connection: Rpc = createRpc();
-const publicKey = new PublicKey('FWwR2s4TwpWN3nkCzVfhuPrpePG8kNzBXAxEbNsaDFNu');
-
-(async () => {
- const balances = await connection.getCompressedTokenBalancesByOwnerV2(publicKey);
-
- if (balances.value.items.length === 0) {
- console.log("No compressed token balances found");
- return;
- }
-
- for (const item of balances.value.items) {
- const balanceValue = typeof item.balance === 'string'
- ? parseInt(item.balance, 16)
- : item.balance;
-
- const mintInfo = await connection.getAccountInfo(new PublicKey(item.mint));
- const decimals = mintInfo.data[44];
- const formattedBalance = balanceValue / Math.pow(10, decimals);
-
- console.log(`Mint: ${item.mint}`);
- console.log(`Balance: ${formattedBalance} tokens\n`);
- }
-})();
-```
-
-### Get Transaction History
-
-```typescript
-import { Rpc, createRpc } from '@lightprotocol/stateless.js';
-import { PublicKey } from '@solana/web3.js';
-
-const connection: Rpc = createRpc();
-const publicKey = new PublicKey('FWwR2s4TwpWN3nkCzVfhuPrpePG8kNzBXAxEbNsaDFNu');
-
-(async () => {
- const signatures = await connection.getCompressionSignaturesForTokenOwner(publicKey);
-
- if (signatures.items.length > 0) {
- console.log(`Signatures:`);
- signatures.items.forEach((sig, index) => {
- console.log(`${index + 1}. ${sig.signature}`);
- console.log(` Slot: ${sig.slot}`);
- console.log(` Time: ${new Date(sig.blockTime * 1000).toISOString()}`);
- });
- } else {
- console.log("No transactions found");
- }
-})();
-```
-
-
-
-```typescript
-import { Rpc, createRpc } from '@lightprotocol/stateless.js';
-import { PublicKey } from '@solana/web3.js';
-
-const RPC_ENDPOINT = process.env.RPC_ENDPOINT || 'https://devnet.helius-rpc.com?api-key=';
-
-const connection: Rpc = createRpc(RPC_ENDPOINT, RPC_ENDPOINT);
-const publicKey = new PublicKey('FWwR2s4TwpWN3nkCzVfhuPrpePG8kNzBXAxEbNsaDFNu');
-
-(async () => {
- try {
- const signatures = await connection.getCompressionSignaturesForTokenOwner(publicKey);
-
- if (signatures.items.length === 0) {
- console.log("No transactions found");
- return;
- }
-
- console.log(`Latest Transaction:`);
- console.log(`Signature: ${signatures.items[0].signature}`);
- console.log(`Slot: ${signatures.items[0].slot}`);
-
- const txInfo = await connection.getTransactionWithCompressionInfo(signatures.items[0].signature);
-
- if (!txInfo) {
- console.log('Transaction not found or has no compression info');
- return;
- }
-
- if (txInfo.compressionInfo) {
- console.log(`\nClosed Accounts: ${txInfo.compressionInfo.closedAccounts.length}`);
- console.log(`Opened Accounts: ${txInfo.compressionInfo.openedAccounts.length}`);
- }
- } catch (error) {
- console.error('Error fetching transaction history:', error);
- }
-})();
-```
-
-
-
-### Send Compressed Tokens
-
-```typescript expandable
-import {
- Rpc,
- createRpc,
- bn,
- dedupeSigner,
- sendAndConfirmTx,
- buildAndSignTx,
-} from "@lightprotocol/stateless.js";
-import {
- LightTokenProgram,
- selectMinCompressedTokenAccountsForTransfer,
-} from "@lightprotocol/compressed-token";
-import { ComputeBudgetProgram, Keypair, PublicKey } from "@solana/web3.js";
-
-const connection: Rpc = createRpc();
-const mint = new PublicKey("MINT_ADDRESS");
-const payer = PAYER_KEYPAIR;
-const owner = payer;
-const recipient = Keypair.generate();
-const amount = bn(1e8);
-
-(async () => {
- const compressedTokenAccounts =
- await connection.getCompressedTokenAccountsByOwner(owner.publicKey, { mint });
-
- if (compressedTokenAccounts.items.length === 0) {
- console.log("No compressed token accounts found");
- return;
- }
-
- const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(
- compressedTokenAccounts.items,
- amount
- );
-
- const proof = await connection.getValidityProof(
- inputAccounts.map((account) => account.compressedAccount.hash)
- );
-
- const ix = await LightTokenProgram.transfer({
- payer: payer.publicKey,
- inputCompressedTokenAccounts: inputAccounts,
- toAddress: recipient.publicKey,
- amount,
- recentInputStateRootIndices: proof.rootIndices,
- recentValidityProof: proof.compressedProof,
- });
-
- const { blockhash } = await connection.getLatestBlockhash();
- const additionalSigners = dedupeSigner(payer, [owner]);
- const signedTx = buildAndSignTx(
- [ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ix],
- payer,
- blockhash,
- additionalSigners
- );
-
- const transferTxId = await sendAndConfirmTx(connection, signedTx);
- console.log(`Transaction: ${transferTxId}`);
-})();
-```
-
-
-
-
-
-### Prerequisites
-
-Make sure you have dependencies and developer environment set up!
-
-
-
-**Dependencies**
-
-
-
-**Developer Environment**
-
-
-
-
-
-
-### Display Compressed Token Balances
-
-This example fetches and displays all compressed token balances for a wallet address.
-
-```javascript
-import { Rpc, createRpc } from '@lightprotocol/stateless.js';
-import { Keypair, PublicKey } from '@solana/web3.js';
-import * as fs from 'fs';
-import * as os from 'os';
-
-const connection: Rpc = createRpc();
-
-const walletPath = `${os.homedir()}/.config/solana/id.json`;
-const secretKey = JSON.parse(fs.readFileSync(walletPath, 'utf8'));
-const payer = Keypair.fromSecretKey(Buffer.from(secretKey));
-
-(async () => {
- const balances = await connection.getCompressedTokenBalancesByOwnerV2(payer.publicKey);
-
- if (balances.value.items.length === 0) {
- console.log("No compressed token balances found");
- return;
- }
-
- for (const item of balances.value.items) {
- const balanceValue = typeof item.balance === 'string'
- ? parseInt(item.balance, 16)
- : item.balance;
-
- const mintInfo = await connection.getAccountInfo(new PublicKey(item.mint));
- const decimals = mintInfo.data[44];
- const formattedBalance = balanceValue / Math.pow(10, decimals);
-
- console.log(`Mint: ${item.mint}`);
- console.log(`Balance: ${formattedBalance} tokens\n`);
- }
-})();
-```
-
-
-
-### Get Transaction History
-
-This example retrieves compression transaction signatures to display transaction history of the wallet.
-
-```javascript
-import { Rpc, createRpc } from '@lightprotocol/stateless.js';
-import { Keypair } from '@solana/web3.js';
-import * as fs from 'fs';
-import * as os from 'os';
-
-const connection: Rpc = createRpc();
-
-const walletPath = `${os.homedir()}/.config/solana/id.json`;
-const secretKey = JSON.parse(fs.readFileSync(walletPath, 'utf8'));
-const payer = Keypair.fromSecretKey(Buffer.from(secretKey));
-
-(async () => {
- const signatures = await connection.getCompressionSignaturesForTokenOwner(payer.publicKey);
-
- if (signatures.items.length > 0) {
- console.log(`Signatures:`);
- signatures.items.forEach((sig, index) => {
- console.log(`${index + 1}. ${sig.signature}`);
- console.log(` Slot: ${sig.slot}`);
- console.log(` Time: ${new Date(sig.blockTime * 1000).toISOString()}`);
- });
- } else {
- console.log("No transactions found");
- }
-})();
-```
-
-
-
-### Send Compressed Tokens
-
-First, set up a test mint to and mint 10 compressed tokens to your filesystem wallet.
-
-
-
-```typescript
-import { Keypair } from "@solana/web3.js";
-import { Rpc, confirmTx, createRpc } from '@lightprotocol/stateless.js';
-import { createMint, mintTo } from '@lightprotocol/compressed-token';
-import * as fs from 'fs';
-import * as os from 'os';
-
-// 1. Setup RPC connection and load filesystem wallet for mint operations
-// 2. Call createMint() to create SPL mint with SPL interface for compression
-// 3. Call mintTo() to mint compressed tokens to filesystem wallet
-
-const connection: Rpc = createRpc(); // defaults to localhost:8899
-
-// Load wallet from filesystem
-const walletPath = `${os.homedir()}/.config/solana/id.json`;
-const secretKey = JSON.parse(fs.readFileSync(walletPath, 'utf8'));
-const payer = Keypair.fromSecretKey(Buffer.from(secretKey));
-const mintKeypair = Keypair.generate();
-
-(async() => {
- // Fund payer with SOL
- await connection.requestAirdrop(payer.publicKey, 1e9);
- await new Promise(resolve => setTimeout(resolve, 1000));
-
- // Create SPL mint with SPL interface for compression
- const { mint, transactionSignature } = await createMint(
- connection,
- payer,
- payer.publicKey, // mint authority
- 9,
- mintKeypair,
- );
- console.log(`Mint address: ${mint.toString()}`);
- console.log(`Transaction: ${transactionSignature}`);
-
- // Mint compressed tokens to payer
- const mintToTxId = await mintTo(
- connection,
- payer,
- mint, // SPL mint with SPL interface for compression
- payer.publicKey, // recipient address
- payer,
- 10e9,
- );
-
- console.log(`\nMinted ${10e9 / 1e9} compressed token`);
- console.log(`Transaction: ${mintToTxId}`);
-})();
-```
-
-
-
-
-Make sure you add your Mint address to `send-tokens.ts`.
-
-
-```typescript send-tokens.ts expandable
-// Compressed Token Transfer - Local
-// 1. Load wallet and fetch compressed token accounts with getCompressedTokenAccountsByOwner()
-// 2. Select accounts for transfer using selectMinCompressedTokenAccountsForTransfer()
-// and get validity proof with getValidityProof()
-// 3. Create transfer instruction with LightTokenProgram.transfer()
-// and submit transaction with sendAndConfirmTx()
-// 4. Verify balances via getCompressedTokenAccountsByOwner()
-
-import {
- Rpc,
- createRpc,
- bn,
- dedupeSigner,
- sendAndConfirmTx,
- buildAndSignTx,
-} from "@lightprotocol/stateless.js";
-import {
- LightTokenProgram,
- selectMinCompressedTokenAccountsForTransfer,
-} from "@lightprotocol/compressed-token";
-import { ComputeBudgetProgram, Keypair, PublicKey } from "@solana/web3.js";
-import * as fs from 'fs';
-import * as os from 'os';
-
-// Step 1: Setup RPC connection and define transfer parameters
-const connection: Rpc = createRpc(); // defaults to localhost:8899
-const mint = new PublicKey("MINT ADDRESS"); // Replace with mint address
-
-// Load wallet from filesystem
-const walletPath = `${os.homedir()}/.config/solana/id.json`;
-const secretKey = JSON.parse(fs.readFileSync(walletPath, 'utf8'));
-const payer = Keypair.fromSecretKey(Buffer.from(secretKey));
-const owner = payer;
-
-const recipient = Keypair.generate();
-const amount = bn(1e8);
-
-(async () => {
- // Step 2: Fetch compressed account hashes from state trees
- const compressedTokenAccounts =
- await connection.getCompressedTokenAccountsByOwner(owner.publicKey, {
- mint, // SPL mint with SPL interface for compression
- });
-
- if (compressedTokenAccounts.items.length === 0) {
- console.log("No compressed token accounts found for this mint");
- return;
- }
-
- // Show initial sender balance
- const initialBalance = compressedTokenAccounts.items.reduce((sum, account) => sum + Number(account.parsed.amount), 0);
- console.log(`Sender balance: ${initialBalance / 1e8} compressed tokens`);
-
- // Step 3: Select minimum compressed accounts for transfer amount
- const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(
- compressedTokenAccounts.items,
- amount
- );
-
- // Get validity proof for Merkle tree verification
- const proof = await connection.getValidityProof(
- inputAccounts.map((account) => account.compressedAccount.hash)
- );
-
- // Step 4: Create transfer instruction that consumes input accounts and creates new output accounts
- const ix = await LightTokenProgram.transfer({
- payer: payer.publicKey,
- inputCompressedTokenAccounts: inputAccounts, // accounts to consume
- toAddress: recipient.publicKey,
- amount,
- recentInputStateRootIndices: proof.rootIndices,
- recentValidityProof: proof.compressedProof,
- });
-
- // Step 5: Build, sign, and submit transaction
- const { blockhash } = await connection.getLatestBlockhash();
- const additionalSigners = dedupeSigner(payer, [owner]);
- const signedTx = buildAndSignTx(
- [ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ix],
- payer,
- blockhash,
- additionalSigners
- );
- const transferTxId = await sendAndConfirmTx(connection, signedTx);
-
- console.log(`\nTransferred ${amount.toNumber() / 1e8} compressed tokens`);
- console.log(`Transaction: ${transferTxId}`);
- console.log(`Recipient: ${recipient.publicKey.toString()}`);
-
- // Step 6: Verify via getCompressedTokenAccountsByOwner
- const senderCompressedAccounts = await connection.getCompressedTokenAccountsByOwner(payer.publicKey, { mint });
- const senderBalance = senderCompressedAccounts.items.reduce((sum, account) => sum + Number(account.parsed.amount), 0);
-
- const recipientCompressedAccounts = await connection.getCompressedTokenAccountsByOwner(recipient.publicKey, { mint });
- const recipientBalance = recipientCompressedAccounts.items.reduce((sum, account) => sum + Number(account.parsed.amount), 0);
-
- console.log(`\nSummary compressed token balances:`);
- console.log(`Sender balance: ${senderBalance / 1e8} compressed tokens`);
- console.log(`Recipient balance: ${recipientBalance / 1e8} compressed token`);
-
- return transferTxId;
-})();
-```
-
-
-
-
-
-# Advanced Integrations
-
-Use these integrations to let users convert between regular and compressed format as needed.
-
-
-
-This example converts compressed tokens to regular SPL format using `LightTokenProgram.decompress().`
-
-```javascript
-import {
- bn,
- buildAndSignTx,
- sendAndConfirmTx,
- dedupeSigner,
- Rpc,
- createRpc,
-} from "@lightprotocol/stateless.js";
-import { ComputeBudgetProgram } from "@solana/web3.js";
-import {
- LightTokenProgram,
- getTokenPoolInfos,
- selectMinCompressedTokenAccountsForTransfer,
- selectTokenPoolInfosForDecompression,
-} from "@lightprotocol/compressed-token";
-
-// 1. Setup RPC connection and fetch compressed token accounts with getCompressedTokenAccountsByOwner()
-// 2. Select accounts and SPL interface infos using selectMinCompressedTokenAccountsForTransfer() and selectTokenPoolInfosForDecompression()
-// 3. Create decompress instruction with LightTokenProgram.decompress() and submit transaction
-
-// Step 1: Setup RPC connection and define decompression parameters
-const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=";);
-const payer = PAYER_KEYPAIR;
-const owner = PAYER_KEYPAIR;
-const mint = MINT_ADDRESS;
-const amount = 1e5; // 100K tokens to decompress
-
-(async () => {
- // 1. Fetch compressed token accounts
- const compressedTokenAccounts =
- await connection.getCompressedTokenAccountsByOwner(owner.publicKey, {
- mint,
- });
-
- // 2. Select
- const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(
- compressedTokenAccounts.items,
- bn(amount)
- );
-
- // 3. Fetch validity proof
- const proof = await connection.getValidityProof(
- inputAccounts.map((account) => account.compressedAccount.hash)
- );
-
- // 4. Fetch & Select tokenPoolInfos
- const tokenPoolInfos = await getTokenPoolInfos(connection, mint);
- const selectedTokenPoolInfos = selectTokenPoolInfosForDecompression(
- tokenPoolInfos,
- amount
- );
-
- // 5. Build instruction
- const ix = await LightTokenProgram.decompress({
- payer: payer.publicKey,
- inputCompressedTokenAccounts: inputAccounts,
- toAddress: owner.publicKey,
- amount,
- tokenPoolInfos: selectedTokenPoolInfos,
- recentInputStateRootIndices: proof.rootIndices,
- recentValidityProof: proof.compressedProof,
- });
-
-
- // 6. Sign, send, and confirm.
- // Example with keypair:
- const { blockhash } = await connection.getLatestBlockhash();
- const additionalSigners = dedupeSigner(payer, [owner]);
- const signedTx = buildAndSignTx(
- [ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ix],
- payer,
- blockhash,
- additionalSigners
- );
-
- return await sendAndConfirmTx(connection, signedTx);
-})();
-```
-
-
-
-
-
-This example converts regular SPL tokens to compressed format using `LightTokenProgram.compress().`
-
-```typescript
-// 1. Setup RPC connection and get user ATA with getOrCreateAssociatedTokenAccount()
-// 2. Fetch state tree and SPL interface infos using getStateTreeInfos() and getTokenPoolInfos()
-// 3. Create compress instruction with LightTokenProgram.compress() and submit transaction
-
-
-import {
- buildAndSignTx,
- sendAndConfirmTx,
- Rpc,
- createRpc,
- selectStateTreeInfo,
-} from "@lightprotocol/stateless.js";
-import { ComputeBudgetProgram } from "@solana/web3.js";
-import {
- LightTokenProgram,
- getTokenPoolInfos,
- selectTokenPoolInfo,
-} from "@lightprotocol/compressed-token";
-import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token";
-
-// Step 1: Setup RPC connection and define compression parameters
-const connection: Rpc = createRpc(
- "https://mainnet.helius-rpc.com?api-key="
-);
- const payer = ;
- const mint = ;
-const amount = 1e5; // 100K tokens to compress
-
-(async () => {
- // Step 2: Get or create associated token account for SPL tokens
- const sourceTokenAccount = await getOrCreateAssociatedTokenAccount(
- connection,
- payer, // fee payer
- mint, // token mint address
- payer.publicKey // token account owner
- );
-
- // Step 3: Fetch and select state tree info for compression
- const treeInfos = await connection.getStateTreeInfos();
- const treeInfo = selectStateTreeInfo(treeInfos);
-
- // Step 4: Fetch and select SPL interface info for compression
- const tokenPoolInfos = await getTokenPoolInfos(connection, mint);
- const tokenPoolInfo = selectTokenPoolInfo(tokenPoolInfos);
-
- // Step 5: Create compress instruction - transfer SPL tokens to pool and create compressed accounts
- const compressInstruction = await LightTokenProgram.compress({
- payer: payer.publicKey, // fee payer
- owner: payer.publicKey, // owner of source SPL tokens
- source: sourceTokenAccount.address, // source ATA address
- toAddress: payer.publicKey, // recipient of compressed tokens (self)
- amount, // amount to compress
- mint, // token mint address
- outputStateTreeInfo: treeInfo, // state tree for compressed accounts
- tokenPoolInfo,
- });
-
- // Step 6: Build, sign, and submit compression transaction
- const { blockhash } = await connection.getLatestBlockhash();
- const tx = buildAndSignTx(
- [
- ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }),
- compressInstruction,
- ],
- payer, // transaction signer
- blockhash,
- [payer] // additional signers
- );
- await sendAndConfirmTx(connection, tx);
-})();
-```
-
-
-
-# Common Errors
-
-
-
-If `getCompressedTokenBalancesByOwnerV2` returns empty:
-
-* Ensure the wallet has compressed tokens (not regular SPL tokens)
-* Verify you're on the correct network (devnet/mainnet)
-
-
-
-# Next Steps
-
-
-
diff --git a/compressed-tokens/advanced-guides/example-token-distribution.mdx b/compressed-tokens/advanced-guides/example-token-distribution.mdx
deleted file mode 100644
index b034f615..00000000
--- a/compressed-tokens/advanced-guides/example-token-distribution.mdx
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: "Example Token Distribution"
-description: "Reference implementations for airdrops, payments, and rewards with ZK Compression"
-url: "https://github.com/Lightprotocol/example-token-distribution"
-keywords: ["scalable token distribution on solana", "infrastructure for token distribution", "mass token distribution", "reward distribution for depins", "depin infrastructure on solana"]
----
-
-View the full example on GitHub: [example-token-distribution](https://github.com/Lightprotocol/example-token-distribution)
diff --git a/compressed-tokens/advanced-guides/how-to-combine-operations-in-one-transaction.mdx b/compressed-tokens/advanced-guides/how-to-combine-operations-in-one-transaction.mdx
deleted file mode 100644
index 26fc80a6..00000000
--- a/compressed-tokens/advanced-guides/how-to-combine-operations-in-one-transaction.mdx
+++ /dev/null
@@ -1,198 +0,0 @@
----
-title: Combine Instructions in One Transaction
-description: Combine multiple instructions in one transaction. Full example: create SPL Interface PDA and first-time compression of existing SPL tokens.
-keywords: ["batch token operations solana", "combine transactions solana"]
----
-
-import InstallDependencies from '/snippets/setup/install-dependencies-codegroup.mdx';
-import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
-
-The SDK provides instruction-level APIs that return instructions without sending transactions. Combine these instructions to build custom transactions with multiple instructions.
-
-This guide demonstrates creating an SPL interface and compressing existing SPL tokens in a single transaction.
-
-# Full Code Example
-
-
-
-### Prerequisites
-
-Make sure you have dependencies and developer environment set up!
-
-
-
-**Dependencies**
-
-
-
-**Developer Environment**
-
-
-
-
-
-
-### Create SPL interface + compress
-
-```typescript create-pool-and-compress.ts highlight={26,71} expandable
-// 1. Setup: Create regular SPL token and mint to ATA
-// 2. Build instructions for SPL interface and compress
-// 3. Combine instructions in one transaction
-// 4. Verify compressed balance
-
-import {
- Keypair,
- ComputeBudgetProgram,
-} from '@solana/web3.js';
-import {
- createRpc,
- buildAndSignTx,
- sendAndConfirmTx,
- selectStateTreeInfo,
-} from '@lightprotocol/stateless.js';
-import { LightTokenProgram } from '@lightprotocol/compressed-token';
-import {
- createMint,
- getOrCreateAssociatedTokenAccount,
- mintTo,
- TOKEN_PROGRAM_ID,
-} from '@solana/spl-token';
-import BN from 'bn.js';
-
-async function createPoolAndCompress() {
- // Step 1: Setup - Create regular SPL token and mint to ATA
- const rpc = createRpc();
- const payer = Keypair.generate();
- const airdropSignature = await rpc.requestAirdrop(payer.publicKey, 1000000000);
- await rpc.confirmTransaction(airdropSignature);
-
- // Create regular SPL token mint
- const mint = await createMint(
- rpc,
- payer,
- payer.publicKey,
- null,
- 9,
- undefined,
- undefined,
- TOKEN_PROGRAM_ID
- );
-
- // Create ATA and mint tokens to it
- const ata = await getOrCreateAssociatedTokenAccount(
- rpc,
- payer,
- mint,
- payer.publicKey,
- undefined,
- undefined,
- undefined,
- TOKEN_PROGRAM_ID
- );
-
- await mintTo(
- rpc,
- payer,
- mint,
- ata.address,
- payer,
- 1_000_000_000, // 1 token with 9 decimals
- undefined,
- undefined,
- TOKEN_PROGRAM_ID
- );
-
- console.log("Regular SPL token created:", mint.toBase58());
- console.log("ATA balance:", 1, "token");
-
- // Step 2: Build instructions for SPL interface and compress
- const outputStateTreeInfo = selectStateTreeInfo(await rpc.getStateTreeInfos());
-
- // Derive SPL Interface PDA
- const tokenPoolPda = LightTokenProgram.deriveTokenPoolPda(mint);
-
- // Create SPL interface instruction
- const createSplInterfaceIx = await LightTokenProgram.createSplInterface({
- feePayer: payer.publicKey,
- mint,
- tokenProgramId: TOKEN_PROGRAM_ID,
- });
-
- // Manually construct TokenPoolInfo for first-time compression (SPL interface not yet on-chain)
- const tokenPoolInfo = {
- mint: mint,
- tokenPoolPda: tokenPoolPda,
- tokenProgram: TOKEN_PROGRAM_ID,
- isInitialized: true, // Set to true even though pool will be created in this tx
- balance: new BN(0),
- poolIndex: 0,
- bump: 0, // Placeholder value
- };
-
- // Create compress instruction
- const compressIx = await LightTokenProgram.compress({
- outputStateTreeInfo,
- tokenPoolInfo,
- payer: payer.publicKey,
- owner: payer.publicKey,
- source: ata.address,
- toAddress: payer.publicKey,
- amount: new BN(1_000_000_000),
- mint,
- });
-
- // Step 3: Combine instructions in one transaction
- const { blockhash } = await rpc.getLatestBlockhash();
-
- const allInstructions = [
- ComputeBudgetProgram.setComputeUnitLimit({ units: 1_000_000 }),
- createSplInterfaceIx,
- compressIx,
- ];
-
- const tx = buildAndSignTx(
- allInstructions,
- payer,
- blockhash,
- []
- );
-
- const txId = await sendAndConfirmTx(rpc, tx);
-
- console.log("Token pool created and tokens compressed");
- console.log("Transaction:", txId);
-
- // Step 4: Verify compressed balance
- const compressedAccounts = await rpc.getCompressedTokenAccountsByOwner(
- payer.publicKey,
- { mint }
- );
-
- const compressedBalance = compressedAccounts.items.reduce(
- (sum, account) => sum.add(account.parsed.amount),
- new BN(0)
- );
-
- console.log("Compressed balance:", compressedBalance.toNumber() / 1_000_000_000, "tokens");
-
- return {
- transactionSignature: txId,
- mint,
- compressedBalance: compressedBalance.toNumber(),
- };
-}
-
-createPoolAndCompress().catch(console.error);
-```
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/advanced-guides/use-token-2022-with-compression.mdx b/compressed-tokens/advanced-guides/use-token-2022-with-compression.mdx
deleted file mode 100644
index 25597daa..00000000
--- a/compressed-tokens/advanced-guides/use-token-2022-with-compression.mdx
+++ /dev/null
@@ -1,277 +0,0 @@
----
-title: Use Token-2022 with Compression
-description: Complete guide to mint, compress and transfer tokens with Token-2022 Metadata with ZK Compression.
-keywords: ["token 2022 on solana", "token extensions on solana", "token 2022 compression"]
----
-
-import InstallDependencies from '/snippets/setup/install-dependencies-codegroup.mdx';
-import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
-
-# What you will do
-
-With this guide you will mint, compress, and transfer tokens with Token-2022 Metadata.
-
-# Overview Token 2022 Extensions
-
-Token 2022 Extensions are optional features that can be added to Token 2022 mints on Solana to enable additional functionality.
-
-ZK Compression supports compressing the following mint-extensions:
-
-* MetadataPointer
-* TokenMetadata
-* InterestBearingConfig
-* GroupPointer
-* GroupMemberPointer
-* TokenGroup
-* TokenGroupMember
-
-All other extensions are not yet supported.
-
-
-If you require support for other mint-extensions, [let us know](https://t.me/swen_light)!
-
-
-# Get started
-
-
-
-
-
-You need the following SDK versions:
-
-* `@lightprotocol/stateless.js` ≥ 0.21.0
-* `@lightprotocol/compressed-token` ≥ 0.21.0
-* `@solana/web3.js` ≥ 1.95.3
-
-
-Make sure you have dependencies and developer environment set up!
-
-
-
-**Dependencies**
-
-
-
-**Developer Environment**
-
-
-
-
-
-
-Run `compress-t22.ts`.
-
-```typescript compress-t22.ts expandable
-// Token-2022 with ZK Compression - Local
-// 1. Load wallet and connect to local validator
-// 2. Create Token-2022 mint with metadata extension and register for compression via createSplInterface()
-// 3. Mint SPL tokens to ATA, compress via compress(), and transfer compressed tokens via transfer()
-// 4. Verify balances via getTokenAccountBalance and getCompressedTokenAccountsByOwner
-
-import { confirmTx, createRpc } from "@lightprotocol/stateless.js";
-import {
- compress,
- createSplInterface,
- transfer,
-} from "@lightprotocol/compressed-token";
-import {
- getOrCreateAssociatedTokenAccount,
- mintTo as mintToSpl,
- TOKEN_2022_PROGRAM_ID,
- createInitializeMetadataPointerInstruction,
- createInitializeMintInstruction,
- ExtensionType,
- getMintLen,
- LENGTH_SIZE,
- TYPE_SIZE,
-} from "@solana/spl-token";
-import {
- Keypair,
- sendAndConfirmTransaction,
- SystemProgram,
- Transaction,
-} from "@solana/web3.js";
-import {
- createInitializeInstruction,
- pack,
- TokenMetadata,
-} from "@solana/spl-token-metadata";
-
-// Step 1: Setup local connection and load wallet
-import * as fs from 'fs';
-import * as os from 'os';
-
-const walletPath = `${os.homedir()}/.config/solana/id.json`;
-const secretKey = JSON.parse(fs.readFileSync(walletPath, 'utf8'));
-const payer = Keypair.fromSecretKey(Buffer.from(secretKey));
-const connection = createRpc(); // defaults to localhost:8899
-
-(async () => {
-
- // Generate mint keypair and define Token-2022 metadata
- const mint = Keypair.generate();
- const decimals = 9;
-
- const metadata: TokenMetadata = {
- mint: mint.publicKey,
- name: "Local Test Token",
- symbol: "LTT",
- uri: "https://example.com/token-metadata.json",
- additionalMetadata: [["environment", "localnet"], ["test", "true"]],
- };
-
- // Calculate space requirements for Token-2022 mint with MetadataPointer extension
- const mintLen = getMintLen([ExtensionType.MetadataPointer]);
- const metadataLen = TYPE_SIZE + LENGTH_SIZE + pack(metadata).length;
-
- // Check wallet balance
- const balance = await connection.getBalance(payer.publicKey);
-
- // Step 2: Create Token-2022 mint with metadata extension
- const mintLamports = await connection.getMinimumBalanceForRentExemption(
- mintLen + metadataLen
- );
-
- const mintTransaction = new Transaction().add(
- // Create account for Token-2022 mint
- SystemProgram.createAccount({
- fromPubkey: payer.publicKey,
- newAccountPubkey: mint.publicKey,
- space: mintLen,
- lamports: mintLamports,
- programId: TOKEN_2022_PROGRAM_ID,
- }),
- // Initialize MetadataPointer extension
- createInitializeMetadataPointerInstruction(
- mint.publicKey,
- payer.publicKey,
- mint.publicKey,
- TOKEN_2022_PROGRAM_ID
- ),
- // Initialize Token-2022 mint account
- createInitializeMintInstruction(
- mint.publicKey,
- decimals,
- payer.publicKey,
- null,
- TOKEN_2022_PROGRAM_ID
- ),
- // Initialize token metadata
- createInitializeInstruction({
- programId: TOKEN_2022_PROGRAM_ID,
- mint: mint.publicKey,
- metadata: mint.publicKey,
- name: metadata.name,
- symbol: metadata.symbol,
- uri: metadata.uri,
- mintAuthority: payer.publicKey,
- updateAuthority: payer.publicKey,
- })
- );
-
- // Send Token-2022 mint creation transaction
- const mintCreationTxId = await sendAndConfirmTransaction(
- connection,
- mintTransaction,
- [payer, mint]
- );
- console.log(`Token-2022 mint created with address: ${mint.publicKey.toString()}`);
-
- // Step 3: Call createSplInterface() to initialize omnibus account
- // and register Token-2022 mint with Light Token Program
- // Create PDA that holds SPL tokens for compressed tokens
- const registerTxId = await createSplInterface(
- connection,
- payer,
- mint.publicKey, // Token-2022 mint to register with Light Token Program
- undefined,
- TOKEN_2022_PROGRAM_ID
- );
-
- // Step 4: Create associated token account and mint tokens
- const ata = await getOrCreateAssociatedTokenAccount(
- connection,
- payer,
- mint.publicKey, // Token-2022 mint with SPL interface for compression
- payer.publicKey,
- undefined,
- undefined,
- undefined,
- TOKEN_2022_PROGRAM_ID
- );
-
- // Mint Token-2022 tokens to ATA
- const mintAmount = 400_000_000; // 0.4 tokens
- const mintToTxId = await mintToSpl(
- connection,
- payer,
- mint.publicKey, // Token-2022 mint with SPL interface for compression
- ata.address, // destination token account
- payer.publicKey, // mint authority
- mintAmount, // amount to mint
- undefined, // multiSigners (not used for single authority)
- undefined,
- TOKEN_2022_PROGRAM_ID
- );
- console.log(`Minted ${mintAmount / 1e9} Token-2022 tokens with metadata extension`);
- console.log(`Transaction: ${mintToTxId}`);
-
- // Step 5: Call compress() to convert Token-2022 tokens to compressed format
- // Transfer Token-2022 tokens to omnibus pool and mint compressed tokens
- const compressAmount = 300_000_000; // 0.3 tokens
- const compressTxId = await compress(
- connection,
- payer,
- mint.publicKey, // Token-2022 mint with SPL interface for compression
- compressAmount, // amount to compress
- payer, // owner of SPL tokens
- ata.address, // Source ATA for compression
- payer.publicKey // recipient for compressed tokens
- );
- console.log(`\nCompressed ${compressAmount / 1e9} Token-2022 tokens`);
- console.log(`Transaction: ${compressTxId}`);
-
- // Step 6: Transfer compressed Token-2022 tokens
- const transferRecipient = Keypair.generate(); // Keypair recipient
- const transferAmount = 100_000_000; // 0.1 tokens
- const transferTxId = await transfer(
- connection,
- payer,
- mint.publicKey, // Token-2022 mint with SPL interface for compression
- transferAmount,
- payer,
- transferRecipient.publicKey
- );
- console.log(`\nTransferred ${transferAmount / 1e9} Compressed Token-2022 tokens`);
- console.log(`Transaction: ${transferTxId}`);
- console.log(`Recipient: ${transferRecipient.publicKey.toString()}`);
-
- // Step 7: Verify balances via getTokenAccountBalance and getCompressedTokenAccountsByOwner
- const senderCompressedAccounts = await connection.getCompressedTokenAccountsByOwner(payer.publicKey, { mint: mint.publicKey });
- const senderBalance = senderCompressedAccounts.items.reduce((sum, account) => sum + Number(account.parsed.amount), 0);
-
- const recipientCompressedAccounts = await connection.getCompressedTokenAccountsByOwner(transferRecipient.publicKey, { mint: mint.publicKey });
- const recipientBalance = recipientCompressedAccounts.items.reduce((sum, account) => sum + Number(account.parsed.amount), 0);
-
- const splBalance = await connection.getTokenAccountBalance(ata.address);
-
- console.log(`\nSummary Token-2022 balances:`);
- console.log(`Sender balance: ${senderBalance / 1e9} compressed tokens / ${splBalance.value.uiAmount} SPL tokens`);
- console.log(`Recipient balance: ${recipientBalance / 1e9} compressed tokens`);
-
-})().catch(console.error);
-```
-
-
-
-# Next Steps
-
-
-
-
diff --git a/compressed-tokens/advanced-guides/airdrop.mdx b/compressed-tokens/airdrop.mdx
similarity index 99%
rename from compressed-tokens/advanced-guides/airdrop.mdx
rename to compressed-tokens/airdrop.mdx
index ce18f3ef..72380bcd 100644
--- a/compressed-tokens/advanced-guides/airdrop.mdx
+++ b/compressed-tokens/airdrop.mdx
@@ -1,6 +1,6 @@
---
-title: Airdrop Guide with ZK Compression
-sidebarTitle: Airdrop Guide
+title: Airdrop Guide
+sidebarTitle: Token Distribution
description: Complete client and program guides to create an airdrop – with or without code. ZK compression is the most efficient way to distribute SPL tokens.
keywords: ["solana airdrop", "merkle distributor", "merkle airdrop", "airdrop infrastructure on solana", "scalable token distribution on solana", "token airdrop for protocols"]
---
@@ -8,6 +8,8 @@ keywords: ["solana airdrop", "merkle distributor", "merkle airdrop", "airdrop in
import { TokenAccountCompressedVsSpl } from '/snippets/jsx/token-account-compressed-vs-spl.jsx';
import InstallDependencies from '/snippets/setup/install-dependencies-codegroup.mdx';
import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
+import AgentSkillAirdrop from "/snippets/setup/agent-skill-airdrop.mdx";
+import AirdropAiPrompt from "/snippets/ai-prompts/toolkits/airdrop.mdx";
@@ -15,6 +17,8 @@ import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
---
+
+
@@ -891,6 +895,9 @@ const recipients = [
+
+
+
# Advanced Features
diff --git a/compressed-tokens/for-privy.mdx b/compressed-tokens/for-privy.mdx
index 035d3061..0d422410 100644
--- a/compressed-tokens/for-privy.mdx
+++ b/compressed-tokens/for-privy.mdx
@@ -1,6 +1,6 @@
---
title: "Rent-Free SPL Accounts with Privy"
-sidebarTitle: "Privy Guide"
+sidebarTitle: "Sign with Privy Wallet"
description: "Integrate compressed tokens with Privy embedded wallets for rent-free SPL token accounts and transfers."
keywords: ["privy solana", "privy compressed tokens", "embedded wallet compression", "rent-free tokens privy"]
---
@@ -96,7 +96,7 @@ const rpc = createRpc(RPC_ENDPOINT);
Before we call compress or decompresss, we need:
-* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
+* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) or added to existing SPL mints via [`createSplInterface()`](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook).
* For `compress()` SPL tokens in an Associated Token Account, or
* For `decompress()` compressed token accounts with sufficient balance.
diff --git a/compressed-tokens/guides.mdx b/compressed-tokens/guides.mdx
deleted file mode 100644
index 16a44ebd..00000000
--- a/compressed-tokens/guides.mdx
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: Guides
-description: "Overview of guides to compressed token operations and reference table with descriptions. Guides include full code examples, troubleshooting, and advanced configurations."
-sidebarTitle: "Overview"
----
-
-import GuidesTable from '/snippets/overview-tables/compressed-tokens-guides-table.mdx';
-
-
diff --git a/compressed-tokens/guides/add-token-pools-to-mint-accounts.mdx b/compressed-tokens/guides/add-token-pools-to-mint-accounts.mdx
deleted file mode 100644
index bcc62989..00000000
--- a/compressed-tokens/guides/add-token-pools-to-mint-accounts.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: Create SPL Interface for Existing Mints
-description: "Create an SPL Interface PDA (omnibus account) for an existing SPL mint. Requires only fee_payer with no mint authority constraint."
-keywords: ["SPL interface", "compression", "omnibus account"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import ActionCode from '/snippets/code-snippets/compressed-token/create-token-pool/action.mdx';
-
-Create an SPL interface (omnibus account) for an existing SPL mint. `createSplInterface()` requires only `fee_payer` and has no mint authority constraint.
-
-
-The SPL Interface PDA requires rent; individual compressed token accounts are rent-free.
-
-
-
-```typescript function-create-token-pool.ts
-// Creates SPL interface (omnibus account) for existing SPL mint
-const transactionSignature = await createSplInterface(
- rpc,
- payer,
- mint,
-);
-```
-
-
-
-**Best Practice:** Each mint supports up to 4 SPL interfaces. During compression/decompression, SPL Interface PDAs get write-locked. Use `addTokenPools()` to create additional interfaces and increase per-block write-lock capacity.
-
-
-## Get Started
-
-
-
-### Create SPL interface
-
-
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-The mint has no SPL Interface PDA.
-
-```typescript
-const poolTx = await createSplInterface(rpc, payer, mint);
-console.log("SPL interface created:", poolTx);
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-Create SPL interfaces for multiple mints:
-
-```typescript
-const mints = [
- new PublicKey("MINT_1_ADDRESS"),
- new PublicKey("MINT_2_ADDRESS"),
- new PublicKey("MINT_3_ADDRESS"),
-];
-
-for (const mint of mints) {
- try {
- const poolTx = await createSplInterface(rpc, payer, mint);
- console.log(`SPL interface created for ${mint.toBase58()}:`, poolTx);
- } catch (error) {
- console.log(`Failed for ${mint.toBase58()}:`, error.message);
- }
-}
-```
-
-
-
-
-
-Create SPL interface for Token-2022 mints:
-
-```typescript
-import { TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
-
-const poolTx = await createSplInterface(
- rpc,
- payer,
- mint, // Token-2022 mint
- undefined,
- TOKEN_2022_PROGRAM_ID,
-);
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/guides/compress-decompress.mdx b/compressed-tokens/guides/compress-decompress.mdx
deleted file mode 100644
index af196600..00000000
--- a/compressed-tokens/guides/compress-decompress.mdx
+++ /dev/null
@@ -1,217 +0,0 @@
----
-title: Compress and Decompress SPL Tokens
-description: "Convert SPL tokens between compressed and regular format with compress() and decompress()."
-keywords: ["compress spl tokens", "decompress tokens on solana"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import MintPrereq from '/snippets/setup/compressed-tokens-mint-prereq.mdx';
-import CompressActionCode from '/snippets/code-snippets/compressed-token/compress/action.mdx';
-import DecompressActionCode from '/snippets/code-snippets/compressed-token/decompress/action.mdx';
-
-
-```typescript compress()
-// Compress SPL tokens to compressed tokens
-const compressionSignature = await compress(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- amount,
- payer, // owner of SPL tokens
- tokenAccount.address, // source SPL token account (sourceTokenAccount parameter)
- recipient, // recipient owner address (toAddress parameter)
-);
-```
-
-```typescript decompress()
-// Decompress compressed tokens to SPL tokens
-const transactionSignature = await decompress(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- amount,
- payer, // owner of compressed tokens
- tokenAccount.address, // destination token account (toAddress parameter)
-);
-```
-
-
-
-**Function Difference and Best Practice:**
-
-* `compress(amount, sourceTokenAccount, toAddress)` compresses specific amounts from source to a specified recipient. Use for transfers and precise amounts.
-* `compressSplTokenAccount(tokenAccount, remainingAmount)` compresses the entire SPL token account balance minus optional remaining amount only to the same owner. Use to migrate complete token accounts with optional partial retention. [Here is how](/compressed-tokens/guides/compress-spl-token-account).
-
-
-## Get Started
-
-
-
-### Compress / Decompress Tokens
-
-
-
-
-Before we can compress or decompresss, we need:
-
-* An SPL mint with an SPL interface. Create one for new mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or for existing mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
-* For `compress()` SPL tokens in an Associated Token Account, or
-* For `decompress()` compressed token accounts with sufficient balance.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-Check your balances before operations:
-
-```typescript
-// For decompression - check compressed balance
-const compressedAccounts = await rpc.getCompressedTokenAccountsByOwner(
- owner.publicKey,
- { mint }
-);
-const compressedBalance = compressedAccounts.items.reduce(
- (sum, account) => sum.add(account.parsed.amount),
- new BN(0)
-);
-
-// For compression - check SPL token balance
-const tokenBalance = await rpc.getTokenAccountBalance(tokenAccount);
-const splBalance = new BN(tokenBalance.value.amount);
-
-console.log("Can decompress up to:", compressedBalance.toString());
-console.log("Can compress up to:", splBalance.toString());
-```
-
-
-
-
-
-Ensure the signer owns the tokens being decompressed/compressed:
-
-```typescript
-// The owner parameter must be the actual owner
-const decompressTx = await decompress(
- rpc,
- payer, // can be different (pays fees)
- mint,
- amount,
- actualOwner, // must own compressed tokens
- destinationAta,
-);
-
-const compressTx = await compress(
- rpc,
- payer, // can be different (pays fees)
- mint,
- amount,
- actualOwner, // must own SPL tokens
- sourceAta,
- recipient,
-);
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-Compress tokens directly to someone else:
-
-```typescript
-const recipientWallet = new PublicKey("RECIPIENT_WALLET_ADDRESS");
-
-// Compress your SPL tokens to recipient
-const compressTx = await compress(
- rpc,
- payer,
- mint,
- amount,
- tokenOwner, // current owner signs
- tokenAccount, // your token account
- recipientWallet, // recipient gets compressed tokens
-);
-```
-
-
-
-
-
-Compress multiple token accounts:
-
-```typescript
-// Compress to multiple recipients at once
-const recipients = [recipient1.publicKey, recipient2.publicKey, recipient3.publicKey];
-const amounts = [1_000_000_000, 2_000_000_000, 500_000_000]; // Different amounts
-
-const batchCompressTx = await compress(
- rpc,
- payer,
- mint,
- amounts, // Array of amounts
- owner,
- tokenAccount,
- recipients, // Array of recipients
-);
-
-console.log("Batch compression completed:", batchCompressTx);
-```
-
-
-
-
-
-Decompress tokens using delegate authority:
-
-```typescript
-import { decompressDelegated } from '@lightprotocol/compressed-token';
-import { getAssociatedTokenAddress, TOKEN_PROGRAM_ID } from '@solana/spl-token';
-
-// Get ATA for decompressed tokens
-const ataAddress = await getAssociatedTokenAddress(
- mint,
- recipient,
- false,
- TOKEN_PROGRAM_ID
-);
-
-// Delegate decompresses tokens
-await decompressDelegated(
- rpc,
- payer,
- mint,
- amount,
- delegate, // Signer - owner of compressed tokens
- ataAddress, // Uncompressed token account (ATA)
-);
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/guides/compress-spl-token-account.mdx b/compressed-tokens/guides/compress-spl-token-account.mdx
deleted file mode 100644
index 3c0d1d6e..00000000
--- a/compressed-tokens/guides/compress-spl-token-account.mdx
+++ /dev/null
@@ -1,189 +0,0 @@
----
-title: Compress Complete SPL Token Accounts
-description: "Compress the entire balance of an SPL token account to reclaim rent. Optionally leave some tokens in SPL format."
-keywords: ["compress spl token accounts", "migrate spl to compressed"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import MintPrereq from '/snippets/setup/compressed-tokens-mint-prereq.mdx';
-import ActionCode from '/snippets/code-snippets/compressed-token/compress-spl-account/action.mdx';
-
-
-```typescript compressSplTokenAccount()
-// Compress entire SPL token account balance
-const transactionSignature = await compressSplTokenAccount(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- owner,
- tokenAccount, // SPL token account to compress
-);
-```
-
-```typescript partialCompression()
-// Compress account while keeping some tokens in SPL format
-const transactionSignature = await compressSplTokenAccount(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- owner,
- tokenAccount, // SPL token account to compress
- remainingAmount, // amount to keep in SPL format
-);
-```
-
-
-
-After compression, empty token accounts can now be closed to reclaim rent with [`closeAccount()`](https://solana.com/developers/cookbook/tokens/close-token-accounts).
-
-
-
-**Function Difference and Best Practice:**
-
-* `compressSplTokenAccount(tokenAccount, remainingAmount)` compresses the entire SPL token account balance minus optional remaining amount only to the same owner. Use to migrate complete token accounts with optional partial retention.
-* `compress(amount, sourceTokenAccount, toAddress)` compresses specific amounts from source to a specified recipient. Use for transfers and precise amounts. [Here is how](/compressed-tokens/guides/compress-decompress).
-
-
-## Get Started
-
-
-
-### Compress SPL Token Accounts
-
-
-
-
-
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-The token account doesn't have enough tokens for the operation.
-
-```typescript
-// Check token account balance before compression
-const balance = await rpc.getTokenAccountBalance(tokenAccount);
-
-if (Number(balance.value.amount) === 0) {
- console.log("Token account is empty");
- return;
-}
-
-console.log("Available balance:", Number(balance.value.amount));
-
-// Proceed with compression
-const compressTx = await compressSplTokenAccount(
- rpc,
- payer,
- mint,
- owner,
- tokenAccount,
-);
-```
-
-
-
-
-
-The `remainingAmount` parameter exceeds the current account balance.
-
-```typescript
-const balance = await rpc.getTokenAccountBalance(tokenAccount);
-const availableAmount = Number(balance.value.amount);
-const remainingAmount = bn(500_000_000); // 0.5 tokens
-
-if (remainingAmount.gt(bn(availableAmount))) {
- console.log(`Cannot leave ${remainingAmount.toString()} tokens`);
- console.log(`Available balance: ${availableAmount}`);
- throw new Error("Remaining amount exceeds balance");
-}
-
-// Use valid remaining amount
-const compressTx = await compressSplTokenAccount(
- rpc,
- payer,
- mint,
- owner,
- tokenAccount,
- remainingAmount, // must be <= balance
-);
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-Compress most tokens while leaving some in SPL format:
-
-```typescript
-import { bn } from '@lightprotocol/stateless.js';
-
-// Leave 100 tokens (0.1 with 9 decimals) in SPL account
-const remainingAmount = bn(100_000_000);
-
-const compressTx = await compressSplTokenAccount(
- rpc,
- payer,
- mint,
- owner,
- tokenAccount,
- remainingAmount, // amount to keep in SPL format
-);
-
-// Account will retain remainingAmount tokens
-```
-
-
-
-
-
-Compress several token accounts for the same mint:
-
-```typescript
-const tokenAccounts = [
- { account: new PublicKey("ACCOUNT_1"), owner: owner1 },
- { account: new PublicKey("ACCOUNT_2"), owner: owner2 },
- { account: new PublicKey("ACCOUNT_3"), owner: owner3 },
-];
-
-// Compress each account
-for (const { account, owner } of tokenAccounts) {
- console.log(`Compressing account: ${account.toBase58()}`);
-
- try {
- const compressTx = await compressSplTokenAccount(
- rpc,
- payer,
- mint,
- owner,
- account,
- );
- console.log(`Compressed: ${compressTx}`);
- } catch (error) {
- console.log(`Failed: ${error.message}`);
- }
-}
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/guides/create-compressed-token-accounts.mdx b/compressed-tokens/guides/create-compressed-token-accounts.mdx
deleted file mode 100644
index 28eecd3f..00000000
--- a/compressed-tokens/guides/create-compressed-token-accounts.mdx
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: Create Compressed Token Accounts
-description: Short guide to compressed token account creation with ZK Compression on Solana and difference to regular token accounts.
-keywords: ["create compressed token account", "rent free token accounts on solana"]
----
-
-Compressed token accounts store ownership information for compressed tokens like regular token accounts with two core differences. Compressed Tokens
-
-* do not require an Associated Token Accounts (ATAs), and
-* do not require a rent-exempt balance.
-
-Compressed token accounts are created in the following scenarios:
-
-1. `mintTo()` creates compressed token accounts for recipients.
-
-How to Mint Compressed Tokens
-
-2. `transfer()` consumes existing accounts of the sender as input, and creates new compressed token accounts with updated balances as output for the sender and recipient(s).
-
-Transfer Compressed Tokens
\ No newline at end of file
diff --git a/compressed-tokens/guides/create-mint-with-token-pool.mdx b/compressed-tokens/guides/create-mint-with-token-pool.mdx
deleted file mode 100644
index e9decac6..00000000
--- a/compressed-tokens/guides/create-mint-with-token-pool.mdx
+++ /dev/null
@@ -1,99 +0,0 @@
----
-title: Create a Mint with SPL Interface for Compression
-description: "Create an SPL token mint with an SPL Interface PDA (omnibus account) for compression. The SPL interface holds SPL tokens while compressed and releases them when decompressed."
-keywords: ["register mint for compression", "compressed mint account", "SPL interface"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import ActionCode from '/snippets/code-snippets/compressed-token/create-mint/action.mdx';
-import InstructionCode from '/snippets/code-snippets/compressed-token/create-mint/instruction.mdx';
-
-The mint account itself requires rent (like regular SPL mints), but individual compressed token accounts are rent-free.
-Create an SPL interface (omnibus account) for an existing SPL mint with [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts) or use `createMint()` to create a new one from scratch.
-
-
-```typescript createMint()
-// Create SPL mint with SPL interface for compression
-const { mint, transactionSignature } = await createMint(
- rpc,
- payer,
- mintAuthority.publicKey,
- decimals,
-);
-```
-
-
-
-**Best Practice:** Each mint supports up to 4 SPL interfaces. During compression/decompression, SPL Interface PDAs get write-locked. Use `addTokenPools()` to create additional interfaces and increase per-block write-lock capacity.
-
-
-## Get Started
-
-
-
-### Create a mint with SPL interface for compression
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Advanced Configuration
-
-
-
-
-Customize who can mint new compressed tokens.
-
-```typescript
-const mintAuthority = Keypair.generate();
-
-const { mint, transactionSignature } = await createMint(
- rpc,
- payer,
- mintAuthority.publicKey,
- 9,
-);
-```
-
-
-
-
-
-Customize who can freeze/thaw compressed token accounts.
-
-```typescript
-const freezeAuthority = Keypair.generate();
-
-const { mint, transactionSignature } = await createMint(
- rpc,
- payer,
- payer.publicKey, // mint authority
- 9, // decimals
- Keypair.generate(), // mint keypair
- undefined, // confirm options
- undefined, // token program ID
- freezeAuthority.publicKey, // freeze authority
-);
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/guides/delegate.mdx b/compressed-tokens/guides/delegate.mdx
deleted file mode 100644
index a17c7c84..00000000
--- a/compressed-tokens/guides/delegate.mdx
+++ /dev/null
@@ -1,166 +0,0 @@
----
-title: Approve and Revoke Delegate Authority
-description: "Grant and remove delegate spending authority for compressed tokens with approve() and revoke(). Only the token owner can perform these operations."
-keywords: ["delegate authority on solana", "token delegation compressed"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import ApproveActionCode from '/snippets/code-snippets/compressed-token/approve/action.mdx';
-import RevokeActionCode from '/snippets/code-snippets/compressed-token/revoke/action.mdx';
-
-The `approve()` and `revoke()` functions grant and remove delegate spending authority for compressed tokens. Only the token owner can perform these instructions.
-
-
-```typescript approve()
-// Approve delegate for spending up to the specified amount
-const approveSignature = await approve(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- amount,
- owner,
- delegate.publicKey, // delegate account
-);
-```
-
-```typescript revoke()
-// Get delegated accounts for revocation
-const delegatedAccounts = await rpc.getCompressedTokenAccountsByDelegate(
- delegate.publicKey,
- { mint }
-);
-
-// Revoke delegate authority
-const revokeSignature = await revoke(
- rpc,
- payer,
- delegatedAccounts.items, // delegated compressed token accounts
- owner,
-);
-```
-
-
-## Get Started
-
-
-
-### Approve / Revoke Delegates
-
-
-
-
-
-
-
-
-
-
-
-
-
-Before we approve or revoke delegates, we need:
-
-* compressed token accounts to delegate or revoke delegation from, and
-* an SPL mint with an SPL interface. Create one for new mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or for existing mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-Attempting to revoke non-delegated accounts.
-
-```typescript
-/// Verify accounts are delegated before revocation.
-const delegateAccounts = await rpc.getCompressedTokenAccountsByDelegate(
- delegate.publicKey,
- { mint }
-);
-
-if (delegateAccounts.items.length === 0) {
- console.log("No delegated accounts to revoke");
- return;
-}
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-```typescript
-const delegates = [
- Keypair.generate().publicKey,
- Keypair.generate().publicKey,
-];
-
-const amounts = [
- 200_000_000, // 0.2 tokens to first delegate
- 300_000_000, // 0.3 tokens to second delegate
-];
-
-// Approve each delegate
-for (let i = 0; i < delegates.length; i++) {
- const approveTx = await approve(
- rpc,
- payer,
- mint,
- amounts[i],
- tokenOwner,
- delegates[i],
- );
-
- console.log(`Delegate ${i + 1} approved:`, approveTx);
-}
-```
-
-
-
-
-
-```typescript
-const delegates = [
- new PublicKey("DELEGATE_1_ADDRESS"),
- new PublicKey("DELEGATE_2_ADDRESS"),
-];
-
-// Revoke each delegate
-for (const delegate of delegates) {
- // Get delegated accounts for this delegate
- const delegateAccounts = await rpc.getCompressedTokenAccountsByDelegate(
- delegate,
- { mint }
- );
-
- if (delegateAccounts.items.length > 0) {
- const revokeTx = await revoke(
- rpc,
- payer,
- delegateAccounts.items,
- tokenOwner,
- );
-
- console.log(`Delegate ${delegate.toBase58()} revoked:`, revokeTx);
- }
-}
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/guides/merge-compressed-token-accounts.mdx b/compressed-tokens/guides/merge-compressed-token-accounts.mdx
deleted file mode 100644
index 278547b2..00000000
--- a/compressed-tokens/guides/merge-compressed-token-accounts.mdx
+++ /dev/null
@@ -1,145 +0,0 @@
----
-title: Merge Compressed Token Accounts
-description: "Consolidate multiple compressed token accounts of the same mint into a single account to reduce fragmentation."
-keywords: ["merge compressed token accounts", "consolidate token accounts"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import ActionCode from '/snippets/code-snippets/compressed-token/merge-token-accounts/action.mdx';
-
-The `mergeTokenAccounts()` function consolidates multiple compressed accounts of the same mint into a single compressed account.
-
-The function
-
-1. consumes multiple compressed token accounts (up to 8 accounts), and
-2. creates a single output compressed token account with combined balance for the owner.
-
-
-State trees where compressed account's are stored, are append only. `mergeTokenAccounts()` reduces account fragmentation to simplify balance calculations from `getCompressedTokenAccountsByOwner`.
-
-
-
-```typescript function-merge-accounts.ts
-// Combines multiple compressed token accounts into single compressed account
-const transactionSignature = await mergeTokenAccounts(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- owner,
-);
-```
-
-
-## Get Started
-
-
-
-### Merge Compressed Accounts
-
-
-
-
-
-
-Before we merge compressed accounts, we need
-
-* Multiple compressed token accounts of the same mint owned by the same wallet, and
-* an SPL mint with an SPL interface. Create one for new mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or for existing mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-The owner has no compressed token accounts for the specified mint:
-
-```typescript
-// Check if accounts exist before merging
-const accounts = await rpc.getCompressedTokenAccountsByOwner(
- owner.publicKey,
- { mint }
-);
-
-if (accounts.items.length === 0) {
- console.log("No compressed token accounts found for this mint");
- console.log("Mint address:", mint.toBase58());
- console.log("Owner address:", owner.publicKey.toBase58());
- return;
-}
-
-console.log(`Found ${accounts.items.length} accounts to merge`);
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-```typescript
-// Get account count
-const accounts = await rpc.getCompressedTokenAccountsByOwner(
- owner.publicKey,
- { mint }
-);
-
-// Only merge if more than 2 accounts
-if (accounts.items.length > 2) {
- console.log(`Merging ${accounts.items.length} accounts...`);
-
- const mergeTx = await mergeTokenAccounts(
- rpc,
- payer,
- mint,
- tokenOwner,
- );
-
- console.log("Merge completed:", mergeTx);
-} else {
- console.log("Merge not needed - optimal account structure");
-}
-```
-
-
-
-
-
-```typescript
-const mints = [
- new PublicKey("MINT_1_ADDRESS"),
- new PublicKey("MINT_2_ADDRESS"),
-];
-
-// Merge accounts for each mint
-for (const mint of mints) {
- console.log(`Merging accounts for mint: ${mint.toBase58()}`);
-
- const mergeTx = await mergeTokenAccounts(
- rpc,
- payer,
- mint,
- tokenOwner,
- );
-
- console.log(`Merge completed: ${mergeTx}`);
-}
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/guides/mint-compressed-tokens.mdx b/compressed-tokens/guides/mint-compressed-tokens.mdx
deleted file mode 100644
index fe5b0fa4..00000000
--- a/compressed-tokens/guides/mint-compressed-tokens.mdx
+++ /dev/null
@@ -1,154 +0,0 @@
----
-title: Mint Compressed Tokens
-description: "Mint tokens to compressed token accounts for recipients and increases a mint's token supply. Only the mint authority can perform this operation."
-keywords: ["mint compressed tokens on solana", "scalable token minting"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import MintPrereq from '/snippets/setup/compressed-tokens-mint-prereq.mdx';
-import ActionCode from '/snippets/code-snippets/compressed-token/mint-to/action.mdx';
-import InstructionCode from '/snippets/code-snippets/compressed-token/mint-to/instruction.mdx';
-
-```typescript
-// Mint compressed tokens - mints SPL tokens to pool, creates compressed token accounts
-const transactionSignature = await mintTo(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- recipient, // recipient address (toPubkey parameter)
- payer, // mint authority
- amount,
-);
-```
-
-## Get Started
-
-
-
-### Mint Compressed Tokens
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-
-```typescript
-// Error: SPL interface not found for this mint. Create a compressed token
-// SPL interface PDA for mint: [ADDRESS] via createSplInterface().
-```
-
-The mint has no SPL Interface PDA. Ensure you created the mint using `createMint` or call `createSplInterface()` for an existing mint.
-
-```typescript
-// Create mint with SPL interface for compression
-import { createMint } from '@lightprotocol/compressed-token';
-const { mint } = await createMint(rpc, payer, payer.publicKey, 9);
-```
-
-
-
-
-
-The SPL interface info doesn't correspond to the mint address. Ensure you're fetching the correct interface:
-
-```typescript
-// Get SPL interface infos for your mint
-const tokenPoolInfo = await getTokenPoolInfos(rpc, mint);
-```
-
-
-
-
-
-When minting to multiple recipients, ensure arrays are the same size.
-
-```typescript
-// Wrong: Mismatched array lengths
-const recipients = [addr1, addr2, addr3];
-const amounts = [100, 200]; // Only 2 amounts for 3 recipients
-
-// Correct: Same length arrays
-const recipients = [addr1, addr2, addr3];
-const amounts = [100, 200, 300]; // 3 amounts for 3 recipients
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-```typescript
-// Mint different amounts to multiple recipients
-const recipients = [
- Keypair.generate().publicKey,
- Keypair.generate().publicKey,
- Keypair.generate().publicKey,
-];
-
-const amounts = [
- 1_000_000_000, // 1 token
- 2_000_000_000, // 2 tokens
- 500_000_000, // 0.5 tokens
-];
-
-const transactionSignature = await mintTo(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- recipients, // array of recipients (toPubkey parameter)
- payer, // mint authority
- amounts, // array of amounts (amount parameter)
-);
-```
-
-
-
-
-
-Mint tokens using a custom mint authority with `approveAndMintTo()`:
-
-```typescript
-import { approveAndMintTo } from '@lightprotocol/compressed-token';
-
-// Mint tokens with a separate mint authority
-const transactionSignature = await approveAndMintTo(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- recipient.publicKey, // recipient of minted tokens (toPubkey parameter)
- mintAuthority, // mint authority
- mintAmount,
-);
-```
-
-
-
-
-# Next Steps
-
-
\ No newline at end of file
diff --git a/compressed-tokens/guides/transfer-compressed-tokens.mdx b/compressed-tokens/guides/transfer-compressed-tokens.mdx
deleted file mode 100644
index 3e10eb27..00000000
--- a/compressed-tokens/guides/transfer-compressed-tokens.mdx
+++ /dev/null
@@ -1,190 +0,0 @@
----
-title: Transfer Compressed Tokens
-description: "Transfer compressed tokens between accounts. Transfers consume input accounts and create new output accounts with updated balances."
-keywords: ["transfer compressed tokens", "token transfer on solana"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-import MintPrereq from '/snippets/setup/compressed-tokens-mint-prereq.mdx';
-import ActionCode from '/snippets/code-snippets/compressed-token/transfer/action.mdx';
-
-The `transfer()` function moves compressed tokens between accounts.
-* SPL token transfers that update the existing account
-* Compressed token transfers consume input accounts from the sender and create new output accounts for sender and recipient with updated balances.
-
-SPL token accounts can be compressed in the same transaction with `compress_or_decompress_amount`, if needed.
-
-
-
-```typescript function-transfer-compressed-tokens.ts
-// Transfer compressed tokens
-const transactionSignature = await transfer(
- rpc,
- payer,
- mint, // SPL mint with SPL interface for compression
- amount,
- payer,
- recipient, // destination address (toAddress parameter)
-)
-```
-
-## Get Started
-
-
-
-### Transfer Compressed Tokens
-
-
-
-
-
-
-
-
-
-# Troubleshooting
-
-
-
-
-The sender doesn't have enough compressed tokens for the requested transfer amount.
-
-```typescript
-// Check current balance first
-const tokenAccounts = await rpc.getCompressedTokenAccountsByOwner(
- owner.publicKey,
- { mint }
-);
-
-if (tokenAccounts.items.length === 0) {
- throw new Error("No compressed token accounts found");
-}
-
-// Calculate total balance across all accounts
-const totalBalance = tokenAccounts.items.reduce(
- (sum, account) => sum.add(account.parsed.amount),
- new BN(0)
-);
-
-console.log("Available balance:", totalBalance.toString());
-
-// Ensure transfer amount doesn't exceed balance
-if (new BN(transferAmount).gt(totalBalance)) {
- throw new Error(`Transfer amount ${transferAmount} exceeds balance ${totalBalance.toString()}`);
-}
-```
-
-
-
-
-
-The transfer requires more than 4 compressed accounts, which exceeds the transaction limit.
-
-```typescript
-// Error message: "Account limit exceeded: max X (4 accounts) per transaction.
-// Total balance: Y (Z accounts). Consider multiple transfers to spend full balance."
-
-// Split into multiple smaller transfers
-const maxTransferPerTx = 1_000_000_000; // Adjust based on your account sizes
-
-if (transferAmount > maxTransferPerTx) {
- console.log("Large transfer detected, splitting into multiple transactions...");
-
- let remainingAmount = transferAmount;
- while (remainingAmount > 0) {
- const currentTransfer = Math.min(remainingAmount, maxTransferPerTx);
-
- await transfer(
- rpc,
- payer,
- mint,
- currentTransfer,
- owner,
- recipient
- );
-
- remainingAmount -= currentTransfer;
- console.log(`Transferred ${currentTransfer}, remaining: ${remainingAmount}`);
- }
-}
-```
-
-
-
-
-# Advanced Configuration
-
-
-
-
-Transfer to multiple recipients in separate transactions:
-
-```typescript
-const recipients = [
- Keypair.generate().publicKey,
- Keypair.generate().publicKey,
- Keypair.generate().publicKey,
-];
-
-const amounts = [
- 100_000_000, // 0.1 tokens
- 200_000_000, // 0.2 tokens
- 150_000_000, // 0.15 tokens
-];
-
-for (let i = 0; i < recipients.length; i++) {
- const transactionSignature = await transfer(
- rpc,
- payer,
- mint,
- amounts[i],
- owner,
- recipients[i],
- );
-
- console.log(`Transfer ${i + 1} completed:`, transactionSignature);
-}
-```
-
-
-
-
-
-Transfer tokens using delegate authority:
-
-```typescript
-import { approve, transferDelegated } from '@lightprotocol/compressed-token';
-
-// 1. Owner approves delegate
-await approve(
- rpc,
- payer,
- mint,
- amount,
- owner, // Signer
- delegate.publicKey, // PublicKey
-);
-
-// 2. Delegate transfers tokens
-await transferDelegated(
- rpc,
- payer,
- mint,
- transferAmount,
- delegate, // Signer - named "owner" in SDK
- recipient,
-);
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/compressed-tokens/overview.mdx b/compressed-tokens/overview.mdx
index cab4c9e9..9dbd8714 100644
--- a/compressed-tokens/overview.mdx
+++ b/compressed-tokens/overview.mdx
@@ -1,6 +1,6 @@
---
-title: Overview
-description: "Overview to compressed tokens and guides with full code examples. Use for distributing tokens (eg rewards, airdrops) or creating associated token accounts for users."
+title: "Legacy Compressed Tokens"
+description: "Compressed tokens are the most efficient way to distribute SPL tokens (eg rewards, airdrops). For other token purposes use Light Token."
keywords: ["compressed tokens on solana", "scalable token distribution on solana", "infrastructure for token distribution", "airdrop infrastructure on solana", "launchpad infrastructure on solana"]
---
@@ -8,11 +8,18 @@ import GuidesTable from "/snippets/overview-tables/compressed-tokens-guides-tabl
import AdvancedGuidesTable from "/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx";
import SetupEnvironment from "/snippets/setup/setup-environment-tabs.mdx";
import InstallDependencies from "/snippets/setup/install-dependencies-codegroup.mdx";
+import SupportFooter from "/snippets/support-footer.mdx";
import { TokenAccountCompressedVsSpl } from "/snippets/jsx/token-account-compressed-vs-spl.jsx";
+import AgentSkillAirdrop from "/snippets/setup/agent-skill-airdrop.mdx";
-
- **Compressed Tokens are supported by leading Solana wallets such as Phantom and Backpack.**
-
+
+
+
+**Note: The new [Light Token Program Beta](/light-token/welcome)** is live on Solana Devnet with mainnet expected in Q1 2026.
+We recommend to use Light Token for most purposes except airdrops and other forms of token distribution.
+The SDK for compressed tokens can still be used once Light Token is on Solana Mainnet.
+For production use today, use Compressed Tokens, which are on Solana Mainnet.
+
| Creation | Solana | Compressed |
| :---------------- | :------------------ | :----------------- |
@@ -22,16 +29,20 @@ import { TokenAccountCompressedVsSpl } from "/snippets/jsx/token-account-compres
2. Compressed token accounts are rent-free.
3. Any light-token or SPL token can be compressed/decompressed at will.
+
+ **Compressed Tokens are supported by leading Solana wallets such as Phantom and Backpack.**
+
+
## Recommended Usage of Compressed Tokens
Distribute tokens without paying upfront rent per recipient.
@@ -43,44 +54,32 @@ import { TokenAccountCompressedVsSpl } from "/snippets/jsx/token-account-compres
title="Compress SPL Token Accounts"
icon="chevron-right"
color="#0066ff"
- href="/compressed-tokens/guides/compress-spl-token-account"
+ href="https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/compress.ts"
horizontal
/>
-# Get Started
-
-
-
-
-
-### Install dependencies
-
-
-
-
-
-
-### Set up your developer environment
-
-
-
-
+## RPC methods
-
+The Photon API provides ZK Compression methods that extend the default Solana JSON RPC API.
-
+
-
+## Guides
-
- ### Basic Guides
-
-
+The SDK for compressed tokens can be used but is not maintained.
+Use [Light Token](/light-token/welcome) for other purposes than token distribution or storage of inactive tokens.
-
- ### Advanced Guides
-
-
+| | |
+|---------|------|
+| Compressed token cookbook | [GitHub](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) |
+| Token distribution | [GitHub](https://github.com/Lightprotocol/examples-zk-compression/tree/main/example-token-distribution) |
+| Web client | [GitHub](https://github.com/Lightprotocol/examples-zk-compression/tree/main/example-web-client) |
-
+
diff --git a/docs.json b/docs.json
index e15a5e8d..1ce3a01d 100644
--- a/docs.json
+++ b/docs.json
@@ -1,6 +1,6 @@
{
"$schema": "https://mintlify.com/docs.json",
- "theme": "aspen",
+ "theme": "maple",
"name": "Light Protocol",
"colors": {
"primary": "#0066FF",
@@ -20,67 +20,24 @@
}
},
"navigation": {
- "tabs": [
+ "anchors": [
{
- "tab": "Home",
+ "anchor": "Documentation",
+ "icon": "book",
"groups": [
{
- "group": "Overview",
+ "group": "Introduction",
"pages": [
- "home"
- ]
- }
- ]
- },
- {
- "tab": "Light Token Program",
- "groups": [
- {
- "group": "Get Started",
- "pages": [
- "light-token/welcome",
- "light-token/quickstart",
- "light-token/faq"
+ "home",
+ "faq"
]
},
{
- "group": "DeFi",
+ "group": "Light Token Program",
"pages": [
- "light-token/defi/routers",
- "light-token/defi/programs",
- "light-token/defi/programs-pinocchio"
- ]
- },
- {
- "group": "Data Streaming",
- "pages": [
- "light-token/toolkits/for-streaming-tokens",
- "light-token/toolkits/for-streaming-mints"
- ]
- },
- {
- "group": "Toolkits",
- "pages": [
- "light-token/toolkits/overview",
- "light-token/toolkits/for-payments",
- "light-token/toolkits/for-wallets"
- ]
- },
- {
- "group": "Cookbook",
- "pages": [
- "light-token/cookbook/overview",
- {
- "group": "Examples",
- "expanded": true,
- "pages": [
- "light-token/examples/client",
- "light-token/examples/program"
- ]
- },
+ "light-token/welcome",
{
- "group": "Recipes",
- "expanded": true,
+ "group": "Cookbook",
"pages": [
"light-token/cookbook/create-mint",
"light-token/cookbook/create-ata",
@@ -94,142 +51,84 @@
"light-token/cookbook/load-ata",
"light-token/cookbook/close-token-account",
"light-token/cookbook/burn"
-
+ ]
+ },
+ {
+ "group": "Examples",
+ "pages": [
+ "light-token/examples/client",
+ "light-token/examples/program"
]
}
]
},
{
- "group": "Learn",
+ "group": "PDA Accounts",
"pages": [
- "learn/light-token-standard",
- "ai-tools/guide"
+ "pda/overview",
+ "pda/light-pda/overview",
+ {
+ "group": "Compressed PDA",
+ "pages": [
+ "pda/compressed-pdas/overview",
+ "pda/compressed-pdas/guides/client-guide",
+ {
+ "group": "Program Guides",
+ "expanded": true,
+ "pages": [
+ "pda/compressed-pdas/guides",
+ "pda/compressed-pdas/guides/how-to-create-compressed-accounts",
+ "pda/compressed-pdas/guides/how-to-update-compressed-accounts",
+ "pda/compressed-pdas/guides/how-to-close-compressed-accounts",
+ "pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts",
+ "pda/compressed-pdas/guides/how-to-burn-compressed-accounts"
+ ]
+ },
+ "pda/compressed-pdas/program-examples"
+ ]
+ }
]
},
{
- "group": "SDK Reference",
- "pages": [
- "api-reference/libraries/light-sdk",
- "api-reference/libraries/light-token",
- "api-reference/libraries/light-program-test",
- "api-reference/libraries/light-client",
- "api-reference/libraries/stateless-js",
- "api-reference/libraries/compressed-token"
- ]
- }
- ]
- },
- {
- "tab": "ZK Compression",
- "groups": [
- {
- "group": "Get Started",
+ "group": "For DeFi",
"pages": [
- "welcome",
- "quickstart"
+ "light-token/defi/routers",
+ "light-token/defi/programs",
+ "light-token/defi/programs-pinocchio"
]
},
{
- "group": "ZK",
+ "group": "For Data Streaming",
"pages": [
- "zk/overview",
- "zk/examples"
+ "light-token/toolkits/for-streaming-mints",
+ "light-token/toolkits/for-streaming-tokens"
]
},
{
- "group": "Compressed PDAs",
- "expanded": true,
+ "group": "For Stablecoin Payments",
"pages": [
- "compressed-pdas/overview",
- "client-library/client-guide",
- {
- "group": "Program Guides",
- "pages": [
- "compressed-pdas/guides",
- "compressed-pdas/guides/how-to-create-compressed-accounts",
- "compressed-pdas/guides/how-to-update-compressed-accounts",
- "compressed-pdas/guides/how-to-close-compressed-accounts",
- "compressed-pdas/guides/how-to-reinitialize-compressed-accounts",
- "compressed-pdas/guides/how-to-burn-compressed-accounts",
- "compressed-pdas/guides/how-to-create-nullifier-pdas"
- ]
- },
- "compressed-pdas/program-examples",
- "compressed-pdas/solana-attestation-service"
+ "light-token/toolkits/for-payments",
+ "pda/compressed-pdas/guides/how-to-create-nullifier-pdas"
]
},
{
- "group": "Compressed Tokens",
+ "group": "For Wallets",
"pages": [
- "compressed-tokens/overview",
- "compressed-tokens/for-privy",
- "compressed-tokens/advanced-guides/airdrop",
- {
- "group": "Cookbook",
- "pages": [
- "compressed-tokens/guides/create-compressed-token-accounts",
- "compressed-tokens/guides/mint-compressed-tokens",
- "compressed-tokens/guides/transfer-compressed-tokens",
- "compressed-tokens/guides/compress-decompress",
- "compressed-tokens/guides/compress-spl-token-account",
- "compressed-tokens/guides/create-mint-with-token-pool",
- "compressed-tokens/guides/add-token-pools-to-mint-accounts",
- "compressed-tokens/guides/merge-compressed-token-accounts",
- "compressed-tokens/guides/delegate"
- ]
- },
- {
- "group": "Implementation Guides",
- "pages": [
- {
- "group": "Integration",
- "expanded": true,
- "pages": [
- "compressed-tokens/advanced-guides/how-to-combine-operations-in-one-transaction",
- "compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens",
- "compressed-tokens/advanced-guides/use-token-2022-with-compression"
- ]
- },
- {
- "group": "Examples",
- "expanded": true,
- "pages": [
- "compressed-tokens/advanced-guides/example-token-distribution"
- ]
- }
- ]
- }
+ "light-token/toolkits/for-wallets",
+ "light-token/toolkits/for-privy",
+ "light-token/toolkits/sponsor-top-ups"
]
},
{
- "group": "JSON RPC Methods",
+ "group": "For Other Use Cases",
"pages": [
- "api-reference/json-rpc-methods/overview",
+ "compressed-tokens/airdrop",
+ "pda/compressed-pdas/solana-attestation-service",
{
- "group": "Methods",
+ "group": "Custom ZK Applications",
"pages": [
- "api-reference/json-rpc-methods/methods",
- "api-reference/json-rpc-methods/getcompressedaccount",
- "api-reference/json-rpc-methods/getcompressedaccountsbyowner",
- "api-reference/json-rpc-methods/getcompressedbalancebyowner",
- "api-reference/json-rpc-methods/getcompressedbalance",
- "api-reference/json-rpc-methods/getcompressedminttokenholders",
- "api-reference/json-rpc-methods/getcompressedtokenaccountbalance",
- "api-reference/json-rpc-methods/getcompressedtokenaccountbydelegate",
- "api-reference/json-rpc-methods/getcompressedtokenaccountsbyowner",
- "api-reference/json-rpc-methods/getcompressedtokenbalancesbyowner",
- "api-reference/json-rpc-methods/getcompressionsignaturesforaccount",
- "api-reference/json-rpc-methods/getcompressionsignaturesforaddress",
- "api-reference/json-rpc-methods/getcompressionsignaturesforowner",
- "api-reference/json-rpc-methods/getcompressionsignaturesfortokenowner",
- "api-reference/json-rpc-methods/getindexerhealth",
- "api-reference/json-rpc-methods/getindexerslot",
- "api-reference/json-rpc-methods/getlatestcompressionsignatures",
- "api-reference/json-rpc-methods/getlatestnonvotingsignatures",
- "api-reference/json-rpc-methods/getmultiplecompressedaccounts",
- "api-reference/json-rpc-methods/getmultiplenewaddressproofs",
- "api-reference/json-rpc-methods/gettransactionwithcompressioninfo",
- "api-reference/json-rpc-methods/getvalidityproof"
+ "zk/overview",
+ "zk/examples"
]
}
]
@@ -237,8 +136,10 @@
{
"group": "Learn",
"pages": [
+ "learn/overview",
+ "learn/light-token-standard",
{
- "group": "Core Concepts",
+ "group": "Core Concepts (ZK Compression)",
"pages": [
"learn/core-concepts",
"learn/core-concepts/compressed-account-model",
@@ -246,14 +147,15 @@
"learn/core-concepts/transaction-lifecycle",
"learn/core-concepts/considerations"
]
- },
- "ai-tools/guide"
+ }
]
},
{
"group": "Resources",
"pages": [
- "resources/cli-installation",
+ "resources/cli",
+ "resources/migration-v1-to-v2",
+ "resources/addresses-and-urls",
{
"group": "Error Cheatsheet",
"pages": [
@@ -261,35 +163,78 @@
"resources/error-cheatsheet/debug-0x179b-6043-proofverificationfailed"
]
},
- {
- "group": "SDKs",
- "pages": [
- "resources/sdks/client-development",
- "resources/sdks/program-development"
- ]
- },
- "resources/addresses-and-urls"
+ "compressed-tokens/overview",
+ "resources/security"
+ ]
+ }
+ ]
+ },
+ {
+ "anchor": "API Reference",
+ "icon": "code",
+ "groups": [
+ {
+ "group": "SDK",
+ "pages": [
+ "api-reference/sdk"
]
},
{
- "group": "References",
+ "group": "Anchor",
"pages": [
- "references/whitepaper",
- "references/node-operators",
- "references/terminology",
- "references/migration-v1-to-v2",
- "support",
- "references/security"
+ "resources/anchor-constraints"
]
},
{
- "group": "SDK Reference",
+ "group": "JSON RPC Methods",
+ "pages": [
+ "api-reference/json-rpc-methods/overview",
+ "api-reference/json-rpc-methods/getcompressedaccount",
+ "api-reference/json-rpc-methods/getcompressedaccountsbyowner",
+ "api-reference/json-rpc-methods/getcompressedbalancebyowner",
+ "api-reference/json-rpc-methods/getcompressedtokenaccountsbyowner",
+ "api-reference/json-rpc-methods/getcompressedtokenbalancesbyowner",
+ "api-reference/json-rpc-methods/getvalidityproof",
+ "api-reference/json-rpc-methods/getcompressionsignaturesforaddress",
+ "api-reference/json-rpc-methods/getcompressionsignaturesforowner",
+ "api-reference/json-rpc-methods/gettransactionwithcompressioninfo",
+ "api-reference/json-rpc-methods/getindexerhealth",
+ "api-reference/json-rpc-methods/getindexerslot",
+ "api-reference/json-rpc-methods/getcompressedbalance",
+ "api-reference/json-rpc-methods/getcompressedminttokenholders",
+ "api-reference/json-rpc-methods/getcompressedtokenaccountbalance",
+ "api-reference/json-rpc-methods/getcompressedtokenaccountbydelegate",
+ "api-reference/json-rpc-methods/getcompressionsignaturesforaccount",
+ "api-reference/json-rpc-methods/getcompressionsignaturesfortokenowner",
+ "api-reference/json-rpc-methods/getlatestcompressionsignatures",
+ "api-reference/json-rpc-methods/getlatestnonvotingsignatures",
+ "api-reference/json-rpc-methods/getmultiplecompressedaccounts",
+ "api-reference/json-rpc-methods/getmultiplenewaddressproofs"
+ ]
+ }
+ ]
+ },
+ {
+ "anchor": "AI Tools",
+ "icon": "robot",
+ "groups": [
+ {
+ "group": "AI Tools",
+ "pages": [
+ "ai-tools/guide",
+ "ai-tools/prompts"
+ ]
+ }
+ ]
+ },
+ {
+ "anchor": "Support",
+ "icon": "headset",
+ "groups": [
+ {
+ "group": "Support",
"pages": [
- "api-reference/libraries/stateless-js",
- "api-reference/libraries/compressed-token",
- "api-reference/libraries/light-client",
- "api-reference/libraries/light-sdk",
- "api-reference/libraries/light-program-test"
+ "support"
]
}
]
@@ -317,15 +262,14 @@
"navbar": {
"links": [
{
- "label": "Get Support",
- "icon": "discord",
- "href": "https://discord.gg/CYvjBgzRFP"
+ "label": "Changelog",
+ "icon": "megaphone",
+ "href": "https://github.com/Lightprotocol/light-protocol/releases"
},
{
- "type": "button",
"label": "GitHub",
"icon": "github",
- "href": "https://github.com/Lightprotocol/light-protocol"
+ "href": "https://github.com/Lightprotocol"
}
]
},
@@ -365,11 +309,55 @@
"redirects": [
{
"source": "/landing",
- "destination": "/welcome"
+ "destination": "https://zkcompression.com/home"
+ },
+ {
+ "source": "/welcome",
+ "destination": "https://zkcompression.com/home"
+ },
+ {
+ "source": "/learn/ai-tools-guide",
+ "destination": "https://zkcompression.com/ai-tools/guide"
+ },
+ {
+ "source": "/resources/sdks/client-development",
+ "destination": "https://zkcompression.com/api-reference/sdk"
+ },
+ {
+ "source": "/resources/sdks/program-development",
+ "destination": "https://zkcompression.com/api-reference/sdk"
+ },
+ {
+ "source": "/compressed-tokens/for-privy",
+ "destination": "https://zkcompression.com/light-token/toolkits/for-privy"
+ },
+ {
+ "source": "/client-library/client-guide",
+ "destination": "https://zkcompression.com/pda/compressed-pdas/guides/client-guide"
+ },
+ {
+ "source": "/light-token/faq",
+ "destination": "https://zkcompression.com/faq"
+ },
+ {
+ "source": "/references/migration-v1-to-v2",
+ "destination": "https://zkcompression.com/resources/migration-v1-to-v2"
+ },
+ {
+ "source": "/references/security",
+ "destination": "https://zkcompression.com/resources/security"
+ },
+ {
+ "source": "/references/addresses-and-urls",
+ "destination": "https://zkcompression.com/resources/addresses-and-urls"
+ },
+ {
+ "source": "/references/node-operators",
+ "destination": "https://zkcompression.com/resources/node-operators"
},
{
- "source": "https://www.zkcompression.com/learn/ai-tools-guide",
- "destination": "https://www.zkcompression.com/ai-tools/guide"
+ "source": "/references/anchor-constraints",
+ "destination": "https://zkcompression.com/resources/anchor-constraints"
}
]
-}
\ No newline at end of file
+}
diff --git a/faq.mdx b/faq.mdx
new file mode 100644
index 00000000..023878bf
--- /dev/null
+++ b/faq.mdx
@@ -0,0 +1,252 @@
+---
+title: FAQ
+description: Frequently asked questions about light token, PDA accounts, and use cases.
+keywords: ["spl token vs light token comparison", "token 2022 vs light token differences", "rent exemption on solana explained", "token account cost on solana", "light pda vs compressed pda", "rent free pda solana", "solana pda cost", "compressed accounts solana"]
+---
+
+import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
+import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
+import RentSponsorshipExplained from "/snippets/rent-sponsorship-explained.mdx";
+import { RentLifecycleVisualizer } from "/snippets/jsx/rent-lifecycle-visualizer.jsx";
+import {
+ splCreateAtaCode,
+ lightCreateAtaCode,
+} from "/snippets/code-samples/code-compare-snippets.jsx";
+
+## Rent Sponsorship
+
+
+
+Rent sponsorship is a built-in feature of the Light SDK’s that sponsors rent-exemption for all account types to reduce creation cost: mints, token accounts, and PDAs.
+This is dealt with under the hood in a way that doesn’t disrupt the UX of what your users are used to with SPL-token.
+
+| Account Creation Cost | Light | Standard Solana |
+| :----------------------- | :------------------- | :---------------------- |
+| **Mint account** | **~0.00001 SOL** | ~0.0015 SOL |
+| **Associated token account** | **~0.00001 SOL** | ~0.002 SOL |
+| **PDA (100-byte)** | **~0.0000115 SOL** | ~0.0016 SOL |
+
+
+
+
+
+## Light Token Program
+
+
+
+Light token is a high-performance token standard that is functionally equivalent to SPL, but stores mint and token accounts more efficiently. This reduces account creation cost while being more CU efficient than SPL on hot paths.
+
+**Creation Cost**
+
+| | Light-Token | SPL-Token |
+| :---------------- | ---------------: | ----------: |
+| **Mint Account** | **0.00001 SOL** | 0.0015 SOL |
+| **Token Account** | **0.00001 SOL** | 0.002 SOL |
+
+**CU Performance**
+
+| | Light-Token | SPL-Token |
+| :----------------------- | ----------: | --------: |
+| **ATA Creation** | **4,348** | 14,194 |
+| **Transfer** | **312** | 4,645 |
+| **Transfer** (rent-free) | **1,885** | 4,645 |
+
+
+
+
+
+Yes! Light Token is deployed on devnet — start integrating today with our [Quickstart](/light-token/quickstart) and [Toolkits](/light-token/toolkits/overview).
+
+For production on mainnet, use [Compressed Tokens V1](/compressed-tokens/overview), which are live and supported by leading wallets such as Phantom and Backpack.
+
+
+
+
+
+No. The `light-token-sdk` methods are a superset of the SPL-token API.
+Find examples below.
+
+
+
+
+
+
+
+
Light
+
SPL
+
+
+
+
+
**Get/Create ATA**
+
getOrCreateAtaInterface()
+
getOrCreateAssociatedTokenAccount()
+
+
+
**Derive ATA**
+
getAssociatedTokenAddressInterface()
+
getAssociatedTokenAddress()
+
+
+
**Transfer**
+
transferInterface()
+
transferChecked()
+
+
+
**Get Balance**
+
getAtaInterface()
+
getAccount()
+
+
+
+
+
+
+
+
+Yes, light-token accounts can hold tokens from light, SPL, or Token 2022 mints.
+
+SPL tokens can be deposited into light-token accounts and withdrawn back to SPL token accounts via the `transferInterface` method.
+
+
+
+
+
+The token standard pays rent-exemption cost for you. To prevent griefing, "rent" is paid over time to keep an account in memory. This is dealt with under the hood in a way that doesn't disrupt the UX of what your users are used to with SPL-token.
+
+
+
+
+
+
+
+
+
+The account is automatically compressed.
+Your tokens are cryptographically preserved as a compressed token account (rent-free).
+The account is loaded into hot account state in-flight when someone interacts with it again.
+
+
+
+
+
+Extensions are under development. Additional extensions can be requested.
+
+Coming soon:
+
+- MetadataPointer
+- TokenMetadata
+- InterestBearingConfig
+- GroupPointer
+- GroupMemberPointer
+- TokenGroup
+- TokenGroupMember
+- MintCloseAuthority
+- TransferFeeConfig
+- DefaultAccountState
+- PermanentDelegate
+- TransferHook
+- Pausable
+- ConfidentialTransferMint
+- ConfidentialTransferFeeConfig
+- ConfidentialMintBurn
+
+
+
+
+
+- **light-token**: Solana account that holds token balances of light-mints, SPL or Token 22 mints.
+- **Compressed token**: Compressed account storing token data. Rent-free, for storage and distribution.
+
+
+
+---
+
+## PDA Accounts
+
+
+
+A standard Solana PDA with sponsored rent-exemption. Seeds, bump derivation, and `invoke_signed` work the same way. Your instruction handlers for reads, updates, and closes don't change.
+
+| | Regular PDA | Light-PDA |
+| :----------------- | ------------: | ------------: |
+| **100-byte account** | ~0.0016 SOL | ~0.0000115 SOL |
+
+
+
+
+
+A compressed account with a derived address. Programs invoke the Light System program instead of the System program to create and update compressed accounts. Compressed PDAs are always compressed and require a validity proof for every read and write.
+
+| | Regular PDA | Compressed PDA |
+| :----------------- | ------------: | -------------: |
+| **100-byte account** | ~0.0016 SOL | ~0.000015 SOL |
+
+
+
+
+
+| | Light-PDA | Compressed PDA |
+| :----------------- | :--------------------------------------------------------------- | :-------------------------------------------------------------------- |
+| **Storage** | On-chain; auto-compresses when inactive | Always compressed |
+| **Validity proof** | Not required | Required for every read and write |
+| **Program changes**| Minimal changes. Leaves program logic mostly untouched. | Custom Logic |
+| **Best for** | Shared state: DeFi pools, vaults, config, program-owned accounts | Per-user state: profiles, credentials, DePIN nodes, nullifiers |
+
+
+
+
+
+
+
+
+No. Add `compression_info: CompressionInfo` to your state struct, derive `LightAccount` and `LightAccounts`, and add `#[light_program]` above `#[program]`. Your instruction logic for reads, updates, and closes stays the same. The client prepends a load instruction if the account is cold.
+
+
+
+
+
+
+
+
+The SDK sponsors rent-exemption for your Light-PDAs. After extended inactivity, the account compresses to cold state and the rent-exempt lamports return to the rent sponsor. The common path (hot accounts) has no extra overhead.
+
+
+
+
+
+
+
+The account data is cryptographically preserved in compressed state. The client prepends a load instruction when someone interacts with it again — your program code doesn't change. Reads, updates, and closes work the same way regardless of whether the account is hot or cold.
+
+
+
+---
+
+## I don't see the question I want answered
+
+DM us [@lightprotocol on X (Twitter)](http://x.com/lightprotocol) or [Discord](https://discord.com/invite/rpddh53TeG).
+
+
+
\ No newline at end of file
diff --git a/home.mdx b/home.mdx
index 664e469e..79eb7035 100644
--- a/home.mdx
+++ b/home.mdx
@@ -1,239 +1,101 @@
---
-title: "Home"
+title: "Welcome to ZK Compression"
+sidebarTitle: "Overview"
mode: "custom"
-keywords: ["light protocol", "zk compression on solana", "scalable solana infrastructure", "rent free accounts on solana", "create tokens on solana", "scalable infrastructure for solana apps", "privacy on solana", "shielded transactions on solana"]
+keywords: ["solana tokens", "spl tokens", "light protocol", "helius", "zk compression on solana", "scalable solana infrastructure", "rent free accounts on solana", "create tokens on solana", "scalable infrastructure for solana apps", "privacy on solana", "shielded transactions on solana"]
---
import { Footer } from "/snippets/jsx/footer.jsx";
import { HeroCubeGrid } from "/snippets/jsx/hero-cube-grid.jsx";
import { LiquidGlassPill } from "/snippets/jsx/liquid-glass-pill.jsx";
-import WelcomePageInstall from "/snippets/setup/welcome-page-install.mdx";
+import { PartnerLogos } from "/snippets/jsx/partner-logos.jsx";
{/* Hero with animation - styles in style.css (no flash) */}
-
+
+
+
{/* Content container - using Tailwind classes to avoid flash */}
-
-
- High performance token standard for rent-free DeFi and Payments.
-
-
- Core primitives for rent-free tokens & accounts.
-
-
-
-## Features
-
-
- Create Solana accounts without paying upfront rent.
- Execution onchain on Solana.
- Works with existing programs and accounts.
-
+ZK Compression is a Solana account primitive that lets you create tokens and PDAs
+without rent-exemption on Solana fully composable with existing programs.
-## Quickstart
+## Light Token Program
-
-
-### Installation
+| Creation Cost | Light Token Program | SPL / Token 2022 |
+|:--------|:------|:---------------|
+| Mint Account | 0.00001 SOL | 0.0015 SOL |
+| Token Account | 0.00001 SOL | 0.002 SOL |
-
-
-
-### Get started
+>
+ High-performance token standard that is functionally equivalent to SPL
+ while reducing account creation cost and increasing CU efficiency on hot paths.
+ The Light Token SDK keeps code changes minimal and is a superset of the SPL-token API.
+
-
-
+## PDA Accounts
-## DeFi Integration
+| Creation Cost | Light / Compressed | Solana default |
+|:--------|:------|:---------------|
+| 100-byte PDA | ~0.000015 SOL | 0.0016 SOL |
-
- Build rent-free AMMs and DeFi programs with minimal code changes.
+
+ Solana PDAs with sponsored rent-exemption that can be implemented with minimal code changes.
+ Use like any other PDA, e.g. in your DeFi program.
-
- Add support for rent-free AMMs to your aggregator or router.
+
+ Compressed PDAs to store user, app, or other infrequently accessed state without rent-exemption. Fully compatible with existing Solana programs, but requires custom logic.
-## Toolkits
+## AI Native Development
-
-
- Integrate light-token APIs with familiar SPL patterns.
-
-
-
- Allow users to display and swap light-tokens.
-
-
- {/*
- Stream mint events from the network in real-time.
- */}
-
- {/*
- Stream token events from the network in real-time.
- */}
-
-
-
-
- ZK Compression is the most efficient way to distribute SPL tokens.
-
-
- Add rent-free SPL token accounts and transfers to your Privy embedded wallet.
-
-
- Allow users to display and swap compressed tokens.
-
-
-
- Integrate Token-2022 extensions with compressed tokens.
-
-
-
- Common token distribution flows (airdrops, payments, rewards).
-
-
-
-
-
- Deterministically derived addresses to prevent double spending.
-
-
-
- Small proof size and fast verification.
-
-
-
- Use existing state Merkle trees with RPC indexer support.
-
-
-
-
+
+Install orchestrator agent skill or view [skill.md](https://www.zkcompression.com/skill.md):
-## Cookbooks
-
-
-
- Program and client guides for mints, token accounts, and transfers.
-
-
- Client guides for compressed token accounts.
-
-
- Program and client guides for rent-free PDA accounts.
-
-
- Build with compressed attestations using Rust or Typescript.
-
-
-
-## Using AI in Development
-
-Download agent skill or view [skill.md](https://www.zkcompression.com/skill.md):
```bash
npx skills add https://zkcompression.com
```
-| | |
-| :------- | :--------------------------------------------------------------------------- |
-| MCP | Connect AI tools to the Light Protocol repository via Model Context Protocol |
-| DeepWiki | Use Deepwiki for advanced AI assistance with your development. |
+Install or view [dedicated agent skills](/ai-tools/guide#agent-skills).
+
+
+
+Add the marketplace and install:
+
+```
+/plugin marketplace add Lightprotocol/skills
+/plugin install solana-rent-free-dev
+```
+
+
+1. Open Settings (**Cmd+Shift+J** / **Ctrl+Shift+J**)
+2. Navigate to **Rules & Commands** → **Project Rules** → **Add Rule** → **Remote Rule (GitHub)**
+3. Enter: `https://github.com/Lightprotocol/skills.git`
+
+
+```
+npx skills add Lightprotocol/skills
+```
+
+
+
+
+Connect AI tools to the Light Protocol repository via MCP and DeepWiki.
@@ -267,70 +129,75 @@ codex mcp add deepwiki -- npx -y mcp-remote@latest https://mcp.deepwiki.com/mcp
}
```
+
+
-
+
+ Copy-paste prompts for common integration tasks.
+
-## Resources
+## For DeFi
-
-
- View security audits and formal verification.
+
+
+ Build rent-free AMMs and DeFi programs.
+
+
+ Add support for rent-free AMMs to your aggregator.
-
- Learn core concepts of the Light token program.
+
+ High-performance DeFi programs with Pinocchio.
-
- Learn core concepts of ZK Compression.
+
+
+## For Data Streaming
+
+
+
+ Stream mint events from the network in real-time.
+
+
+ Stream token events from the network in real-time.
-## SDK Reference
+## For Stablecoin Payments
+
+
+
+ Guide to integrate light-token APIs with comparison to SPL.
+
+
+ Prevent onchain instructions from being executed more than once.
+
+
-### TypeScript
+## For Wallets
-
- Client SDK for Light Token and Compressed Accounts
+
+ Guide for Wallet Applications to let users display and swap light-tokens.
-
- Client for Light Token and Compressed Tokens.
+
+ Add light-tokens to Privy embedded wallets.
+
+
+ Sponsor rent top-ups from users to abstract away holding SOL and provide a rent-free experience.
-### Rust
+## Resources
-
- Rust client for Light Token and ZK Compression.
+
+ Learn about the Light Token program and ZK Compression Core.
-
- Core SDK for on-chain programs.
+
+ Typescript and Rust SDK's, Anchor constraints and JSON RPC methods.
-
- Testing framework for programs.
+
+ View security audits and formal verification.
diff --git a/images/helius-black.png b/images/helius-black.png
new file mode 100644
index 00000000..af570ba6
Binary files /dev/null and b/images/helius-black.png differ
diff --git a/images/helius-white.png b/images/helius-white.png
new file mode 100644
index 00000000..155883f9
Binary files /dev/null and b/images/helius-white.png differ
diff --git a/images/light-wordmark.svg b/images/light-wordmark.svg
new file mode 100644
index 00000000..46f15005
--- /dev/null
+++ b/images/light-wordmark.svg
@@ -0,0 +1,8 @@
+
diff --git a/learn/core-concepts/compressed-account-model.mdx b/learn/core-concepts/compressed-account-model.mdx
index bb0355b3..51b5554f 100644
--- a/learn/core-concepts/compressed-account-model.mdx
+++ b/learn/core-concepts/compressed-account-model.mdx
@@ -20,6 +20,11 @@ Compressed accounts store state and are similar to regular Solana accounts but w
These differences make compressed accounts rent-free and allow the protocol to store state as calldata on the Solana ledger instead of the costly on-chain account space.
+
+Compressed PDAs are compressed accounts with an address.
+Compressed Token accounts are compressed accounts that don't need an address.
+
+
# In a Nutshell
Transactions can use compressed account data inside Solana's virtual machine as if it were stored on-chain by combining state compression and zero-knowledge proofs:
@@ -183,42 +188,6 @@ pub struct CompressedAccountData {
- `data_hash`: Hash of the `data` field (32 bytes).
- When computing the compressed account hash for the state tree, the protocol uses this fixed-size hash instead of the variable-length data bytes.
-# Compressed Token Account
-
-Compressed token accounts store token balance, owner, and other information of token accounts (SPL, Token-2022, or Light).
-
-1. Any Solana token account can be compressed/decompressed at will.
-2. We recommend to use compressed tokens for token distribution.
-
-
- Learn how the Light token program uses ZK Compression under the hood
- [here](/learn/light-token-standard).
-
-
-
-
-
-
-
-
-
- ```rust
- pub struct TokenData {
- pub mint: Pubkey,
- pub owner: Pubkey,
- pub amount: u64,
- pub delegate: Option,
- pub state: u8,
- /// Placeholder for TokenExtension tlv data (unimplemented)
- pub tlv: Option>,
- }
- ```
-
-
-
# Next Steps
\ No newline at end of file
diff --git a/learn/core-concepts/merkle-trees-validity-proofs.mdx b/learn/core-concepts/merkle-trees-validity-proofs.mdx
index 24e84277..5d0c4b4d 100644
--- a/learn/core-concepts/merkle-trees-validity-proofs.mdx
+++ b/learn/core-concepts/merkle-trees-validity-proofs.mdx
@@ -105,7 +105,7 @@ Two **state tree versions** with different proof mechanisms are currently suppor
- **V1 state trees**: Always require the full 128-byte ZK proof
- **V2 batched state trees**: Can use `prove_by_index` optimization that verifies the account exists with only one byte instead of 128-bytes.
-**V2** optimizes optimize compute unit consumption by up to 70% and is **currently on Devnet**.
+**V2** optimizes compute unit consumption by up to 70%.
When using V2 trees, RPC requests automatically choose the proof mechanism.
@@ -149,7 +149,7 @@ Two **address tree versions** are currently supported:
- **V1 address trees** height 26 (\~67 million addresses).
- **V2 batched address trees** with height 40 (\~1 trillion addresses).
-**V2** optimizes optimize compute unit consumption by up to 70% and is **currently on Devnet**.
+**V2** optimizes compute unit consumption by up to 70%.
When using V2 trees, RPC requests automatically choose the proof mechanism.
diff --git a/learn/core-concepts/transaction-lifecycle.mdx b/learn/core-concepts/transaction-lifecycle.mdx
index 3b257dc7..f234959d 100644
--- a/learn/core-concepts/transaction-lifecycle.mdx
+++ b/learn/core-concepts/transaction-lifecycle.mdx
@@ -138,7 +138,7 @@ The Solana program executing the state transition _**Data**_** -> **_**Data'**_
- `validity proof`: 128-byte ZK proof that verifies the current account hash exists in the state tree
-See this [guide to update a compressed account](/compressed-pdas/guides/how-to-update-compressed-accounts).
+See this [guide to update a compressed account](/pda/compressed-pdas/guides/how-to-update-compressed-accounts).
diff --git a/learn/light-token-standard.mdx b/learn/light-token-standard.mdx
index 3327c50b..7abedda9 100644
--- a/learn/light-token-standard.mdx
+++ b/learn/light-token-standard.mdx
@@ -1,6 +1,6 @@
---
-title: Core Concepts to the Light Token Program (Beta)
-sidebarTitle: Core Concepts (Light Token)
+title: Core concepts of the Light Token program (Beta)
+sidebarTitle: Core Concepts (Light Token Program)
description: The Light Token Program is a high performance token program that reduces the cost of account creations by 200x, while being more CU efficient than SPL on hot paths.
keywords: ["light token standard on solana", "token 2022 on solana", "token extensions on solana", "spl token on solana", "rent free tokens on solana"]
---
diff --git a/learn/overview.mdx b/learn/overview.mdx
new file mode 100644
index 00000000..d98220a9
--- /dev/null
+++ b/learn/overview.mdx
@@ -0,0 +1,55 @@
+---
+title: Overview of core concepts
+sidebarTitle: Overview
+description: Learn about Light Token and ZK Compression Core.
+keywords: ["zk compression on solana", "scalable solana infrastructure", "compressed accounts on solana", "privacy on solana", "zk on solana", "shielded transactions on solana"]
+---
+
+
+## What is Light Token?
+
+Light token is a high-performance token standard that is functionally equivalent to SPL, but stores mint and token accounts more efficiently. This reduces account creation cost while being more CU efficient than SPL on hot paths.
+
+
+
+
+
+
+
+
+## What is ZK Compression?
+
+ZK Compression is a Solana account primitive that lets you create tokens and PDAs without rent-exemption with L1 performance and security.
+The Light Token Program uses ZK Compression under the hood.
+
+Storage cost of Solana accounts are reduced by combining generalized state compression and zero-knowledge proofs.
+
+
+
+ State compression stores account data on the Solana ledger instead of in millions of on-chain accounts. Only a small fingerprint of all accounts is stored on-chain for cryptographic integrity. Using Light Protocol, programs can use the account data inside Solana's virtual machine as if it were stored on-chain.
+
+
+
+ The protocol uses 128 byte zero-knowledge proofs (validity proofs) to verify the integrity of
+ the compressed accounts. By default, this is all done under the hood. You can fetch validity
+ proofs from RPC providers that support ZK Compression.
+
+
+
+
\ No newline at end of file
diff --git a/light-token/cookbook/approve-revoke.mdx b/light-token/cookbook/approve-revoke.mdx
index ef6cad7d..8141d642 100644
--- a/light-token/cookbook/approve-revoke.mdx
+++ b/light-token/cookbook/approve-revoke.mdx
@@ -28,6 +28,10 @@ import RevokeActionCode from "/snippets/code-snippets/light-token/approve-revoke
import RevokeInstructionCode from "/snippets/code-snippets/light-token/approve-revoke/rust-client/revoke-instruction.mdx";
import ApproveAnchorProgramCode from "/snippets/code-snippets/light-token/approve/anchor-program/full-example.mdx";
import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/anchor-program/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import ApproveRevokeAiPrompt from "/snippets/ai-prompts/ts-cookbook/approve-revoke.mdx";
+import RustApproveRevokeAiPrompt from "/snippets/ai-prompts/rust-cookbook/approve-revoke.mdx";
+import ProgramApproveRevokeAiPrompt from "/snippets/ai-prompts/program-cookbook/approve-revoke.mdx";
1. Approve grants a delegate permission to transfer up to a specified amount of tokens from your account.
* Each token account can have only one delegate at a time.
@@ -35,6 +39,8 @@ import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/
2. Revoke removes all delegate permissions from a Light Token account.
3. Only the token account owner can approve or revoke delegates.
+
+
@@ -67,10 +73,14 @@ import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/
- Find the source code
- [here](https://github.com/Lightprotocol/examples-light-token/tree/main/typescript-client/actions).
+ Find the source code:
+ [delegate-approve.ts](https://github.com/Lightprotocol/examples-light-token/blob/main/typescript-client/actions/delegate-approve.ts)
+ |
+ [delegate-revoke.ts](https://github.com/Lightprotocol/examples-light-token/blob/main/typescript-client/actions/delegate-revoke.ts)
+
+
### Approve a delegate
@@ -88,6 +98,11 @@ import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/
+
+
+
+
+
@@ -118,6 +133,8 @@ import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/
+
+
### Prerequisites
@@ -130,7 +147,7 @@ import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/
### Approve or revoke delegates
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/approve.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/approve.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/approve.rs).
@@ -159,8 +176,15 @@ import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/
+
+
+
+
+
+
+
Find [a full code example at the end](#full-code-example).
@@ -286,6 +310,11 @@ revoke_cpi.invoke_signed(&[signer_seeds])?;
+
+
+
+
+
diff --git a/light-token/cookbook/burn.mdx b/light-token/cookbook/burn.mdx
index 8496e376..23e16491 100644
--- a/light-token/cookbook/burn.mdx
+++ b/light-token/cookbook/burn.mdx
@@ -16,12 +16,17 @@ import {
import RustInstructionCode from "/snippets/code-snippets/light-token/burn/rust-client/instruction.mdx";
import BurnCheckedRustInstructionCode from "/snippets/code-snippets/light-token/burn-checked/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/burn/anchor-program/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import RustBurnAiPrompt from "/snippets/ai-prompts/rust-cookbook/burn.mdx";
+import ProgramBurnAiPrompt from "/snippets/ai-prompts/program-cookbook/burn.mdx";
1. Burn permanently destroys tokens by reducing the balance in a token account.
2. Burned tokens are removed from circulation and decreases the supply tracked on the mint account.
3. Only the token account owner (or approved delegate) can burn tokens.
+
+
@@ -35,6 +40,8 @@ Compare to SPL:
language="rust"
/>
+
+
### Prerequisites
@@ -47,7 +54,7 @@ Compare to SPL:
### Burn Light Tokens
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/burn.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/burn.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/burn.rs).
@@ -58,8 +65,15 @@ Compare to SPL:
+
+
+
+
+
+
+
Find [a full code example at the end](#full-code-example).
@@ -122,6 +136,11 @@ BurnCpi {
+
+
+
+
+
diff --git a/light-token/cookbook/close-token-account.mdx b/light-token/cookbook/close-token-account.mdx
index 4ef0caaa..8e8628dc 100644
--- a/light-token/cookbook/close-token-account.mdx
+++ b/light-token/cookbook/close-token-account.mdx
@@ -17,6 +17,9 @@ import {
} from "/snippets/code-samples/code-compare-snippets.jsx";
import RustInstructionCode from "/snippets/code-snippets/light-token/close-token-account/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/close-token-account/anchor-program/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import RustCloseTokenAccountAiPrompt from "/snippets/ai-prompts/rust-cookbook/close-token-account.mdx";
+import ProgramCloseTokenAccountAiPrompt from "/snippets/ai-prompts/program-cookbook/close-token-account.mdx";
1. Closing a Light Token account transfers remaining lamports to a destination account and the rent sponsor can reclaim sponsored rent.
2. Light token accounts can be closed by the owner.
@@ -24,9 +27,11 @@ import AnchorProgramCode from "/snippets/code-snippets/light-token/close-token-a
The `compression_authority`
closes the account and preserves the balance as compressed token account when the account becomes compressible.
-The account is reinstated in flight with the same state the next time it is accessed.
+The account is loaded in flight with the same state the next time it is accessed.
+
+
@@ -42,6 +47,8 @@ Compare to SPL:
language="rust"
/>
+
+
### Prerequisites
@@ -54,7 +61,7 @@ Compare to SPL:
### Close Light Token Account
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/close.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/close.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/close.rs).
@@ -66,8 +73,15 @@ Compare to SPL:
+
+
+
+
+
+
+
Find [a full code example at the end](#full-code-example).
@@ -129,6 +143,11 @@ CloseAccountCpi {
+
+
+
+
+
diff --git a/light-token/cookbook/create-ata.mdx b/light-token/cookbook/create-ata.mdx
index fc52f275..a4d056fd 100644
--- a/light-token/cookbook/create-ata.mdx
+++ b/light-token/cookbook/create-ata.mdx
@@ -27,6 +27,11 @@ import RustActionCode from "/snippets/code-snippets/light-token/create-ata/rust-
import RustInstructionCode from "/snippets/code-snippets/light-token/create-ata/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/create-ata/anchor-program/full-example.mdx";
import AnchorMacroCode from "/snippets/code-snippets/light-token/create-ata/anchor-macro/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import CreateAtaAiPrompt from "/snippets/ai-prompts/ts-cookbook/create-ata.mdx";
+import RustCreateAtaAiPrompt from "/snippets/ai-prompts/rust-cookbook/create-ata.mdx";
+import ProgramCreateAtaCpiAiPrompt from "/snippets/ai-prompts/program-cookbook/create-ata-cpi.mdx";
+import ProgramCreateAtaMacrosAiPrompt from "/snippets/ai-prompts/program-cookbook/create-ata-macros.mdx";
1. Associated Light Token accounts can hold token balances of light, SPL, or Token 2022 mints.
2. Light-ATAs are on-chain accounts like SPL ATA's, but the light token program sponsors the rent-exemption cost for you.
@@ -35,6 +40,8 @@ import AnchorMacroCode from "/snippets/code-snippets/light-token/create-ata/anch
+
+
@@ -55,6 +62,8 @@ Compare to SPL:
[here](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/create-ata-interface.ts).
+
+
@@ -73,6 +82,11 @@ Compare to SPL:
+
+
+
+
+
@@ -90,6 +104,8 @@ Compare to SPL:
language="rust"
/>
+
+
@@ -104,7 +120,7 @@ Compare to SPL:
### Create ATA
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_ata.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/create_associated_token_account.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_ata.rs).
@@ -118,11 +134,18 @@ Compare to SPL:
+
+
+
+
+
+
+
Compare to SPL:
@@ -212,8 +235,15 @@ CreateAssociatedAccountCpi {
+
+
+
+
+
+
+
Compare to SPL:
@@ -297,6 +327,11 @@ pub ata: UncheckedAccount<'info>,
+
+
+
+
+
diff --git a/light-token/cookbook/create-mint.mdx b/light-token/cookbook/create-mint.mdx
index 2cb1be99..8d46f389 100644
--- a/light-token/cookbook/create-mint.mdx
+++ b/light-token/cookbook/create-mint.mdx
@@ -40,6 +40,11 @@ import RustInstructionCode from "/snippets/code-snippets/light-token/create-mint
import AnchorProgramCode from "/snippets/code-snippets/light-token/create-mint/anchor-program/full-example.mdx";
import AnchorMacroCode from "/snippets/code-snippets/light-token/create-mint/anchor-macro/full-example.mdx";
import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import CreateMintAiPrompt from "/snippets/ai-prompts/ts-cookbook/create-mint.mdx";
+import RustCreateMintAiPrompt from "/snippets/ai-prompts/rust-cookbook/create-mint.mdx";
+import ProgramCreateMintCpiAiPrompt from "/snippets/ai-prompts/program-cookbook/create-mint-cpi.mdx";
+import ProgramCreateMintMacrosAiPrompt from "/snippets/ai-prompts/program-cookbook/create-mint-macros.mdx";
1. Mint accounts uniquely represent a token on Solana and store its global metadata.
2. Light mints are on-chain accounts like SPL mints, but the light token program sponsors the rent-exemption cost for you.
@@ -50,6 +55,8 @@ import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx
+
+
@@ -72,9 +79,11 @@ Compare to SPL:
Find the source code
- [here](https://github.com/Lightprotocol/light-protocol/blob/0c4e2417b2df2d564721b89e18d1aad3665120e7/js/compressed-token/src/v3/actions/create-mint-interface.ts).
+ [here](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/create-mint-interface.ts).
+
+
@@ -98,6 +107,11 @@ Compare to SPL:
+
+
+
+
+
### Add Interface PDA to SPL / Token 2022 mints
@@ -153,7 +167,7 @@ Pass `TOKEN_2022_PROGRAM_ID` to create a Token-2022 mint with an interface PDA i
`CreateMint` creates an on-chain mint account that can optionally include token metadata.
The instruction also writes a compressed mint address to the address Merkle tree, which preserves the mint state when the on-chain account is compressed.
-Compare to SPL:
+Compare to SPL:
+
+
### Prerequisites
@@ -175,7 +191,7 @@ Compare to SPL:
### Create Light Token Mint with Token Metadata
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_mint.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/create_mint.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_mint.rs).
@@ -190,12 +206,19 @@ Compare to SPL:
+
+
+
+
+
+
+
Compare to SPL:
@@ -278,9 +301,9 @@ let params = CreateMintParams {
The address of the mint account is stored in an address Merkle tree
- , which is maintained by the protocol.
+ , which is maintained by the protocol.
The client passes a validity proof that proves the mint address does not
- exist yet.
+ exist yet.
@@ -288,7 +311,7 @@ let params = CreateMintParams {
### System Accounts
-Include system accounts such as the Light System Program
+Include system accounts such as the Light System Program
to verify the proof and write the mint address to the address tree.
@@ -410,9 +433,16 @@ CreateMintCpi::new(
+
+
+
+
+
+
+
Compare to SPL:
@@ -537,6 +567,11 @@ pub mint: UncheckedAccount<'info>,
+
+
+
+
+
diff --git a/light-token/cookbook/create-token-account.mdx b/light-token/cookbook/create-token-account.mdx
index 8620b4bb..1cdb97d6 100644
--- a/light-token/cookbook/create-token-account.mdx
+++ b/light-token/cookbook/create-token-account.mdx
@@ -22,14 +22,20 @@ import {
import RustInstructionCode from "/snippets/code-snippets/light-token/create-token-account/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/create-token-account/anchor-program/full-example.mdx";
import AnchorMacroCode from "/snippets/code-snippets/light-token/create-token-account/anchor-macro/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import RustCreateTokenAccountAiPrompt from "/snippets/ai-prompts/rust-cookbook/create-token-account.mdx";
+import ProgramCreateTokenAccountCpiAiPrompt from "/snippets/ai-prompts/program-cookbook/create-token-account-cpi.mdx";
+import ProgramCreateTokenAccountMacrosAiPrompt from "/snippets/ai-prompts/program-cookbook/create-token-account-macros.mdx";
1. Light token accounts are Solana accounts that hold token balances of light, SPL, or Token 2022 mints.
-2. Light token accounts are on-chain accounts like SPL ATA’s, but the light token program sponsors the rent-exemption cost for you.
+2. Light token accounts are on-chain accounts like SPL ATA's, but the light token program sponsors the rent-exemption cost for you.
+
+
@@ -45,6 +51,8 @@ Compare to SPL:
language="rust"
/>
+
+
### Prerequisites
@@ -57,7 +65,7 @@ Compare to SPL:
### Create Token Account
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/create_token_account.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs).
@@ -68,12 +76,19 @@ Compare to SPL:
+
+
+
+
+
+
+
Compare to SPL:
@@ -155,8 +170,15 @@ CreateTokenAccountCpi {
+
+
+
+
+
+
+
Compare to SPL:
@@ -244,6 +266,11 @@ pub vault: UncheckedAccount<'info>,
+
+
+
+
+
diff --git a/light-token/cookbook/freeze-thaw.mdx b/light-token/cookbook/freeze-thaw.mdx
index 3b555c2d..9095fb96 100644
--- a/light-token/cookbook/freeze-thaw.mdx
+++ b/light-token/cookbook/freeze-thaw.mdx
@@ -19,6 +19,9 @@ import FreezeInstructionCode from "/snippets/code-snippets/light-token/freeze-th
import ThawInstructionCode from "/snippets/code-snippets/light-token/freeze-thaw/rust-client/thaw-instruction.mdx";
import FreezeAnchorProgramCode from "/snippets/code-snippets/light-token/freeze/anchor-program/full-example.mdx";
import ThawAnchorProgramCode from "/snippets/code-snippets/light-token/thaw/anchor-program/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import RustFreezeThawAiPrompt from "/snippets/ai-prompts/rust-cookbook/freeze-thaw.mdx";
+import ProgramFreezeThawAiPrompt from "/snippets/ai-prompts/program-cookbook/freeze-thaw.mdx";
1. Freeze prevents all transfers or token burns from a specific Light Token account.
2. Once frozen, the account cannot send tokens, receive tokens, or be closed until it is thawed.
@@ -26,6 +29,8 @@ import ThawAnchorProgramCode from "/snippets/code-snippets/light-token/thaw/anch
4. Only the freeze authority (set at mint creation) can freeze or thaw accounts.
5. If the freeze authority is revoked (set to null) on the mint account, tokens can never be frozen.
+
+
@@ -54,6 +59,8 @@ import ThawAnchorProgramCode from "/snippets/code-snippets/light-token/thaw/anch
+
+
### Prerequisites
@@ -66,7 +73,7 @@ import ThawAnchorProgramCode from "/snippets/code-snippets/light-token/thaw/anch
### Freeze or thaw Light Token accounts
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/freeze.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/freeze.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/freeze.rs).
@@ -89,8 +96,15 @@ import ThawAnchorProgramCode from "/snippets/code-snippets/light-token/thaw/anch
+
+
+
+
+
+
+
Find [a full code example at the end](#full-code-example).
@@ -212,6 +226,11 @@ ThawCpi {
+
+
+
+
+
diff --git a/light-token/cookbook/load-ata.mdx b/light-token/cookbook/load-ata.mdx
index 57a63441..73fd2f19 100644
--- a/light-token/cookbook/load-ata.mdx
+++ b/light-token/cookbook/load-ata.mdx
@@ -8,6 +8,7 @@ keywords: ["load ata on solana", "get token balance for wallets"]
import FullSetup from "/snippets/setup/full-setup.mdx";
import ActionCode from "/snippets/code-snippets/light-token/load-ata/action.mdx";
import InstructionCode from "/snippets/code-snippets/light-token/load-ata/instruction.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
1. `loadAta` unifies tokens from multiple sources to a single ATA:
* Compressed tokens (cold Light Tokens) -> Decompresses -> light ATA
@@ -22,6 +23,8 @@ import InstructionCode from "/snippets/code-snippets/light-token/load-ata/instru
Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/load-ata.ts).
+
+
### Unify Tokens to Light-ATA Balance
diff --git a/light-token/cookbook/mint-to.mdx b/light-token/cookbook/mint-to.mdx
index 2b707075..0aa524a3 100644
--- a/light-token/cookbook/mint-to.mdx
+++ b/light-token/cookbook/mint-to.mdx
@@ -24,11 +24,17 @@ import InstructionCode from "/snippets/code-snippets/light-token/mint-to/instruc
import RustActionCode from "/snippets/code-snippets/light-token/mint-to/rust-client/action.mdx";
import RustInstructionCode from "/snippets/code-snippets/light-token/mint-to/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/mint-to/anchor-program/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import MintToAiPrompt from "/snippets/ai-prompts/ts-cookbook/mint-to.mdx";
+import RustMintToAiPrompt from "/snippets/ai-prompts/rust-cookbook/mint-to.mdx";
+import ProgramMintToAiPrompt from "/snippets/ai-prompts/program-cookbook/mint-to.mdx";
1. Mint To creates new tokens of a mint and deposits them to a specified token account.
2. Before we can mint any tokens, we need an initialized mint account (SPL, Token 2022 or Light) for which we hold the mint authority.
+
+
@@ -48,9 +54,11 @@ Compare to SPL:
Find the source code
- [here](https://github.com/Lightprotocol/light-protocol/blob/0c4e2417b2df2d564721b89e18d1aad3665120e7/js/compressed-token/src/v3/actions/mint-to-interface.ts).
+ [here](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/mint-to-interface.ts).
+
+
### Mint Tokens to Light Token Account
@@ -68,6 +76,11 @@ Compare to SPL:
+
+
+
+
+
@@ -85,6 +98,8 @@ Compare to SPL:
language="rust"
/>
+
+
### Prerequisites
@@ -97,7 +112,7 @@ Compare to SPL:
### Mint to Light Token Accounts
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/mint_to.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/mint_to.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/mint_to.rs).
@@ -112,8 +127,15 @@ Compare to SPL:
+
+
+
+
+
+
+Find [a full code example at the end](#full-code-example).
@@ -182,6 +204,11 @@ MintToCpi {
+
+
+
+
+
diff --git a/light-token/cookbook/transfer-checked.mdx b/light-token/cookbook/transfer-checked.mdx
index 6e783d05..4d7bac6a 100644
--- a/light-token/cookbook/transfer-checked.mdx
+++ b/light-token/cookbook/transfer-checked.mdx
@@ -11,14 +11,21 @@ import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-c
import RustActionCode from "/snippets/code-snippets/light-token/transfer-checked/rust-client/action.mdx";
import RustInstructionCode from "/snippets/code-snippets/light-token/transfer-checked/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/transfer-checked/anchor-program/full-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import RustTransferCheckedAiPrompt from "/snippets/ai-prompts/rust-cookbook/transfer-checked.mdx";
+import ProgramTransferCheckedAiPrompt from "/snippets/ai-prompts/program-cookbook/transfer-checked.mdx";
1. TransferChecked validates that the decimals parameter matches the mint's decimals.
2. Use for Light→Light transfers when you need decimal verification.
3. For transfers involving SPL or Token 2022 accounts, use [Transfer Interface](/light-token/cookbook/transfer-interface) instead.
+
+
+
+
### Prerequisites
@@ -31,7 +38,7 @@ import AnchorProgramCode from "/snippets/code-snippets/light-token/transfer-chec
### Transfer with Decimal Check
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/transfer_checked.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/transfer_checked.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/transfer_checked.rs).
@@ -46,8 +53,15 @@ import AnchorProgramCode from "/snippets/code-snippets/light-token/transfer-chec
+
+
+
+
+
+
+
Find [a full code example at the end](#full-code-example).
@@ -113,6 +127,11 @@ TransferCheckedCpi {
+
+
+
+
+
diff --git a/light-token/cookbook/transfer-interface.mdx b/light-token/cookbook/transfer-interface.mdx
index a315c4c1..2e2a4244 100644
--- a/light-token/cookbook/transfer-interface.mdx
+++ b/light-token/cookbook/transfer-interface.mdx
@@ -21,6 +21,11 @@ import InstructionCode from "/snippets/code-snippets/light-token/transfer-interf
import RustActionCode from "/snippets/code-snippets/light-token/transfer-interface/rust-client/action.mdx";
import RustInstructionCode from "/snippets/code-snippets/light-token/transfer-interface/rust-client/instruction.mdx";
import AnchorProgramCode from "/snippets/code-snippets/light-token/transfer-interface/anchor-program/full-example.mdx";
+import CreateAndTransferCode from "/snippets/code-snippets/light-token/transfer-interface/anchor-program/create-and-transfer-example.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import TransferInterfaceAiPrompt from "/snippets/ai-prompts/ts-cookbook/transfer-interface.mdx";
+import RustTransferInterfaceAiPrompt from "/snippets/ai-prompts/rust-cookbook/transfer-interface.mdx";
+import ProgramTransferInterfaceAiPrompt from "/snippets/ai-prompts/program-cookbook/transfer-interface.mdx";
@@ -55,6 +60,8 @@ import AnchorProgramCode from "/snippets/code-snippets/light-token/transfer-inte
+
+
@@ -75,6 +82,8 @@ Compare to SPL:
[here](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/transfer-interface.ts).
+
+
@@ -93,6 +102,11 @@ Compare to SPL:
+
+
+
+
+
@@ -108,6 +122,8 @@ Use the unified `TransferInterface` to transfer tokens between token accounts (S
language="rust"
/>
+
+
### Prerequisites
@@ -119,13 +135,13 @@ Use the unified `TransferInterface` to transfer tokens between token accounts (S
### Transfer Interface
-The example transfers
+The example transfers
1. SPL token -> Light Token,
2. Light Token -> Light Token, and
3. Light Token -> SPL token.
- View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/transfer_interface.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/instructions/transfer_interface.rs) with shared test utilities.
+ Find the source code [here](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/transfer_interface.rs).
@@ -139,10 +155,17 @@ The example transfers
+
+
+
+
+
+
+
Find [a full code example at the end](#full-code-example).
@@ -200,7 +223,10 @@ TransferInterfaceCpi::new(
-# Full Code Example
+# Full code example
+
+
+
View the [source code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/transfer_interface.rs) and [full example](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/transfer-interface) with shared test utilities.
@@ -210,6 +236,26 @@ TransferInterfaceCpi::new(
+
+
+Uses the `#[light_account(init, associated_token::...)]` macro to create the destination ATA during the transfer.
+
+
+ View the [full example](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/create-and-transfer) with test utilities.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# Next Steps
diff --git a/light-token/cookbook/wrap-unwrap.mdx b/light-token/cookbook/wrap-unwrap.mdx
index e8b38e21..a346ccbf 100644
--- a/light-token/cookbook/wrap-unwrap.mdx
+++ b/light-token/cookbook/wrap-unwrap.mdx
@@ -15,20 +15,27 @@ import UnwrapInstructionCode from "/snippets/code-snippets/light-token/unwrap/in
import WrapRustActionCode from "/snippets/code-snippets/light-token/wrap/rust-client/action.mdx";
import UnwrapRustActionCode from "/snippets/code-snippets/light-token/unwrap/rust-client/action.mdx";
import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-client-prerequisites.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import WrapUnwrapAiPrompt from "/snippets/ai-prompts/ts-cookbook/wrap-unwrap.mdx";
+import RustWrapUnwrapAiPrompt from "/snippets/ai-prompts/rust-cookbook/wrap-unwrap.mdx";
- **Wrap**: Move tokens from SPL/T22 account → Light Token ATA (hot balance)
- **Unwrap**: Move tokens from Light Token ATA (hot balance) → SPL/T22 account
Find the source code:
- [wrap.ts](https://github.com/Lightprotocol/light-protocol/blob/0c4e2417b2df2d564721b89e18d1aad3665120e7/js/compressed-token/src/v3/actions/wrap.ts)
+ [wrap.ts](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/wrap.ts)
|
- [unwrap.ts](https://github.com/Lightprotocol/light-protocol/blob/0c4e2417b2df2d564721b89e18d1aad3665120e7/js/compressed-token/src/v3/actions/unwrap.ts)
+ [unwrap.ts](https://github.com/Lightprotocol/light-protocol/blob/main/js/compressed-token/src/v3/actions/unwrap.ts)
+
+
+
+
@@ -70,12 +77,19 @@ import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-c
+
+
+
+
+
+
+
@@ -91,7 +105,7 @@ import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-c
### Wrap SPL tokens to Light Token ATA
- View the [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/wrap.rs) with shared test utilities.
+ Find the full example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/wrap.rs).
@@ -117,7 +131,7 @@ import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-c
### Unwrap Light Tokens to SPL account
- View the [full example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/unwrap.rs) with shared test utilities.
+ Find the full example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/unwrap.rs).
@@ -128,6 +142,11 @@ import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-c
+
+
+
+
+
diff --git a/light-token/defi/programs-pinocchio.mdx b/light-token/defi/programs-pinocchio.mdx
index 01fc1aed..95127ffb 100644
--- a/light-token/defi/programs-pinocchio.mdx
+++ b/light-token/defi/programs-pinocchio.mdx
@@ -3,6 +3,9 @@ title: "Pinocchio Programs"
description: "Build high-performance DeFi programs with rent-free accounts using Pinocchio"
---
+import AgentSkillDefi from "/snippets/setup/agent-skill-defi.mdx";
+import DefiPinocchioAiPrompt from "/snippets/ai-prompts/anchor-programs/defi-pinocchio.mdx";
+
The Light-SDK sponsors rent-exemption for your PDAs, token accounts, and mints. Your program logic stays the same.
| | Before | After |
@@ -22,10 +25,16 @@ The Light-SDK sponsors rent-exemption for your PDAs, token accounts, and mints.
If you use Anchor instead of Pinocchio, see [Program Integration](./programs).
---
+
+
+
Complete pinocchio Swap reference implementation: [pinocchio-swap](https://github.com/Lightprotocol/examples-light-token/tree/simplify-trait/pinocchio/swap)
+
+
+
## Step 1: Dependencies
```toml
@@ -286,6 +295,12 @@ pub fn process(
```
+
+
+
+
+
+
---
## Client SDK
diff --git a/light-token/defi/programs.mdx b/light-token/defi/programs.mdx
index 719c5099..27f56046 100644
--- a/light-token/defi/programs.mdx
+++ b/light-token/defi/programs.mdx
@@ -3,6 +3,9 @@ title: "Program Integration"
description: "Build high-performance DeFi programs with rent-free accounts"
---
+import AgentSkillDefi from "/snippets/setup/agent-skill-defi.mdx";
+import DefiAnchorAiPrompt from "/snippets/ai-prompts/anchor-programs/defi-anchor.mdx";
+
The Light-SDK sponsors rent-exemption for your PDAs, token accounts, and mints. Your program logic stays the same.
| | Before | After |
@@ -25,20 +28,25 @@ macro-generated.
If you don't use Anchor, see the [Pinocchio Programs](./programs-pinocchio) guide.
---
+
+
+
You can find a complete rent-free AMM reference implementation [here](https://github.com/Lightprotocol/cp-swap-reference).
+
+
+
## Step 1: Dependencies
```toml
[dependencies]
-light-sdk = { version = "0.18.0", features = ["anchor", "v2", "cpi-context"] }
-light-sdk-macros = { version = "0.18.0" }
-light-token = { version = "0.3.0", features = ["anchor"] }
-
-light-anchor-spl = { version = "0.31" } # TokenInterface uses light_token::ID
+light-sdk = { version = "0.19.0", features = ["anchor", "v2", "cpi-context"] }
+light-sdk-macros = "0.19.0"
+light-token = { version = "0.4.0", features = ["anchor"] }
+light-anchor-spl = "0.31" # TokenInterface uses light_token::ID
anchor-lang = "0.31"
```
@@ -344,6 +352,11 @@ pub fn process_initialize_pool(ctx: Context, params: InitializeP
+
+
+
+
+
---
diff --git a/light-token/defi/routers.mdx b/light-token/defi/routers.mdx
index e6258e2f..6c5ef4ec 100644
--- a/light-token/defi/routers.mdx
+++ b/light-token/defi/routers.mdx
@@ -3,6 +3,9 @@ title: "Router Integration"
description: "Add support for rent-free AMMs on Solana."
---
+import AgentSkillRouter from "/snippets/setup/agent-skill-router.mdx";
+import RoutersAiPrompt from "/snippets/ai-prompts/defi/routers.mdx";
+
Your existing quoting, routing, and swap logic stays the same.
The only addition: when a market has cold accounts, detect them, and prepend load instructions before the swap.
@@ -16,6 +19,11 @@ The only addition: when a market has cold accounts, detect them, and prepend loa
---
+
+
+
+
+
## Detecting cold accounts
Add a cache for cold accounts. This can be independent from your regular account cache.
@@ -127,7 +135,7 @@ pub trait LightProgramInterface {
- `instruction_accounts` -- returns the pubkeys the instruction reads/writes.
- `load_specs` -- given cold `AccountInterface`s (with `ColdContext`), returns the `AccountSpec`s
- that `create_load_instructions` needs to bring them back on-chain.
+ that `create_load_instructions` needs to load them.
---
@@ -137,7 +145,7 @@ pub trait LightProgramInterface {
```toml
[dependencies]
-light-client = {version = "0.18.0", features = ["v2"]}
+light-client = { version = "0.19.0", features = ["v2"] }
# AMM SDK that implements LightProgramInterface (provided by the AMM team)
example-amm-sdk = "0.1"
@@ -305,3 +313,10 @@ API is in Beta and subject to change.
Questions or need hands-on support? [Telegram](https://t.me/swen_light) | [email](mailto:support@lightprotocol.com) | [Discord](https://discord.com/invite/7cJ8BhAXhu)
+
+
+
+
+
+
+
diff --git a/light-token/examples/client.mdx b/light-token/examples/client.mdx
index a0c89492..dd935794 100644
--- a/light-token/examples/client.mdx
+++ b/light-token/examples/client.mdx
@@ -5,7 +5,12 @@ description: "TypeScript and Rust client examples for light-token SDK."
---
import ClientExamplesTable from "/snippets/overview-tables/light-token-client-examples-table.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
Find all examples on Github: [examples-light-token](https://github.com/Lightprotocol/examples-light-token)
+
+
+
+
diff --git a/light-token/examples/program.mdx b/light-token/examples/program.mdx
index d447d23c..2cc58ce0 100644
--- a/light-token/examples/program.mdx
+++ b/light-token/examples/program.mdx
@@ -5,7 +5,12 @@ description: "Anchor program examples for light-token CPI."
---
import ProgramExamplesTable from "/snippets/overview-tables/light-token-program-examples-table.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
Find all examples on Github: [examples-light-token](https://github.com/Lightprotocol/examples-light-token)
+
+
+
+
diff --git a/light-token/faq.mdx b/light-token/faq.mdx
deleted file mode 100644
index 548c55e3..00000000
--- a/light-token/faq.mdx
+++ /dev/null
@@ -1,155 +0,0 @@
----
-title: FAQ
-description: Frequently asked questions about light-token.
-keywords: ["spl token vs light token comparison", "token 2022 vs light token differences", "rent exemption on solana explained", "token account cost on solana"]
----
-
-import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
-import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
-import { RentLifecycleVisualizer } from "/snippets/jsx/rent-lifecycle-visualizer.jsx";
-import {
- splCreateAtaCode,
- lightCreateAtaCode,
-} from "/snippets/code-samples/code-compare-snippets.jsx";
-
-#### What is light-token?
-
-Light token is a high-performance token standard that is functionally equivalent to SPL, but stores mint and token accounts more efficiently. This reduces account creation cost while being more CU efficient than SPL on hot paths.
-
-**Creation Cost**
-
-| | Light-Token | SPL-Token |
-| :---------------- | ---------------: | ----------: |
-| **Mint Account** | **0.00001 SOL** | 0.0015 SOL |
-| **Token Account** | **0.00001 SOL** | 0.002 SOL |
-
-**CU Performance**
-
-| | Light-Token | SPL-Token |
-| :----------------------- | ----------: | --------: |
-| **ATA Creation** | **4,348** | 14,194 |
-| **Transfer** | **312** | 4,645 |
-| **Transfer** (rent-free) | **1,885** | 4,645 |
-
-#### Can I start using the Light Token Standard?
-
-Yes! Light Token is deployed on devnet — start integrating today with our [Quickstart](/light-token/quickstart) and [Toolkits](/light-token/toolkits/overview).
-
-For production on mainnet, use [Compressed Tokens V1](/compressed-tokens/overview), which are live and supported by leading wallets such as Phantom and Backpack.
-
-#### Do I need to change my client code significantly?
-
-No. The `light-token-sdk` methods are a superset of the SPL-token API.
-Find examples below.
-
-
-
-
-
-
-
-
Light
-
SPL
-
-
-
-
-
**Get/Create ATA**
-
getOrCreateAtaInterface()
-
getOrCreateAssociatedTokenAccount()
-
-
-
**Derive ATA**
-
getAssociatedTokenAddressInterface()
-
getAssociatedTokenAddress()
-
-
-
**Transfer**
-
transferInterface()
-
transferChecked()
-
-
-
**Get Balance**
-
getAtaInterface()
-
getAccount()
-
-
-
----
-
-#### Can light-token accounts hold SPL tokens?
-
-Yes, light-token accounts can hold tokens from light, SPL, or Token 2022 mints.
-
-SPL tokens can be deposited into light-token accounts and withdrawn back to SPL token accounts via the `transferInterface` method.
-
-#### Do light-token accounts require rent?
-
-The token standard pays rent-exemption cost for you. To prevent griefing, "rent" is paid over time to keep an account in memory. This is dealt with under the hood in a way that doesn't disrupt the UX of what your users are used to with SPL-token.
-
-
-
-
-
-#### What happens if my light-token account runs out of rent?
-
-The account is automatically compressed.
-Your tokens are cryptographically preserved as a compressed token account (rent-free).
-The account is loaded into hot account state in-flight when someone interacts with it again.
-
-#### Does light-token support extensions?
-
-Extensions are under development. Additional extensions can be requested.
-
-Coming soon:
-
-- MetadataPointer
-- TokenMetadata
-- InterestBearingConfig
-- GroupPointer
-- GroupMemberPointer
-- TokenGroup
-- TokenGroupMember
-- MintCloseAuthority
-- TransferFeeConfig
-- DefaultAccountState
-- PermanentDelegate
-- TransferHook
-- Pausable
-- ConfidentialTransferMint
-- ConfidentialTransferFeeConfig
-- ConfidentialMintBurn
-
-#### What is the difference between light-token and compressed token?
-
-- **light-token**: Solana account that holds token balances of light-mints, SPL or Token 22 mints.
-- **Compressed token**: Compressed account storing token data. Rent-free, for storage and distribution.
-
-#### I don't see the question I want answered
-
-DM us [@lightprotocol on X (Twitter)](http://x.com/lightprotocol) or [Discord](https://discord.com/invite/rpddh53TeG).
-
-### Get Started
-
-
-
- Guides for dedicated use cases
-
-
- Step-by-step recipes
-
-
-
diff --git a/light-token/quickstart.mdx b/light-token/quickstart.mdx
index 135038d6..3aaf1a58 100644
--- a/light-token/quickstart.mdx
+++ b/light-token/quickstart.mdx
@@ -1,12 +1,15 @@
---
title: Quickstart
-description: Mint tokens to a Light-ATA in under 3 minutes.
+description: Mint SPL tokens, wrap to Light Token, and transfer in under 3 minutes.
sidebarTitle: Quickstart
keywords: ["create tokens on solana tutorial", "mint tokens on solana guide", "spl token quickstart for developers", "token sdk for solana apps"]
---
import FullSetup from "/snippets/setup/full-setup.mdx";
-import MintToAction from "/snippets/code-snippets/light-token/mint-to/action.mdx";
+import MintSplAndWrapAction from "/snippets/code-snippets/light-token/mint-spl-and-wrap/action.mdx";
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+
+
@@ -18,29 +21,21 @@ import MintToAction from "/snippets/code-snippets/light-token/mint-to/action.mdx
-## Mint Tokens to Light-ATA
+## Mint SPL tokens, convert to Light Token and Transfer
-
+
# Next Steps
-
- Guides for dedicated use cases
-
-
- Step-by-step recipes
+ Find answers to frequently answered questions.
-
+
diff --git a/light-token/toolkits/for-payments.mdx b/light-token/toolkits/for-payments.mdx
index bc1cae9b..200c749e 100644
--- a/light-token/toolkits/for-payments.mdx
+++ b/light-token/toolkits/for-payments.mdx
@@ -1,12 +1,15 @@
---
title: "Toolkit for Stablecoin Payments"
-sidebarTitle: "For Stablecoin Payments"
-description: "Guide to integrate light-token APIs with comparison to SPL."
+sidebarTitle: "Integration Guide"
+description: "Guide to integrate light-token APIs for stablecoin payments with comparison to SPL."
keywords: ["stablecoin payments for enterprises", "infrastructure for stablecoin payments on solana", "payment rails for stablecoins on solana", "usdc payments for merchants on solana", "payment infrastructure for fintechs", "micropayments for apps on solana", "token extensions for payment companies", "rent free tokens for payment apps"]
---
import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
+import RegisterSplMint from "/snippets/setup/register-spl-mint.mdx";
+import AgentSkillPayments from "/snippets/setup/agent-skill-payments.mdx";
+import PaymentsAiPrompt from "/snippets/ai-prompts/toolkits/payments.mdx";
1. The light-token API matches the SPL-token API almost entirely, and extends their functionality to include the light token program in addition to the SPL-token and Token-2022 programs.
2. Your users use the same stablecoins, just stored more efficiently.
@@ -64,6 +67,11 @@ import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
[here](https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets).
+
+
+
+
+
## Setup
@@ -89,91 +97,24 @@ import {
const rpc = createRpc(RPC_ENDPOINT);
```
-### One-time: Register an Existing SPL Mint
+
-For existing SPL mints (e.g. USDC), register the SPL interface once. This creates the omnibus PDA that holds SPL tokens when wrapped to light-token.
+### Receive Payments
-Find a full code example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/toolkits/payments-and-wallets/register-spl-mint.ts).
+Find a full code example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/toolkits/payments-and-wallets/receive.ts).
-Check if the interface already exists:
-
-```typescript
-import { getSplInterfaceInfos } from "@lightprotocol/compressed-token";
-
-try {
- const infos = await getSplInterfaceInfos(rpc, mint);
- const exists = infos.some((i) => i.isInitialized);
- console.log("Interface exists:", exists);
-} catch {
- console.log("No interface registered for this mint.");
-}
-```
-
-Register:
-
-
-
-
-```typescript
-import { Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
-import { LightTokenProgram } from "@lightprotocol/compressed-token";
-import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
-
-const ix = await LightTokenProgram.createSplInterface({
- feePayer: payer.publicKey,
- mint,
- tokenProgramId: TOKEN_PROGRAM_ID,
-});
-
-const tx = new Transaction().add(ix);
-await sendAndConfirmTransaction(rpc, tx, [payer]);
-```
-
-
-
-
-```typescript
-import { createSplInterface } from "@lightprotocol/compressed-token";
-
-await createSplInterface(rpc, payer, mint);
-```
-
-
-
-
-
-
-Use `createMintInterface` with `TOKEN_PROGRAM_ID` to create a new SPL mint and register the interface in one transaction:
-
-```typescript
-import { createMintInterface } from "@lightprotocol/compressed-token/unified";
-import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
-
-const { mint } = await createMintInterface(
- rpc, payer, payer, null, 9, undefined, undefined, TOKEN_PROGRAM_ID
-);
-```
-
-
+Load creates the associated token account (ATA) if needed and loads any compressed state into it. Share the ATA address with the sender.
-**About loading**: Light tokens reduce account rent ~200x by auto-compressing inactive
-accounts. Before any action, the SDK detects compressed state and adds
-instructions to load it back on-chain. This almost always fits in a single
+**About loading**: Light Token accounts reduce account rent ~200x by auto-compressing inactive
+accounts. Before any action, the SDK detects cold balances and adds
+instructions to load them. This almost always fits in a single
atomic transaction with your regular transfer. APIs return `TransactionInstruction[][]` so the same
loop handles the rare multi-transaction case automatically.
-### Receive Payments
-
-
-Find a full code example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/toolkits/payments-and-wallets/receive.ts).
-
-
-Load creates the associated token account (ATA) if needed and loads any compressed state into it. Share the ATA address with the sender.
-
@@ -553,3 +494,9 @@ await unwrap(rpc, payer, splAta, owner, mint, amount);
+
+
+
+
+
+
diff --git a/light-token/toolkits/for-privy.mdx b/light-token/toolkits/for-privy.mdx
new file mode 100644
index 00000000..8f1480f8
--- /dev/null
+++ b/light-token/toolkits/for-privy.mdx
@@ -0,0 +1,224 @@
+---
+title: "Light-Token with Privy Wallets"
+sidebarTitle: "Sign with Privy Wallet"
+description: "Integrate light-token with Privy embedded wallets for rent-free token accounts and transfers."
+keywords: ["privy solana", "privy light token", "embedded wallet light token", "rent-free tokens privy"]
+---
+import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
+import RegisterSplMint from "/snippets/setup/register-spl-mint.mdx";
+import AgentSkillPayments from "/snippets/setup/agent-skill-payments.mdx";
+import TransferNodejs from "/snippets/code-snippets/privy/transfer/nodejs.mdx";
+import TransferReact from "/snippets/code-snippets/privy/transfer/react.mdx";
+import WrapNodejs from "/snippets/code-snippets/privy/wrap/nodejs.mdx";
+import WrapReact from "/snippets/code-snippets/privy/wrap/react.mdx";
+import UnwrapNodejs from "/snippets/code-snippets/privy/unwrap/nodejs.mdx";
+import UnwrapReact from "/snippets/code-snippets/privy/unwrap/react.mdx";
+import BalancesNodejs from "/snippets/code-snippets/privy/balances/nodejs.mdx";
+import BalancesReact from "/snippets/code-snippets/privy/balances/react.mdx";
+import TransactionHistoryNodejs from "/snippets/code-snippets/privy/transaction-history/nodejs.mdx";
+import TransactionHistoryReact from "/snippets/code-snippets/privy/transaction-history/react.mdx";
+import PrivyAiPrompt from "/snippets/ai-prompts/wallets/privy.mdx";
+
+| Creation Cost | SPL | light-token |
+| :---------------- | :------------------ | :------------------- |
+| **Token Account** | ~2,000,000 lamports | ~**11,000** lamports |
+
+Privy handles user authentication and wallet management. You build transactions with light-token and Privy signs them:
+
+1. Authenticate with Privy
+2. Build unsigned transaction
+3. Sign transaction using Privy's wallet provider
+4. Send signed transaction to RPC
+
+## What you will implement
+
+
+
+
+
SPL
+
Light
+
+
+
+
+
[**Transfer**](#full-code-examples)
+
createTransferInstruction()
+
createTransferInterfaceInstructions()
+
+
+
[**Wrap from SPL**](#full-code-examples)
+
N/A
+
createWrapInstruction()
+
+
+
[**Unwrap to SPL**](#full-code-examples)
+
N/A
+
createUnwrapInstructions()
+
+
+
[**Get Balance**](#get-balances)
+
getAccount()
+
getAtaInterface()
+
+
+
[**Tx History**](#get-transaction-history)
+
getSignaturesForAddress()
+
getSignaturesForOwnerInterface()
+
+
+
+
+
+
+
+
+
+
+### Prerequisites
+
+
+
+Connect to an RPC endpoint that supports ZK Compression (Helius, Triton):
+
+```typescript
+import { createRpc } from "@lightprotocol/stateless.js";
+
+import {
+ createTransferInterfaceInstructions,
+ createWrapInstruction,
+ createUnwrapInstructions,
+ getAssociatedTokenAddressInterface,
+ getAtaInterface,
+} from "@lightprotocol/compressed-token/unified";
+
+const rpc = createRpc(RPC_ENDPOINT);
+```
+
+
+
+
+## Sign with Privy
+
+
+Find complete examples on GitHub: [Node.js](https://github.com/Lightprotocol/examples-light-token/tree/main/privy/nodejs) and [React](https://github.com/Lightprotocol/examples-light-token/tree/main/privy/react).
+
+
+
+
+
+Transfer light-tokens between wallets. Auto-loads cold (compressed) light-token, SPL or
+Token-2022 balance before sending.
+
+
+**About loading:** Light Token accounts reduce account rent ~200x by auto-compressing inactive accounts.
+Before any action, the SDK detects cold balances and adds instructions to load them.
+This almost always fits in a single atomic transaction with your regular transfer.
+APIs return `TransactionInstruction[][]` so the same loop handles the rare multi-transaction case
+automatically.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Wrap SPL or Token-2022 tokens into a light-token associated token account.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Unwrap light-token balance to SPL or Token-2022. Use unwrap to interact with applications that only support SPL/Token-2022.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Show Balance
+
+Query token balances to show a unified balance of SOL,
+Light, SPL, and Token-2022.
+
+```typescript
+import {
+ getAssociatedTokenAddressInterface,
+ getAtaInterface,
+} from "@lightprotocol/compressed-token/unified";
+
+const ata = getAssociatedTokenAddressInterface(mint, owner);
+const account = await getAtaInterface(rpc, ata, owner, mint);
+console.log(account.parsed.amount);
+```
+
+
+
+
+
+
+
+
+
+
+
+
+## Get Transaction History
+
+Fetch light-token transaction history for an owner.
+
+```typescript
+import { createRpc } from "@lightprotocol/stateless.js";
+
+const result = await rpc.getSignaturesForOwnerInterface(owner);
+console.log(result.signatures); // Merged + deduplicated
+console.log(result.solana); // On-chain txs only
+console.log(result.compressed); // Compressed txs only
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/light-token/toolkits/for-streaming-mints.mdx b/light-token/toolkits/for-streaming-mints.mdx
index 9ac85a1d..3986df83 100644
--- a/light-token/toolkits/for-streaming-mints.mdx
+++ b/light-token/toolkits/for-streaming-mints.mdx
@@ -6,6 +6,8 @@ keywords: ["streaming mint accounts solana", "laserstream light mint", "grpc min
---
import FindClosedAccounts from '/snippets/code-snippets/streaming/find-closed-accounts.mdx';
+import AgentSkillStreaming from "/snippets/setup/agent-skill-streaming.mdx";
+import StreamingMintsAiPrompt from "/snippets/ai-prompts/streaming/mints.mdx";
| Event | Description |
|:------|:------------|
@@ -19,6 +21,11 @@ This guide is for teams building custom data pipelines (aggregators, market make
If you just need account lookups, use [`get_account_interface`](/light-token/defi/routers) instead.
+
+
+
+
+
## Architecture
Light mints are Solana accounts owned by the Light Token Program. The streaming
@@ -251,3 +258,9 @@ pub struct AdditionalMetadata {
href="/light-token/toolkits/for-streaming-tokens"
horizontal
/>
+
+
+
+
+
+
diff --git a/light-token/toolkits/for-streaming-pdas.mdx b/light-token/toolkits/for-streaming-pdas.mdx
index ed68074e..adc746e7 100644
--- a/light-token/toolkits/for-streaming-pdas.mdx
+++ b/light-token/toolkits/for-streaming-pdas.mdx
@@ -6,12 +6,16 @@ keywords: ["streaming compressible pdas solana", "laserstream pda indexing", "gr
visibility: "hidden"
---
+import AgentSkillStreaming from "/snippets/setup/agent-skill-streaming.mdx";
+
Programs using the Light SDK expose standardized instruction discriminators for
`compress_accounts_idempotent` and `decompress_accounts_idempotent`.
Programs that don't implement these discriminators are not indexable with this approach.
+
+
## Architecture
Two per-program gRPC subscriptions. Nothing else.
diff --git a/light-token/toolkits/for-streaming-tokens.mdx b/light-token/toolkits/for-streaming-tokens.mdx
index fc0bd7c3..eb11290c 100644
--- a/light-token/toolkits/for-streaming-tokens.mdx
+++ b/light-token/toolkits/for-streaming-tokens.mdx
@@ -6,12 +6,19 @@ keywords: ["streaming token accounts solana", "laserstream light token", "grpc t
---
import FindClosedAccounts from '/snippets/code-snippets/streaming/find-closed-accounts.mdx';
+import AgentSkillStreaming from "/snippets/setup/agent-skill-streaming.mdx";
+import StreamingTokensAiPrompt from "/snippets/ai-prompts/streaming/tokens.mdx";
This guide is for teams building custom data pipelines (aggregators, market makers).
If you just need account lookups, use [`get_account_interface`](/light-token/defi/routers) instead.
+
+
+
+
+
## Architecture
Light token accounts share the same base layout as SPL Token (165 bytes), so you can
@@ -258,3 +265,9 @@ Source: [`light-token-interface`](https://github.com/Lightprotocol/light-protoco
href="/light-token/toolkits/for-streaming-mints"
horizontal
/>
+
+
+
+
+
+
diff --git a/light-token/toolkits/for-wallets.mdx b/light-token/toolkits/for-wallets.mdx
index 99fac62f..6d7e3b97 100644
--- a/light-token/toolkits/for-wallets.mdx
+++ b/light-token/toolkits/for-wallets.mdx
@@ -1,12 +1,14 @@
---
-title: "Toolkit for Wallet Applications"
-sidebarTitle: "For Wallets"
+title: "Light Token Integration Guide for Wallet Applications"
+sidebarTitle: "Integration Guide"
description: "Guide for Wallet Applications to add Light-token support."
keywords: ["wallet infrastructure on solana", "scalable wallet infrastructure on solana", "token wallet for developers", "rent free tokens for wallets"]
---
import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
+import AgentSkillPayments from "/snippets/setup/agent-skill-payments.mdx";
+import WalletsAiPrompt from "/snippets/ai-prompts/toolkits/wallets.mdx";
1. The Light-token API matches the SPL-token API almost entirely, and extends their functionality to include the light token program in addition to the SPL-token and Token-2022 programs.
2. Your users hold and receive tokens of the same mints, just stored more efficiently.
@@ -64,6 +66,11 @@ import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
[here](https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets).
+
+
+
+
+
## Setup
@@ -90,9 +97,9 @@ const rpc = createRpc(RPC_ENDPOINT);
```
-**About loading**: Light tokens reduce account rent ~200x by auto-compressing inactive
-accounts. Before any action, the SDK detects compressed state and adds
-instructions to load it back on-chain. This almost always fits in a single
+**About loading**: Light Token accounts reduce account rent ~200x by auto-compressing inactive
+accounts. Before any action, the SDK detects cold balances and adds
+instructions to load them. This almost always fits in a single
atomic transaction with your regular transfer. APIs return `TransactionInstruction[][]` so the same
loop handles the rare multi-transaction case automatically.
@@ -425,3 +432,9 @@ await unwrap(rpc, payer, splAta, owner, mint, amount);
+
+
+
+
+
+
diff --git a/light-token/toolkits/overview.mdx b/light-token/toolkits/overview.mdx
index d2841d47..6b83353e 100644
--- a/light-token/toolkits/overview.mdx
+++ b/light-token/toolkits/overview.mdx
@@ -25,3 +25,13 @@ keywords: ["token sdk for solana developers", "token infrastructure for solana a
Allow users to display and swap light-tokens.
+
+ Sponsor rent top-ups from users to abstract away holding SOL and provide a rent-free experience.
+
+
diff --git a/light-token/toolkits/sponsor-top-ups.mdx b/light-token/toolkits/sponsor-top-ups.mdx
new file mode 100644
index 00000000..fb935b35
--- /dev/null
+++ b/light-token/toolkits/sponsor-top-ups.mdx
@@ -0,0 +1,38 @@
+---
+title: Sponsor Rent Top-Ups for Users
+description: The Light SDK sponsors rent-exemption for Solana accounts and keeps accounts active through periodic top-ups paid by the fee payer. Sponsor top-ups by setting your application as the fee payer to abstract away holding SOL from your users or provide a rent-free experience similar to transaction fee sponsorship.
+keywords: ["rent free tokens on solana", "rent sponsorship solana", "rent exemption solana", "light token rent", "gasless solana tokens"]
+---
+
+import TransferInstructionCode from "/snippets/code-snippets/light-token/sponsor-rent-top-ups/ts-instruction.mdx";
+import RustInstructionCode from "/snippets/code-snippets/light-token/sponsor-rent-top-ups/rust-instruction.mdx";
+import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
+import RentSponsorshipExplained from "/snippets/rent-sponsorship-explained.mdx";
+
+---
+
+
+Rent sponsorship is a built-in feature of the Light SDK’s that sponsors rent-exemption for all account types to reduce creation cost.
+This is dealt with under the hood in a way that doesn’t disrupt the UX of what your users are used to with SPL-token.
+
+
+
+
+## How to use Sponsored Rent Top-Ups for Accounts and Transfers
+
+To sponsor top-ups for other users, set the `feePayer` field to the public key of the account that will pay the top-ups.
+Any account that signs the transaction can be the fee payer, which enables rent top-up sponsorship for Solana.
+The following example shows how to transfer a token from one user to another and sponsor the top-up for the transaction.
+
+
+You can set the fee payer to any signing account on any transaction with Light Token.
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/light-token/welcome.mdx b/light-token/welcome.mdx
index a2bbc397..d56faee7 100644
--- a/light-token/welcome.mdx
+++ b/light-token/welcome.mdx
@@ -1,22 +1,33 @@
---
title: The Light Token Program
-sidebarTitle: Introduction
-description: Light token is a high-performance token standard that reduces the cost of mint and token accounts by 200x.
+sidebarTitle: Overview
+description: High-performance token standard that is functionally equivalent to SPL while reducing account creation cost by 200x and being more CU efficient on hot paths. The Light Token SDK keeps code changes minimal and is a superset of the SPL-token API.
keywords: ["rent free tokens on solana", "rent free solana accounts", "spl token alternative for developers", "token 2022 alternative for solana", "infrastructure for stablecoin payments on solana", "scalable solana infrastructure", "token infrastructure for fintechs", "scalable infrastructure for solana apps"]
---
-import GuidesTable from "/snippets/overview-tables/compressed-tokens-guides-table.mdx";
-import AdvancedGuidesTable from "/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx";
-import SetupEnvironment from "/snippets/setup/setup-environment-tabs.mdx";
-import InstallDependencies from "/snippets/setup/install-dependencies-codegroup.mdx";
-import { LightTokenVsSplCalculator } from "/snippets/jsx/light-token-vs-spl-calculator.jsx";
-import { CompressibleRentCalculator } from "/snippets/jsx/compressible-rent-calculator.jsx";
-import { RentLifecycleVisualizer } from "/snippets/jsx/rent-lifecycle-visualizer.jsx";
-import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
-import CompressibleDefaultRentConfig from "/snippets/compressible-default-rent-config.mdx";
-import IntegrateLightTokenGuidesTable from "/snippets/overview-tables/integrate-light-token-guides-table.mdx";
+import LightTokenPrompts from "/snippets/ai-prompts/light-token-prompts.mdx";
import CookbookGuidesTable from "/snippets/overview-tables/cookbook-guides-table.mdx";
import WelcomePageInstall from "/snippets/setup/welcome-page-install.mdx";
+import SdkReference from "/snippets/overview-tables/sdk-reference.mdx";
+import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
+import {
+ splCreateMintCode,
+ lightCreateMintCode,
+ splCreateMintRustCode,
+ lightCreateMintRustCode,
+ splCreateMintCpiCode,
+ lightCreateMintCpiCode,
+ splCreateMintMacroCode,
+ lightCreateMintMacroCode,
+ splCreateAtaCode,
+ lightCreateAtaCode,
+ splCreateAtaRustCode,
+ lightCreateAtaRustCode,
+ splCreateAtaCpiCode,
+ lightCreateAtaCpiCode,
+ splCreateAtaMacroCode,
+ lightCreateAtaMacroCode,
+} from "/snippets/code-samples/code-compare-snippets.jsx";
**Note: This page is for the new Light Token Program Beta.** For production use today, use
@@ -24,31 +35,118 @@ import WelcomePageInstall from "/snippets/setup/welcome-page-install.mdx";
by leading wallets such as Phantom & Backpack.
-### Creation Cost
+### Mint Accounts
-| | Light-Token | SPL-Token |
+Light-mint accounts represent a unique mint and optionally can store token-metadata.
+Functionally equivalent to SPL mints.
+
+| Creation Cost | Light-Token | SPL-Token |
| :---------------- | --------------: | ---------: |
| **Mint Account** | **0.00001 SOL** | 0.0015 SOL |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+View the [guide](/light-token/cookbook/create-mint) to create Light Token mints, or enable interoperability for existing SPL and Token 2022 mints.
+
+
+### Token Accounts
+Light-token accounts can hold balances from any light, SPL, or Token-2022 mint, without the need
+to pay rent-exemption.
+
+| Creation Cost | Light-Token | SPL-Token |
+| :---------------- | --------------: | ---------: |
| **Token Account** | **0.00001 SOL** | 0.002 SOL |
-### CU Performance
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+View the [guide](/light-token/cookbook/create-ata) to create associated token accounts.
+
-| | Light-Token | SPL-Token |
+| CU Performance | Light-Token | SPL-Token |
| :----------------------- | ----------: | --------: |
| **ATA Creation** | **4,348** | 14,194 |
| **Transfer** | **312** | 4,645 |
| **Transfer** (rent-free) | **1,885** | 4,645 |
-
-
- Light-mint accounts represent a unique mint and optionally can store token-metadata.
- Functionally equivalent to SPL mints.
-
-
- Light-token accounts can hold balances from any light, SPL, or Token-2022 mint, without the need
- to pay rent-exemption.
-
-
+
# Quickstart
@@ -60,40 +158,101 @@ import WelcomePageInstall from "/snippets/setup/welcome-page-install.mdx";
-
-
### Get Started
+
-
-
-
+
+
+
+## Cookbook
+
+
+
+## Examples
+
+### Client
+
+| | |
+| :--- | :--- |
+| [**Toolkits**](/light-token/examples/client#toolkits) | Payments, wallets, Privy integration, SPL-to-Light transfer |
+| [**TypeScript**](/light-token/examples/client#typescript) | Actions and instructions for all token operations |
+| [**Rust**](/light-token/examples/client#rust) | Actions and instructions for all token operations |
+
+### Program
+
+| | |
+| :--- | :--- |
+| [**Examples**](/light-token/examples/program#examples) | AMM reference, CPI create-and-transfer, Pinocchio swap |
+| [**Macros**](/light-token/examples/program#macros) | Counter PDA, ATA, mint, and token account creation |
+| [**Instructions**](/light-token/examples/program#instructions) | All CPI instructions: approve, burn, close, freeze, mint-to, transfer, and more |
+
+
+
+
## DeFi Integration
-
- Build rent-free AMMs and DeFi programs with minimal code changes.
+
+ Build rent-free AMMs and DeFi programs.
- Add support for rent-free AMMs to your aggregator or router.
+ Add support for rent-free AMMs to your aggregator.
+
+
+ High-performance DeFi programs with Pinocchio.
-## Integration Toolkits
+## Stablecoin Payments
-
+
+
+ Guide to integrate light-token APIs with comparison to SPL.
+
+
+ Prevent onchain instructions from being executed more than once.
+
+
-## Cookbook
+## Wallets
-
+
+
+ Guide for Wallet Applications to let users display and swap light-tokens.
+
+
+ Add light-tokens to Privy embedded wallets.
+
+
+ Sponsor rent top-ups from users to abstract away holding SOL and provide a rent-free experience.
+
+
+
+## Data Streaming
+
+
+
+ Stream mint events from the network in real-time.
+
+
+ Stream token events from the network in real-time.
+
+
+
+
+
+
+
+
+
+
+
+## SDK Reference
+
+
# Next Steps
@@ -101,6 +260,6 @@ import WelcomePageInstall from "/snippets/setup/welcome-page-install.mdx";
title="Explore Frequently Answered Questions"
icon="chevron-right"
color="#0066ff"
- href="/light-token/faq"
+ href="/faq"
horizontal
/>
diff --git a/compressed-pdas/guides.mdx b/pda/compressed-pdas/guides.mdx
similarity index 96%
rename from compressed-pdas/guides.mdx
rename to pda/compressed-pdas/guides.mdx
index a8d89412..3980e92d 100644
--- a/compressed-pdas/guides.mdx
+++ b/pda/compressed-pdas/guides.mdx
@@ -79,6 +79,6 @@ Here is the complete flow to create, or interact with compressed accounts:
title="Create a program with compressed accounts"
icon="chevron-right"
color="#0066ff"
- href="/compressed-pdas/guides/how-to-create-compressed-accounts"
+ href="/pda/compressed-pdas/guides/how-to-create-compressed-accounts"
horizontal
/>
\ No newline at end of file
diff --git a/client-library/client-guide.mdx b/pda/compressed-pdas/guides/client-guide.mdx
similarity index 98%
rename from client-library/client-guide.mdx
rename to pda/compressed-pdas/guides/client-guide.mdx
index deb82b16..68358fd4 100644
--- a/client-library/client-guide.mdx
+++ b/pda/compressed-pdas/guides/client-guide.mdx
@@ -9,8 +9,7 @@ keywords: ["compressed pda client", "light protocol sdk"]
import SystemAccountsList from '/snippets/accounts-list/compressed-pdas-system-accounts-list.mdx';
import TypescriptClient from '/snippets/code-snippets/create/typescript-client.mdx';
import RustClient from '/snippets/code-snippets/create/rust-client.mdx';
-
-ZK Compression provides Rust and Typescript clients to interact with compressed accounts and tokens on Solana.
+import ClientGuideAiPrompt from '/snippets/ai-prompts/cpi-programs/client-guide.mdx';
@@ -109,6 +108,8 @@ ZK Compression provides Rust and Typescript clients to interact with compressed
# Get Started
+
+
## Setup
@@ -1074,6 +1075,11 @@ let instruction = Instruction {
+
+
+
+
+
# Full Code Examples
@@ -1103,7 +1109,7 @@ Find all [full code examples with Rust and TypeScript tests here](https://github
- **burn** - Permanently delete a compressed account (it cannot be initialized again).
-For help with debugging, see the [Error Cheatsheet](../resources/error-cheatsheet/) and [AskDevin](https://deepwiki.com/Lightprotocol/light-protocol/3.1-javascripttypescript-sdks).
+For help with debugging, see the [Error Cheatsheet](/resources/error-cheatsheet) and [AskDevin](https://deepwiki.com/Lightprotocol/light-protocol/3.1-javascripttypescript-sdks).
# Next Steps
@@ -1112,7 +1118,7 @@ For help with debugging, see the [Error Cheatsheet](../resources/error-cheatshee
title="Get an overview to Compressed PDA guides and build a program."
icon="chevron-right"
color="#0066ff"
- href="/compressed-pdas/guides"
+ href="/pda/compressed-pdas/guides"
horizontal
>
diff --git a/compressed-pdas/guides/how-to-burn-compressed-accounts.mdx b/pda/compressed-pdas/guides/how-to-burn-compressed-accounts.mdx
similarity index 93%
rename from compressed-pdas/guides/how-to-burn-compressed-accounts.mdx
rename to pda/compressed-pdas/guides/how-to-burn-compressed-accounts.mdx
index 9ae93264..05b2a02f 100644
--- a/compressed-pdas/guides/how-to-burn-compressed-accounts.mdx
+++ b/pda/compressed-pdas/guides/how-to-burn-compressed-accounts.mdx
@@ -9,6 +9,7 @@ import CompressedPdasSystemAccountsList from '/snippets/accounts-list/compressed
import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
import AnchorProgram from '/snippets/code-snippets/burn/anchor-program.mdx';
import NativeProgram from '/snippets/code-snippets/burn/native-program.mdx';
+import CpiBurnAiPrompt from '/snippets/ai-prompts/cpi-programs/burn.mdx';
Compressed accounts are permanently burned via CPI to the Light System Program.
@@ -19,7 +20,7 @@ Burning a compressed account
* A burned account cannot be reinitialized.
-Find [full code examples at the end](/compressed-pdas/guides/how-to-burn-compressed-accounts#full-code-example) for Anchor and native Rust.
+Find [full code examples at the end](/pda/compressed-pdas/guides/how-to-burn-compressed-accounts#full-code-example) for Anchor and native Rust.
# Implementation Guide
@@ -38,6 +39,8 @@ Here is the complete flow to burn compressed accounts:
+
+
@@ -237,6 +240,11 @@ LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, instruction_data.proof)
* `invoke(light_cpi_accounts)` calls the Light System Program with `CpiAccounts`.
+
+
+
+
+
# Full Code Example
@@ -247,7 +255,7 @@ The example programs below implement all steps from this guide.
-For help with debugging, see the [Error Cheatsheet](../../resources/error-cheatsheet/).
+For help with debugging, see the [Error Cheatsheet](/resources/error-cheatsheet).
@@ -275,14 +283,14 @@ Find the source code [here](https://github.com/Lightprotocol/program-examples/tr
title="Build a client for your program"
icon="chevron-right"
color="#0066ff"
- href="/client-library/client-guide"
+ href="/pda/compressed-pdas/guides/client-guide"
horizontal
/>
diff --git a/compressed-pdas/guides/how-to-close-compressed-accounts.mdx b/pda/compressed-pdas/guides/how-to-close-compressed-accounts.mdx
similarity index 92%
rename from compressed-pdas/guides/how-to-close-compressed-accounts.mdx
rename to pda/compressed-pdas/guides/how-to-close-compressed-accounts.mdx
index dc547c26..78484ff9 100644
--- a/compressed-pdas/guides/how-to-close-compressed-accounts.mdx
+++ b/pda/compressed-pdas/guides/how-to-close-compressed-accounts.mdx
@@ -9,6 +9,7 @@ import CompressedPdasSystemAccountsList from '/snippets/accounts-list/compressed
import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
import AnchorProgram from '/snippets/code-snippets/close/anchor-program.mdx';
import NativeProgram from '/snippets/code-snippets/close/native-program.mdx';
+import CpiCloseAiPrompt from '/snippets/ai-prompts/cpi-programs/close.mdx';
Compressed accounts are closed via CPI to the Light System Program.
@@ -16,10 +17,10 @@ Closing a compressed account
* consumes the existing account hash, and
* produces a new account hash with zero values to mark it as closed.
-* A closed compressed account [can be reinitialized](/compressed-pdas/guides/how-to-reinitialize-compressed-accounts).
+* A closed compressed account [can be reinitialized](/pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts).
-Find [full code examples at the end](/compressed-pdas/guides/how-to-close-compressed-accounts#full-code-example) for Anchor and native Rust.
+Find [full code examples at the end](/pda/compressed-pdas/guides/how-to-close-compressed-accounts#full-code-example) for Anchor and native Rust.
# Implementation Guide
@@ -38,6 +39,8 @@ Here is the complete flow to close compressed accounts:
+
+
@@ -243,6 +246,11 @@ LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, instruction_data.proof)
* `invoke()` calls the Light System Program with `CpiAccounts`.
+
+
+
+
+
# Full Code Example
@@ -254,7 +262,7 @@ Make sure you have your developer environment set up first.
-For help with debugging, see the [Error Cheatsheet](../../resources/error-cheatsheet/).
+For help with debugging, see the [Error Cheatsheet](/resources/error-cheatsheet).
@@ -282,14 +290,14 @@ Find the source code [here](https://github.com/Lightprotocol/program-examples/tr
title="Build a client for your program"
icon="chevron-right"
color="#0066ff"
- href="/client-library/client-guide"
+ href="/pda/compressed-pdas/guides/client-guide"
horizontal
/>
diff --git a/compressed-pdas/guides/how-to-create-compressed-accounts.mdx b/pda/compressed-pdas/guides/how-to-create-compressed-accounts.mdx
similarity index 95%
rename from compressed-pdas/guides/how-to-create-compressed-accounts.mdx
rename to pda/compressed-pdas/guides/how-to-create-compressed-accounts.mdx
index 32533423..44bc30be 100644
--- a/compressed-pdas/guides/how-to-create-compressed-accounts.mdx
+++ b/pda/compressed-pdas/guides/how-to-create-compressed-accounts.mdx
@@ -8,17 +8,16 @@ import CompressedPdasSystemAccountsList from '/snippets/accounts-list/compressed
import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
import AnchorProgram from '/snippets/code-snippets/create/anchor-program.mdx';
import NativeProgram from '/snippets/code-snippets/create/native-program.mdx';
+import CpiCreateAiPrompt from '/snippets/ai-prompts/cpi-programs/create.mdx';
Compressed accounts and addresses are created via CPI to the Light System Program.
* Compressed and regular Solana accounts share the same functionality and are fully composable.
* A compressed account has two identifiers: the account hash and its address (optional). In comparison, regular Solana accounts are identified by their address.
* The account hash is not persistent and changes with every write to the account.
-* For Solana PDA like behavior your compressed account needs an address as persistent identifier.\
- Fungible state like [compressed token accounts](/compressed-tokens/guides/create-compressed-token-accounts) do not need addresses.
-
+* For Solana PDA like behavior your compressed account needs an address as persistent identifier.
-Find [full code examples at the end](/compressed-pdas/guides/how-to-create-compressed-accounts#full-code-example) for Anchor and native Rust.
+Find [full code examples at the end](/pda/compressed-pdas/guides/how-to-create-compressed-accounts#full-code-example) for Anchor and native Rust.
# Implementation Guide
@@ -37,6 +36,8 @@ Here is the complete flow:
+
+
@@ -387,6 +388,11 @@ LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, instruction_data.proof)
* `invoke(light_cpi_accounts)` calls the Light System Program with `CpiAccounts.`
+
+
+
+
+
# Full Code Example
@@ -397,7 +403,7 @@ The example programs below implement all steps from this guide.
-For help with debugging, see the [Error Cheatsheet](../../resources/error-cheatsheet/).
+For help with debugging, see the [Error Cheatsheet](/resources/error-cheatsheet).
@@ -425,14 +431,14 @@ Find the source code [here](https://github.com/Lightprotocol/program-examples/tr
title="Build a client for your program"
icon="chevron-right"
color="#0066ff"
- href="/client-library/client-guide"
+ href="/pda/compressed-pdas/guides/client-guide"
horizontal
/>
diff --git a/compressed-pdas/guides/how-to-create-nullifier-pdas.mdx b/pda/compressed-pdas/guides/how-to-create-nullifier-pdas.mdx
similarity index 96%
rename from compressed-pdas/guides/how-to-create-nullifier-pdas.mdx
rename to pda/compressed-pdas/guides/how-to-create-nullifier-pdas.mdx
index 63f10de2..aeca922b 100644
--- a/compressed-pdas/guides/how-to-create-nullifier-pdas.mdx
+++ b/pda/compressed-pdas/guides/how-to-create-nullifier-pdas.mdx
@@ -1,9 +1,12 @@
---
title: Create Nullifier PDAs
+sidebarTitle: Nullifiers
description: Create rent-free nullifier PDAs to prevent duplicate actions.
keywords: ["nullifiers on solana", "prevent double spending", "compressed pdas", "rent-free nullifiers"]
---
+import NullifiersAiPrompt from "/snippets/ai-prompts/toolkits/nullifiers.mdx";
+
For some use cases, such as sending payments, you might want to prevent your
onchain instruction from being executed more than once.
@@ -21,6 +24,9 @@ We also deployed a reference implementation to public networks so you can get st
For the usage example source code, see here: [create_nullifier.rs](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs#L25)
+
+
+
## How It Works
1. Derives PDA from `["nullifier", id]` seeds (where `id` is your unique identifier, e.g. a nonce, uuid, hash of signature, etc.)
@@ -195,4 +201,10 @@ Note that this is a reference implementation. Feel free to fork the program as y
Questions or need support? [Telegram](https://t.me/swen_light) | [email](mailto:support@lightprotocol.com) | [Discord](https://discord.com/invite/7cJ8BhAXhu)
-
\ No newline at end of file
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/compressed-pdas/guides/how-to-reinitialize-compressed-accounts.mdx b/pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts.mdx
similarity index 93%
rename from compressed-pdas/guides/how-to-reinitialize-compressed-accounts.mdx
rename to pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts.mdx
index c49b22e7..a5776fda 100644
--- a/compressed-pdas/guides/how-to-reinitialize-compressed-accounts.mdx
+++ b/pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts.mdx
@@ -9,6 +9,7 @@ import CompressedPdasSystemAccountsList from '/snippets/accounts-list/compressed
import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
import AnchorProgram from '/snippets/code-snippets/reinit/anchor-program.mdx';
import NativeProgram from '/snippets/code-snippets/reinit/native-program.mdx';
+import CpiReinitAiPrompt from '/snippets/ai-prompts/cpi-programs/reinitialize.mdx';
Compressed accounts are reinitialized via CPI to the Light System Program.
@@ -18,7 +19,7 @@ An empty compressed account can be reinitialized
* to create a new account hash at the same address with new values.
-Find [full code examples at the end](/compressed-pdas/guides/how-to-reinitialize-compressed-accounts#full-code-example) for Anchor and native Rust.
+Find [full code examples at the end](/pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts#full-code-example) for Anchor and native Rust.
# Implementation Guide
@@ -37,6 +38,8 @@ Here is the complete flow to reinitialize compressed accounts:
+
+
@@ -229,6 +232,11 @@ LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, instruction_data.proof)
* `invoke(light_cpi_accounts)` calls the Light System Program with `CpiAccounts`.
+
+
+
+
+
# Full Code Example
@@ -239,7 +247,7 @@ The counter programs below implement all steps from this guide.
-For help with debugging, see the [Error Cheatsheet](../../resources/error-cheatsheet/).
+For help with debugging, see the [Error Cheatsheet](/resources/error-cheatsheet).
@@ -267,14 +275,14 @@ Find the source code [here](https://github.com/Lightprotocol/program-examples/tr
title="Build a client for your program"
icon="chevron-right"
color="#0066ff"
- href="/client-library/client-guide"
+ href="/pda/compressed-pdas/guides/client-guide"
horizontal
/>
diff --git a/compressed-pdas/guides/how-to-update-compressed-accounts.mdx b/pda/compressed-pdas/guides/how-to-update-compressed-accounts.mdx
similarity index 94%
rename from compressed-pdas/guides/how-to-update-compressed-accounts.mdx
rename to pda/compressed-pdas/guides/how-to-update-compressed-accounts.mdx
index 92cc7986..96d8fb87 100644
--- a/compressed-pdas/guides/how-to-update-compressed-accounts.mdx
+++ b/pda/compressed-pdas/guides/how-to-update-compressed-accounts.mdx
@@ -9,6 +9,7 @@ import CompressedPdasSystemAccountsList from '/snippets/accounts-list/compressed
import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
import AnchorProgram from '/snippets/code-snippets/update/anchor-program.mdx';
import NativeProgram from '/snippets/code-snippets/update/native-program.mdx';
+import CpiUpdateAiPrompt from '/snippets/ai-prompts/cpi-programs/update.mdx';
Compressed accounts are updated via CPI to the Light System Program.
@@ -19,7 +20,7 @@ The update of a compressed account follows a UTXO pattern, unlike regular Solana
* The existing account hash is nullified to prevent double spending.
-Find [full code examples at the end](/compressed-pdas/guides/how-to-update-compressed-accounts#full-code-example) for Anchor and native Rust.
+Find [full code examples at the end](/pda/compressed-pdas/guides/how-to-update-compressed-accounts#full-code-example) for Anchor and native Rust.
# Implementation Guide
@@ -38,6 +39,8 @@ Here is the complete flow:
+
+
@@ -246,6 +249,11 @@ LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, instruction_data.proof)
* `invoke(light_cpi_accounts)` calls the Light System Program with `CpiAccounts`.
+
+
+
+
+
# Full Code Example
@@ -256,7 +264,7 @@ The example programs below implement all steps from this guide.
-For help with debugging, see the [Error Cheatsheet](../../resources/error-cheatsheet/).
+For help with debugging, see the [Error Cheatsheet](/resources/error-cheatsheet).
@@ -284,14 +292,14 @@ Find the source code [here](https://github.com/Lightprotocol/program-examples/tr
title="Build a client for your program"
icon="chevron-right"
color="#0066ff"
- href="/client-library/client-guide"
+ href="/pda/compressed-pdas/guides/client-guide"
horizontal
/>
diff --git a/compressed-pdas/overview.mdx b/pda/compressed-pdas/overview.mdx
similarity index 61%
rename from compressed-pdas/overview.mdx
rename to pda/compressed-pdas/overview.mdx
index 75c410a7..fab64ad2 100644
--- a/compressed-pdas/overview.mdx
+++ b/pda/compressed-pdas/overview.mdx
@@ -1,36 +1,99 @@
---
title: Overview & Program Template
-description: Compressed PDAs provide full functionality of accounts at PDAs, without rent-exemption per account.
-keywords: ["rent free program derived addresses", "rent free pda accounts", "compressed pda on solana", "infrastructure for depins on solana", "scalable solana infrastructure", "stake accounts for depins", "cost efficient stake accounts", "scalable reward distribution on solana"]
+description: Compressed PDAs provide full composability and functionality of accounts at PDAs, without rent-exemption per account. Suited for accounts where each user or entity gets their own PDA and state is infrequently accessed.
+keywords: ["user state", "app state", "node acounts", "depin accounts", "stake accounts", "not shared state or config or pool accounts", "rent free program derived addresses", "rent free pda accounts", "compressed pda on solana", "infrastructure for depins on solana", "scalable solana infrastructure", "stake accounts for depins", "cost efficient stake accounts", "scalable reward distribution on solana"]
---
import ProgramExamplesTable from '/snippets/overview-tables/program-examples-table.mdx';
import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
+import CompressedPdasGuidesTable from '/snippets/overview-tables/compressed-pdas-guides-table.mdx';
+import SdkReferenceCompressedPdas from '/snippets/overview-tables/sdk-reference-compressed-pdas.mdx';
| Creation | Regular PDA Account | Compressed PDA |
| :------------- | :--------------------- | :---------------------- |
| 100-byte PDA | ~1,600,000 lamports | 15,000 lamports |
-Compressed PDAs are derived using a specific program address and seed, like regular PDAs. Custom programs invoke the Light System program to create and update accounts, instead of the System program.
+Compressed PDAs are derived using a specific program address and seed, like regular PDAs.
+Custom programs invoke the Light System program
+to create and update compressed accounts, instead of the System program.
+Compressed PDAs are compressed accounts with an address.
-#### Compressed PDAs at a Glance
-
-
-
- Create accounts at program-derived addresses without upfront rent exempt balance.
-
-
- Persistent unique identification and program ownership.
-
-
- CPI support between compressed and regular PDAs.
-
-
-
-# Start Building
+
+Compressed PDAs are suited for:
+- Per-user state (profiles, preferences, credentials)
+- DePIN node accounts and stake accounts
+- Nullifiers to prevent an on-chain instruction from
+being executed twice (little implementation overhead and useful e.g. for [payments](/pda/compressed-pdas/guides/how-to-create-nullifier-pdas) or [ZK programs](zk/overview))
+- App state that is written to and read from infrequently
+
+For DeFi pools, vaults, shared state, pool accounts, or config accounts, use [Light-PDA](/pda/light-pda/overview) with minimal code changes.
+
-Developing with compressed PDAs works similar to regular PDAs and involves minimal setup:
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+# Start Building with the Program Template
@@ -174,10 +237,17 @@ Caused by:
+## Guides
+
+
+
## Program Examples
+## SDK Reference
+
+
# Next Steps
@@ -185,6 +255,6 @@ Caused by:
title="Build a client for your program."
icon="chevron-right"
color="#0066ff"
- href="/client-library/client-guide"
+ href="/pda/compressed-pdas/guides/client-guide"
horizontal
/>
diff --git a/pda/compressed-pdas/program-examples.mdx b/pda/compressed-pdas/program-examples.mdx
new file mode 100644
index 00000000..e47944f1
--- /dev/null
+++ b/pda/compressed-pdas/program-examples.mdx
@@ -0,0 +1,67 @@
+---
+title: Program Examples
+description: Program example repository for compressed accounts with tests.
+---
+
+## Airdrop claim reference implementations
+
+- **Basic**: [**simple-claim**](https://github.com/Lightprotocol/program-examples/tree/main/airdrop-implementations/simple-claim) - Distributes compressed tokens that get decompressed to SPL on claim with cliff.
+- **Advanced**: [**merkle-distributor**](https://github.com/Lightprotocol/program-examples/tree/main/airdrop-implementations/distributor) - Distributes SPL tokens, uses compressed PDAs to track claims with linear vesting, partial claims and clawback. Based on Jito Merkle distributor and optimized with rent-free PDAs.
+
+
+For simple client-side distribution visit [this example](https://github.com/Lightprotocol/example-token-distribution).
+
+
+## Basic operations
+
+- **create** - Initialize a new compressed account
+ - [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/create)
+- **update** - Modify data in an existing compressed account
+ - [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/update) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/update)
+- **close** - Clear account data and preserve its address
+ - [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/close) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/close)
+- **reinit** - Reinitialize a closed account with the same address
+ - [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/reinit) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/reinit)
+- **burn** - Permanently delete a compressed account
+ - [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/burn) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/burn)
+
+## Nullifier program
+
+[**nullifier-program**](https://github.com/Lightprotocol/nullifier-program) - For some use cases, such as sending payments, you might want to prevent your onchain instruction from being executed more than once. Creates a rent-free PDA derived from an id. If the id has been used before, the PDA already exists, causing the instruction to fail.
+
+SDK: [`light-nullifier-program`](https://docs.rs/light-nullifier-program) | [Example client usage](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs)
+
+## Counter program
+
+Full compressed account lifecycle (create, increment, decrement, reset, close):
+
+- [**counter/anchor**](https://github.com/Lightprotocol/program-examples/tree/main/counter/anchor) - Anchor program with Rust and TypeScript tests
+- [**counter/native**](https://github.com/Lightprotocol/program-examples/tree/main/counter/native) - Native Solana program with `light-sdk` and Rust tests
+- [**counter/pinocchio**](https://github.com/Lightprotocol/program-examples/tree/main/counter/pinocchio) - Pinocchio program with `light-sdk-pinocchio` and Rust tests
+
+## Create-and-update program
+
+[**create-and-update**](https://github.com/Lightprotocol/program-examples/tree/main/create-and-update) - Create a new compressed account and update an existing compressed account with a single validity proof in one instruction.
+
+## Create-and-read program
+
+[**read-only**](https://github.com/Lightprotocol/program-examples/tree/main/read-only) - Create a new compressed account and read it onchain.
+
+## Compare program with Solana vs compressed accounts
+
+[**account-comparison**](https://github.com/Lightprotocol/program-examples/tree/main/account-comparison) - Compare compressed vs regular Solana accounts.
+
+## ZK programs
+
+- [**zk-id**](https://github.com/Lightprotocol/program-examples/tree/main/zk/zk-id) - Identity verification using Groth16 proofs. Issuers create credentials; users prove ownership without revealing the credential.
+- [**nullifier**](https://github.com/Lightprotocol/program-examples/tree/main/zk/nullifier) - Simple program to create nullifiers for ZK programs.
+
+## Next steps
+
+
\ No newline at end of file
diff --git a/compressed-pdas/solana-attestation-service.mdx b/pda/compressed-pdas/solana-attestation-service.mdx
similarity index 60%
rename from compressed-pdas/solana-attestation-service.mdx
rename to pda/compressed-pdas/solana-attestation-service.mdx
index ab14417b..61f21254 100644
--- a/compressed-pdas/solana-attestation-service.mdx
+++ b/pda/compressed-pdas/solana-attestation-service.mdx
@@ -1,7 +1,6 @@
---
title: "Solana Attestation Service (Devnet)"
-description: "Build compressed attestations on Solana using ZK Compression. Currently undergoing audit."
-url: "https://github.com/solana-foundation/solana-attestation-service/tree/a8fb187978ecea0b165e63767c7e6b1c036e7b52/examples/typescript/attestation-flow-guides"
+description: " Credential system for KYC verification, professional badges, and compliance credentials in minutes. Currently undergoing audit."
keywords: ["solana attestation service", "attestations for identity verification", "on-chain attestations solana", "identity verification on solana"]
---
diff --git a/pda/light-pda/overview.mdx b/pda/light-pda/overview.mdx
new file mode 100644
index 00000000..033d1ad2
--- /dev/null
+++ b/pda/light-pda/overview.mdx
@@ -0,0 +1,212 @@
+---
+title: "Light PDA"
+description: "Create Solana PDA accounts with sponsored rent-exemption and minimal code changes. Use like any Solana PDA, e.g. for DeFi pools, vaults, pool accounts, or other shared state."
+---
+
+import FullCounterExample from '/snippets/code-snippets/light-token/counter/anchor-macro/full-example.mdx';
+import AgentSkillGeneric from "/snippets/setup/agent-skill-generic.mdx";
+import LightPdaAiPrompt from "/snippets/ai-prompts/anchor-programs/light-pda.mdx";
+
+| Creation Cost | Regular PDA | Light-PDA |
+|------------------|----------------------|-----------------|
+| 100-byte account | ~1,600,000 lamports | ~11,500 lamports |
+
+A Light-PDA is a standard Solana PDA. Seeds, bump derivation, and
+`invoke_signed` work the same way. Your instruction handlers for reads,
+updates, and closes don't change.
+
+## What changes
+
+Audit overhead is minimal as your program logic is mostly untouched. The rest is macro-generated.
+
+| Area | Change |
+|------|--------|
+| State struct | Derive `LightAccount`, add `compression_info: CompressionInfo` |
+| Accounts struct | Derive `LightAccounts`, add `#[light_account]` on init accounts |
+| Program module | Add `#[light_program]` above `#[program]` |
+| Instructions (reads, updates, closes) | No program changes. Client prepends a load instruction if account is cold. |
+
+---
+
+
+
+
+
+
+## Step 1: Dependencies
+
+```toml
+[dependencies]
+light-account = { version = "0.20.0", features = ["anchor"] }
+light-sdk = { version = "0.20.0", features = ["anchor", "v2", "cpi-context"] }
+anchor-lang = "0.31"
+```
+
+## Step 2: State struct
+
+Add `compression_info` field and derive `LightAccount`:
+
+```rust
+use light_account::{CompressionInfo, LightAccount};
+
+#[derive(Default, Debug, InitSpace, LightAccount)]
+#[account]
+pub struct Counter {
+ /// Add this:
+ pub compression_info: CompressionInfo,
+
+ pub owner: Pubkey,
+ pub count: u64,
+}
+```
+
+## Step 3: Program module
+
+Add `#[light_program]` above `#[program]`. Define the CPI signer constant with your program ID:
+
+```rust
+use light_account::{derive_light_cpi_signer, light_program, CpiSigner};
+
+pub const LIGHT_CPI_SIGNER: CpiSigner =
+ derive_light_cpi_signer!("YourProgramId11111111111111111111111111111111");
+
+#[light_program]
+#[program]
+pub mod counter {
+ use super::*;
+
+ pub fn create_counter<'info>(
+ ctx: Context<'_, '_, '_, 'info, CreateCounter<'info>>,
+ params: CreateCounterParams,
+ ) -> Result<()> {
+ ctx.accounts.counter.owner = ctx.accounts.owner.key();
+ ctx.accounts.counter.count = params.count;
+ Ok(())
+ }
+
+ /// Standard Anchor — no Light-specific changes.
+ pub fn increment(ctx: Context) -> Result<()> {
+ ctx.accounts.counter.count = ctx.accounts.counter.count.checked_add(1).unwrap();
+ Ok(())
+ }
+
+ /// Standard Anchor — no Light-specific changes.
+ pub fn close_counter(_ctx: Context) -> Result<()> {
+ Ok(())
+ }
+}
+```
+
+## Step 4: Accounts struct
+
+Derive `LightAccounts` on your `Accounts` struct and add `#[light_account(...)]` next to `#[account(...)]`.
+
+Only the `init` struct derives `LightAccounts`. The increment and close structs
+are standard Anchor:
+
+```rust
+use light_account::{CreateAccountsProof, LightAccounts};
+
+#[derive(AnchorSerialize, AnchorDeserialize, Clone)]
+pub struct CreateCounterParams {
+ pub create_accounts_proof: CreateAccountsProof,
+ pub count: u64,
+}
+
+#[derive(Accounts, LightAccounts)]
+#[instruction(params: CreateCounterParams)]
+pub struct CreateCounter<'info> {
+ #[account(mut)]
+ pub fee_payer: Signer<'info>,
+
+ /// CHECK: Read-only, used for PDA derivation.
+ pub owner: AccountInfo<'info>,
+
+ /// CHECK: Validated by Light Protocol CPI.
+ pub compression_config: AccountInfo<'info>,
+
+ /// CHECK: PDA rent sponsor for compression rent reimbursement.
+ #[account(mut)]
+ pub pda_rent_sponsor: AccountInfo<'info>,
+
+ #[account(
+ init,
+ payer = fee_payer,
+ space = 8 + ::INIT_SPACE,
+ seeds = [COUNTER_SEED, owner.key().as_ref()],
+ bump,
+ )]
+ #[light_account(init)]
+ pub counter: Account<'info, Counter>,
+
+ pub system_program: Program<'info, System>,
+}
+```
+
+## Full Example
+
+
+
+
+View counter example on Github: [counter](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter)
+
+
+
+
+
+
+
+
+---
+
+## How it works
+
+The SDK sponsors rent-exemption so you
+don't pay the full rent-exempt balance upfront. After extended inactivity, the account
+compresses to cold state and returns the rent-exempt balance to the rent
+sponsor. Clients call `create_load_instructions` to load a cold account back
+on-chain when it's needed again. Your program only ever interacts with hot accounts.
+
+| | Hot (active) | Cold (inactive) |
+|---|---|---|
+| Storage | On-chain | Compressed |
+| Latency/CU | No change | +load instruction |
+| Your program code | No change | No change |
+
+## FAQ
+
+ When creating an
+account for the first time, the SDK provides a proof that the account doesn't
+exist in the cold address space. The SVM already verifies this for the onchain
+space. Both address spaces are checked before creation, preventing re-init
+attacks, even if the account is currently cold.
+
+
+Miners (Forester nodes) compress accounts that have been inactive for an extended period of time (when their virtual rent balance drops below threshold).
+In practice, having to load cold accounts should be rare. The common path (hot) has no extra overhead and does not increase CU or txn size.
+
+
+
+When accounts compress after extended inactivity, the on-chain rent-exemption is released back
+to the rent sponsor. This creates a revolving lifecycle: active "hot" accounts hold a
+rent-exempt lamports balance, inactive "cold" accounts release it back. The
+rent sponsor must be derived from the program owner. For all mint, ATA, and
+token accounts, the Light Token Program is the rent sponsor. For your own program-owned PDAs, the SDK derives a rent sponsor address automatically.
+
+
+
+**Hot path (e.g. reads, updates, closes):** No. Active accounts do not add CU overhead to your instructions.
+
+**First time init + loading cold accounts:** Yes, adds up to 15k-400k CU,
+depending on number and type of accounts being initialized or loaded.
+
+
+---
+
+
+API is in Beta and subject to change.
+
+Questions or need hands-on support? [Telegram](https://t.me/swen_light) | [email](mailto:support@lightprotocol.com) | [Discord](https://discord.com/invite/7cJ8BhAXhu)
+
+
+
diff --git a/pda/overview.mdx b/pda/overview.mdx
new file mode 100644
index 00000000..63bbd1d8
--- /dev/null
+++ b/pda/overview.mdx
@@ -0,0 +1,44 @@
+---
+title: "PDA accounts"
+sidebarTitle: "Overview"
+description: "Overview to Light-PDAs (Solana accounts with sponsored rent-exemption) and compressed PDAs (compressed accounts without rent-exemption)."
+---
+import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
+
+## Light-PDA
+
+Light-PDAs are Solana PDAs with sponsored rent-exemption and can be implemented with minimal code changes to your existing Solana program.
+Your program logic stays mostly untouched, which keeps audit overhead minimal.
+
+| | Regular PDA | Light-PDA |
+|------------------|----------------------|-----------------|
+| 100-byte account | ~1,600,000 lamports | ~11,500 lamports |
+
+> Use Light-PDA's like any Solana PDA, e.g. for DeFi pools, vaults, pool accounts, or other shared state.
+
+
+
+
+
+
+
+---
+
+## Advanced: Compressed PDA
+
+Compressed PDAs are compressed accounts with an address.
+Programs invoke the Light System program to create and update compressed accounts, instead of the System program.
+Fully compatible with existing Solana programs, but requires custom logic.
+
+| | Regular PDA | Compressed PDA |
+|------------------|----------------------|-----------------|
+| 100-byte account | ~1,600,000 lamports | 15,000 lamports |
+
+> Use for accounts where each user or entity gets their own PDA and state is infrequently accessed:
+> - Per-user state (profiles, preferences, credentials)
+> - DePIN node accounts and stake accounts
+> - Nullifiers to prevent an on-chain instruction from
+> being executed twice (little implementation overhead and useful e.g. for [payments](/pda/compressed-pdas/guides/how-to-create-nullifier-pdas) or [ZK programs](zk/overview))
+> - App state that is written to and read from infrequently
+
+
\ No newline at end of file
diff --git a/quickstart.mdx b/quickstart.mdx
deleted file mode 100644
index f02837fa..00000000
--- a/quickstart.mdx
+++ /dev/null
@@ -1,101 +0,0 @@
----
-title: Quickstart
-description: Create your first compressed tokens in under 5 minutes.
-sidebarTitle: Quickstart
-keywords: ["zk compression quickstart", "compressed accounts tutorial", "solana compression guide"]
----
-
-import FullSetup from "/snippets/setup/full-setup.mdx";
-
-
-
-
-## Prerequisites
-
-
-
-
-
-## Mint Compressed Tokens
-
-```typescript
-// 1. Load wallet and connect to Localnet
-// 2. Create SPL mint with SPL interface via createMint()
-// 3. Mint compressed tokens to recipient account via mintTo()
-// 4. Verify compressed token balance via getCompressedTokenAccountsByOwner
-
-import { createRpc } from "@lightprotocol/stateless.js";
-import { createMint, mintTo } from "@lightprotocol/compressed-token";
-import { Keypair } from "@solana/web3.js";
-import { readFileSync } from "fs";
-import { homedir } from "os";
-
-// Step 1: Load wallet from filesystem
-const payer = Keypair.fromSecretKey(
- new Uint8Array(JSON.parse(readFileSync(`${homedir()}/.config/solana/id.json`, "utf8")))
-);
-
-// Connect to local test-validator
-const RPC_ENDPOINT = "http://localhost:8899";
-const COMPRESSION_ENDPOINT = "http://localhost:8784";
-const PROVER_ENDPOINT = "http://localhost:3001";
-const connection = createRpc(RPC_ENDPOINT, COMPRESSION_ENDPOINT, PROVER_ENDPOINT);
-
-const main = async () => {
- try {
- // Step 2: Create SPL mint with SPL interface
- console.log("\nCreating SPL mint with SPL interface for compression");
- const { mint, transactionSignature } = await createMint(
- connection,
- payer,
- payer.publicKey, // mintAuthority
- 9
- );
-
- console.log(`Mint address: ${mint.toBase58()}`);
- console.log(
- `Create mint transaction: https://explorer.solana.com/tx/${transactionSignature}?cluster=custom&customUrl=http://localhost:8899`
- );
-
- // Step 3: Mint compressed tokens to recipient account
- console.log("\nMinting compressed token...");
- const mintAmount = 1000000000; // mintAmount with decimals
- const mintToTxId = await mintTo(
- connection,
- payer,
- mint, // SPL mint with SPL interface for compression
- payer.publicKey, // recipient.publicKey
- payer, // mintAuthority
- mintAmount
- );
-
- console.log(`Compressed Token minted ${mintAmount / 1e9} token`);
- console.log(
- `Transaction: https://explorer.solana.com/tx/${mintToTxId}?cluster=custom&customUrl=http://localhost:8899`
- );
-
- // Step 4: Verify compressed token balance via getCompressedTokenAccountsByOwner
- const tokenAccounts = await connection.getCompressedTokenAccountsByOwner(
- payer.publicKey,
- { mint } // SPL mint with SPL interface for compression
- );
- } catch (error: any) {
- console.error("Error:", error.message);
- }
-};
-
-main().catch(console.error);
-```
-
-
-
-
-# Next Steps
-
-
diff --git a/references/security.mdx b/references/security.mdx
deleted file mode 100644
index 2cba2a01..00000000
--- a/references/security.mdx
+++ /dev/null
@@ -1,31 +0,0 @@
----
-title: "Security"
-description: "Overview to Light Protocol's bug bounty program, third party security audits, and formal verification of circuits."
-keywords: ["light protocol security", "zk compression audits"]
----
-
-### Bug Bounty
-
-Light Protocol is hosting a [bug bounty program](https://immunefi.com/bug-bounty/light-protocol/information/).
-
-### Security Audits
-
-The Light protocol on-chain programs were audited by independent security firms Neodyme, OtterSec, Accretion, and Zellic.
-
-- [Accretion audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/accretion_v1_update_audit.pdf) (January '25)
-- [Zellic audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/zellic_v1_audit.pdf) (September '24)
-- [Neodyme audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/neodyme_v1_audit.pdf) (August '24)
-- [OtterSec audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec_v1_audit.pdf) (July '24)
-
-A complete list of 3rd party audits can be found [here](https://github.com/Lightprotocol/light-protocol/tree/main/audits).
-
-### Groth16 Circuit Security
-
-The ZK Compression circuit was formally verified by Reilabs. See the report [here](https://github.com/Lightprotocol/light-protocol/blob/main/audits/reilabs_circuits_formal_verification_report.pdf).
-
-Information about the Trusted Setup Ceremony for the groth16 circuits is [here](https://github.com/Lightprotocol/gnark-mt-setup/blob/main/README.md).
-
-
-**For additional information on Light Protocol's security policy, read** [**here**](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md)**.**
-
-
diff --git a/references/terminology.mdx b/references/terminology.mdx
deleted file mode 100644
index f97ab783..00000000
--- a/references/terminology.mdx
+++ /dev/null
@@ -1,358 +0,0 @@
----
-title: "Terminology"
-description: "Overview to terminology related to ZK Compression and Solana"
----
-
-## Account
-
-An entry in the Solana ledger that holds data or executable program code, stored on chain.
-
-There are different kinds of accounts, including
-
-- Data Accounts: Store arbitrary data used by programs.
-- SPL Token Accounts: Manage token balances (similar to ERC-20 tokens on Ethereum).
-- Program Accounts: Contain the executable code of a Solana program.
-
-## Account Compression Program
-
-Light Protocol's program that implements state and address trees for ZK Compression. The program provides the underlying Merkle tree infrastructure used by the Light System Program to manage compressed account state transitions.
-
-
- **Source**: https://github.com/Lightprotocol/light-protocol/tree/main/programs/account-compression
-
-
-## Address tree
-
-A Merkle tree that stores derived addresses that serves as optional, persistent identifiers for compressed accounts. These addresses serve as persistent identifiers that don't change when account data updates.
-
-Address trees are separate from state trees. Unlike state trees that store account hashes, address trees store actual address values in an indexed structure with pointers to maintain sorted order.
-
-Two address tree versions are currently supported:
-
-- **V1 address trees**: Height 26 (~67 million addresses)
-- **V2 batched address trees**: Height 40 (~1 trillion addresses), optimizing compute unit consumption by up to 70%. V2 is currently on Devnet.
-
-## [Client](https://solana.com/docs/core/transactions#client)
-
-A computer program that accesses the Solana server network [cluster](https://solana.com/docs/core/transactions#cluster).
-
-## [**Cluster**](https://solana.com/docs/references/terminology#cluster)
-
-A set of [validators](https://solana.com/docs/references/terminology#validator) maintaining a single [ledger](https://solana.com/docs/references/terminology#ledger).
-
-## Compressed PDA
-
-Compressed accounts at Program Derived Addresses.
-
-## Compressed account
-
-A data structure that holds arbitrary data, represented as a 32-byte hash stored in a leaf of a state Merkle tree. Compressed accounts do not require a rent exempt balance upon creation.
-
-## Compressed Account hash
-
-A 32-byte identifier uniquely that represents a compressed account's state, stored in a state tree.
-
-## Token mint
-
-An SPL token mint uniquely represents a token on the Solana network and stores global metadata about the token, including `mint_authority`, `supply`, and `decimals`.
-
-SPL tokens can be compressed if the mint has an SPL Interface PDA set up. Anyone can create an SPL interface for any given SPL mint.
-
-## SPL Interface (omnibus account)
-
-An SPL token account (the SPL Interface PDA) that holds SPL tokens corresponding to compressed tokens in circulation. Tokens are deposited during compression and withdrawn during decompression; the account is owned by the Light Token Program's CPI authority PDA.
-
-## Concurrency
-
-The ability to process multiple Merkle tree update requests simultaneously without invalidating each other, as long as they don't modify the same leaf.
-
-Concurrency in ZK Compression allows parallel operations on different tree leaves without requiring locks.
-
-## Compressed Token
-
-An SPL token in compressed form. Compressed tokens do not require an associated token account per holder.
-
-## Compressed Token account
-
-An account type in the Light Token Program to store information about an individual's ownership of a specific token (mint). Compressed token accounts do not require a rent exempt balance upon creation.
-
-## Light Token Program
-
-Light Protocol's SPL-compatible token program that enables compression and decompression of token accounts. The program enforces SPL token layout standards and allows for arbitrary transitions between compressed and regular format.
-
-## [**Compute units**](https://solana.com/docs/references/terminology#compute-units)
-
-The smallest unit of measure for consumption of computational resources of the transactions on the Solana blockchain.
-
-## [**Compute unit budget**](https://solana.com/docs/references/terminology#compute-budget)
-
-The maximum number of [compute units](https://solana.com/docs/references/terminology#compute-units) consumed per transaction.
-
-Developers set the compute unit budget via the`ComputeBudget`instruction, by default 200,000 CU, with a maximum of 1,400,000 CU.
-
-If the transaction exceeds its compute unit limit, it fails and no changes occur.
-
-## Compute unit limits per block
-
-The total amount of compute units that all transactions in a single Solana block - the _blockspace_ - can collectively consume is currently set at 48 million CU.
-
-The maximum compute units that can be used to modify a single account within a block - the _write lock limit -_ is currently set at 12 million CU.
-
-## [Cross-program invocation (CPI)](https://solana.com/docs/core/transactions#cross-program-invocation-cpi)
-
-A call from one [program](https://solana.com/docs/core/transactions#onchain-program) to another.
-
-For more information, see [calling between programs](https://solana.com/docs/core/cpi).
-
-## Decompression
-
-The process of converting a compressed to a regular Solana account. SPL tokens are withdrawn from the SPL Interface PDA to an Associated Token Account and compressed token accounts are invalidated.
-
-## Forester node / Forester
-
-A keeper node to incorporate state updates into state Merkle Trees for ZK Compression.
-
-## Groth16
-
-A zero-knowledge SNARK that produces constant-size proofs using bilinear pairings on elliptic curves.
-
-ZK Compression uses Groth16 to generate 128 byte validity proofs to verify compressed account state transitions against the on-chain root.
-
-## [**Hash**](https://solana.com/docs/references/terminology#hash)
-
-A hash is a digital fingerprint of a sequence of bytes representing arbitrary data, while requiring far less storage space than the original data.
-
-## Indexer
-
-A service that tracks state changes of compressed accounts on the Solana ledger and provides RPC APIs for querying compressed accounts and generating validity proofs.
-
-The ZK Compression indexer is named Photon and is maintained by Helius Labs.
-
-**Source**: https://github.com/helius-labs/photon
-
-## [**Instruction**](https://solana.com/docs/references/terminology#instruction)
-
-A call to invoke a specific [instruction handler](https://solana.com/docs/references/terminology#instruction-handler) in a [program](https://solana.com/docs/references/terminology#program).
-
-An instruction also specifies which accounts it wants to read or modify, and additional data that serves as auxiliary input to the [instruction handler](https://solana.com/docs/references/terminology#instruction-handler). A [client](https://solana.com/docs/references/terminology#client) must include at least one instruction in a [transaction](https://solana.com/docs/references/terminology#transaction), and all instructions must complete for the transaction to be considered successful.
-
-For example, compressed accounts are created or updated with the `InvokeCpiInstruction` to the Light System Program.
-
-## Leaf index
-
-The numerical position (u32) of a compressed account within a state tree, used for Merkle proof generation.
-
-## Light System Program
-
-ZK Compression's core program that validates compressed account state transitions by verifying validity proofs and managing compressed state changes.
-
-The program enforces compressed account layout with ownership and sum checks, and is invoked to create and write to compressed accounts and PDAs.
-
-**Source**: https://github.com/Lightprotocol/light-protocol/tree/main/programs/system
-
-## **Ledger**
-
-The ledger is an immutable historical record of all Solana transactions signed by clients since the genesis block.
-
-A helpful analogy to differentiate Solana ledger and state:
-
-- Ledger is the entire bank statement history.
-- State is the current account balance, derived from all transactions in the bank statement history.
-
-## Merkle tree
-
-A tree data structure to allow for cryptographic verification of the integrity of all leaves in a tree.
-
-Each leaf on a Merkle tree is a hash of that leaf's data. A Merkle tree compresses data by hashing pairs of data repeatedly into a single root hash, starting from the lowest level. Only this root hash is stored on chain. On Solana, this process is called state compression.
-
-## Merkle tree account
-
-The public key of the on-chain Merkle tree account used in ZK Compression. This identifier references the state tree that stores compressed account hashes.
-
-## Merkle proof
-
-A cryptographic proof consisting of sibling node hashes required to verify that a specific leaf exists within a Merkle tree and calculate the root hash.
-
-ZK Compression encodes Merkle proofs into zero-knowledge proofs (validity proofs). These verify compressed account operations with a constant 128-byte size without exposing the underlying variable-size Merkle proof data.
-
-## Nullification
-
-The process of marking compressed accounts as spent to prevent double-spending.
-
-When compressed accounts are used as inputs in transactions, their previous states are invalidated by inserting their hashes into nullifier queues. Forester nodes process these queues to permanently update the corresponding Merkle tree leaves, ensuring each compressed account state can only be used once.
-
-## Nullifier queue
-
-A queue where compressed accounts hashes used as input for transactions are temporarily stored to prevent double spending. A Forester node empties the queue by inserting queue elements into a state Merkle tree.
-
-## [**Program**](https://solana.com/docs/references/terminology#onchain-program)
-
-Programs run executable code similar to smart contracts on other blockchains with optimizations specific to Solana.
-
-Solana programs key characteristics include:
-
-- Solana programs are stateless and do not store state internally. Separate accounts store state for programs to execute on, such as program, user or token data. This makes Solana's account model [different from Ethereum's](https://solana.com/news/evm-to-svm).
-- Programs are typically written in Rust.
-- Programs interpret the [instructions](https://solana.com/docs/references/terminology#instruction) sent inside of each [transaction](https://solana.com/docs/references/terminology#transaction) to read and modify accounts over which it has control, hence update state.
-
-## Parallelism
-
-The ability of the SVM to execute multiple transactions simultaneously, as long as they modify different regular and/or compressed accounts.
-
-## [**Program derived addresses (PDA)**](https://solana.com/docs/references/terminology#program-derived-account-pda)
-
-PDAs are special account addresses derived deterministically using optional seeds, a bump seed, and a program ID.
-
-They are off the Ed25519 curve, meaning they have no private key. The PDA itself, once derived, is 32 bytes, matching a regular public key.
-
-## [**Prioritization fee**](https://solana.com/docs/references/terminology#prioritization-fee)
-
-An additional fee user can specify in the compute budget [instruction](https://solana.com/docs/references/terminology#instruction) to prioritize their [transactions](https://solana.com/docs/references/terminology#transaction).
-
-The priority fee is derived from the compute unit limit and the compute unit price. The price per compute unit set by the user in micro-lamports (1 lamport = 1,000,000 micro-lamports), rounded up to the nearest lamport.
-
-## Poseidon hash
-
-A cryptographic hash function optimized for zero-knowledge proof systems that works natively with finite field arithmetic.
-
-The Poseidon hash is designed to minimize computational complexity in ZK circuits. ZK Compression uses Poseidon hashes to generate the account hashes stored as leaves in state trees.
-
-## Proof verification
-
-The on-chain process of validating zero-knowledge proofs to confirm the correctness of compressed account state transitions.
-
-## Rent
-
-A fee paid in SOL for the creation of [Accounts](https://solana.com/docs/references/terminology#account) to store data on the blockchain, tied to account size. When accounts do not have enough balance to pay rent, they may be Garbage Collected.
-
-## [**Rent exempt**](https://solana.com/docs/references/terminology#rent-exempt)
-
-An account that maintains a minimum lamport balance proportional to the amount of data stored on the account.
-
-All newly created accounts are stored on chain permanently until the account is closed. It is not possible to create an account that falls below the rent exemption threshold.
-
-The rent exemption balance remains locked while an account is active and can be fully recovered when the account is closed.
-
-The minimum balance is paid by the creator and is calculated as follows:
-
-```markdown
-Minimum Rent Balance = 2 × 0.00000348 SOL/byte/year × Account Size (Bytes)
-```
-
-## Remote Procedure Calls (RPC)
-
-A bridge between users (or applications) and the blockchain to facilitate interactions and data retrieval.
-
-The [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) extends [Solana's JSON RPC API](https://solana.com/docs/rpc) with additional endpoints to interact with compressed accounts, provided by Helius Labs.
-
-
- Find more information on [ZK Compression's JSON RPC Methods
- here](/api-reference/json-rpc-methods/overview).
-
-
-## [**Smart contract**](https://solana.com/docs/references/terminology#smart-contract)
-
-Smart contracts on Solana are called programs with key characteristics and optimizations.
-
-## Solana Account Model
-
-The native framework to store and manage data on the Solana blockchain.
-
-Solana's Account Model separates program logic from state to optimize for parallel and faster transactions. Separate accounts store state for programs to execute on, such as program, user or token data. This makes Solana's Account Model [different from Ethereum's](https://solana.com/news/evm-to-svm).
-
-ZK Compression extends Solana's Account Model with Compressed Accounts.
-
-## [**Solana Program Library (SPL)**](https://solana.com/docs/references/terminology#solana-program-library-spl)
-
-A [library of programs](https://spl.solana.com/) on Solana such as spl-token that facilitates tasks such as creating and using tokens.
-
-## State
-
-A snapshot representing the current status of all accounts and programs on Solana.
-
-The state is derived from the ledger by sequentially applying every transaction. State is mutable and changes with every transaction to represent the latest state.
-
-State is kept in RAM by validators for transaction validation.
-
-## State root
-
-The root hash of a Merkle tree that serves as a cryptographic fingerprint representing all compressed accounts in the tree.
-
-State roots are stored on-chain and used by the Light System Program to verify validity proofs during compressed account operations. Each state root represents the complete state of compressed accounts at a specific point in time.
-
-## State tree
-
-A Merkle tree that stores compressed account hashes as leaf nodes.
-
-State trees organize compressed account data into a binary tree structure where each parent node is the hash of its two children nodes. The tree's root hash is stored on-chain as a cryptographic fingerprint representing all accounts in the tree.
-
-Two state tree versions with different proof mechanisms are currently supported:
-
-- **V1 state trees**: Always require the full 128-byte validity proof. With a depth of 26, a single V1 state tree stores approximately 67 million compressed accounts.
-- **V2 batched state trees**: Support `prove_by_index` optimization that verifies account existence with one byte instead of 128 bytes, optimizing compute unit consumption by up to 70%.
-
-## State compression
-
-A process to lower the amount of data stored on chain using Merkle trees.
-
-The process of state compression involves the following steps:
-
-1. Millions of accounts are compressed into a 'fingerprint' - the Merkle tree root hash
-2. This 'fingerprint' is stored in one Solana account
-3. The account history is stored on the Solana ledger
-4. The latest compressed data is fetched from an indexer
-5. To verify the data, recompute the hashes and compare the final hash to the on chain root hash
-
-
- Learn more [on generalized state compression
- here](https://solana.com/developers/courses/state-compression/generalized-state-compression).
-
-
-## Token account
-
-A token account is an account type in Solana's Token Programs that stores information about an individual's ownership of a specific token (mint). Each token account is associated with a single mint and tracks details like the token balance and owner.
-
-## [**Token mint**](https://solana.com/docs/references/terminology#token-mint)
-
-A [mint account](https://solana.com/docs/tokens/basics/create-mint) is an account type in Solana's Token Programs that can produce (or 'mint') tokens.
-
-Different tokens are distinguished by their unique token mint addresses. Token mints uniquely represents a token on the network and stores global metadata about the token, including the `mint_authority`, supply, and decimals.
-
-## [**Transaction**](https://solana.com/docs/references/terminology#transaction)
-
-One or more [instructions](https://solana.com/docs/references/terminology#instruction) signed by a [client](https://solana.com/docs/references/terminology#client) using one or more [keypairs](https://solana.com/docs/references/terminology#keypair) and executed atomically with only two possible outcomes: success or failure.
-
-## Validity proof
-
-A zero-knowledge proof of compressed state included in a transaction to read or write compressed accounts.
-
-Developers don't need to generate _validity proofs_.
-
-The _validity proof_ is
-
-- constant 128 byte in size (other than Merkle proofs with varying proof size), fitting well in Solana's 1232 byte transaction limit
-- verified against the respective on chain fingerprint to ensure the provided data was previously emitted
-- provided and generated by indexers that support the [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) which extend Solana's [JSON RPC API](https://solana.com/docs/rpc) to interact with compressed accounts. .
-
-## Zero-knowledge proof (ZKP)
-
-A cryptographic proof to verify the validity of a statement without revealing the underlying data.
-
-ZK Compression uses a Groth16 SNARK zk proof
-
-- for its constant _validity_ proof size, to ensures the integrity of many compressed accounts, not for private or confidential transactions, and
-- to store data in zk friendly data structures. Applications on Solana can prove custom off chain computations over zk compressed state (native zk compute).
-
-## ZK-SNARK
-
-Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge, a cryptographic proof system that enables proving knowledge of information without revealing the information itself.
-
-zk-SNARKs produce constant-size proofs that can be verified efficiently without interaction between prover and verifier. ZK Compression uses the Groth16 zk-SNARK construction to generate validity proofs for compressed account state transitions.
-
-## ZK Compression
-
-A generalized compression framework to compress and verify arbitrary data with zero-knowledge proofs, to
-
-- enable the Compressed Account Model, the rent-free equivalent to Solana's Account Model,
-- solve Solana's state growth problem, and
-- build a foundation for native zk compute.
diff --git a/render_canvas.py b/render_canvas.py
new file mode 100644
index 00000000..28e470ff
--- /dev/null
+++ b/render_canvas.py
@@ -0,0 +1,345 @@
+#!/usr/bin/env python3
+"""
+Centered-Column Logos with Symmetric Gradient Bands — Refined
+Renders the composition spec to PNG using Pillow.
+"""
+
+from PIL import Image, ImageDraw, ImageFont, ImageFilter
+import math
+import os
+
+# ── Canvas ──────────────────────────────────────────────────────────────────
+W, H = 1054, 734
+BG = (0xF4, 0xF1, 0xEC)
+
+canvas = Image.new("RGBA", (W, H), (*BG, 255))
+
+FONT_DIR = "/home/tilo/.claude/skills/canvas-design/canvas-fonts"
+
+
+# ── Helpers ─────────────────────────────────────────────────────────────────
+
+def hex_to_rgba(h, opacity=1.0):
+ h = h.lstrip("#")
+ r, g, b = int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16)
+ return (r, g, b, int(min(1.0, max(0.0, opacity)) * 255))
+
+
+def lerp_color(c0, c1, t):
+ """Linear interpolate between two RGBA tuples."""
+ return tuple(int(c0[i] + (c1[i] - c0[i]) * t) for i in range(4))
+
+
+def gradient_color_at(t, stops):
+ """Get interpolated RGBA at position t (0..1) along gradient stops."""
+ if t <= stops[0]["pos"]:
+ return hex_to_rgba(stops[0]["color"], stops[0]["opacity"])
+ if t >= stops[-1]["pos"]:
+ return hex_to_rgba(stops[-1]["color"], stops[-1]["opacity"])
+
+ for i in range(len(stops) - 1):
+ s0, s1 = stops[i], stops[i + 1]
+ if s0["pos"] <= t <= s1["pos"]:
+ lt = (t - s0["pos"]) / max(s1["pos"] - s0["pos"], 1e-9)
+ c0 = hex_to_rgba(s0["color"], s0["opacity"])
+ c1 = hex_to_rgba(s1["color"], s1["opacity"])
+ return lerp_color(c0, c1, lt)
+
+ return hex_to_rgba(stops[-1]["color"], stops[-1]["opacity"])
+
+
+def draw_gradient_band(img, x, y, w, h, stops, angle_deg, global_opacity=0.92):
+ """Draw a horizontal linear gradient band with per-pixel precision."""
+ band = Image.new("RGBA", (w, h), (0, 0, 0, 0))
+ pixels = band.load()
+
+ for px_x in range(w):
+ t = px_x / max(w - 1, 1)
+ if angle_deg == 180:
+ t = 1.0 - t
+
+ r, g, b, a = gradient_color_at(t, stops)
+ a = int(a * global_opacity)
+ col = (r, g, b, a)
+
+ for px_y in range(h):
+ pixels[px_x, px_y] = col
+
+ # Subtle blur per spec
+ band = band.filter(ImageFilter.GaussianBlur(radius=0.5))
+ img.paste(band, (x, y), band)
+
+
+def draw_dashed_line(draw, x0, y0, x1, y1, color, dash_on=6, dash_off=10, width=1):
+ """Draw a dashed line segment."""
+ dx = x1 - x0
+ dy = y1 - y0
+ length = math.sqrt(dx * dx + dy * dy)
+ if length < 1:
+ return
+ ux, uy = dx / length, dy / length
+ pos = 0.0
+ drawing = True
+ while pos < length:
+ seg = dash_on if drawing else dash_off
+ seg = min(seg, length - pos)
+ if drawing:
+ sx = x0 + ux * pos
+ sy = y0 + uy * pos
+ ex = x0 + ux * (pos + seg)
+ ey = y0 + uy * (pos + seg)
+ draw.line([(sx, sy), (ex, ey)], fill=color, width=width)
+ pos += seg
+ drawing = not drawing
+
+
+# ── Grid Overlay ────────────────────────────────────────────────────────────
+
+def draw_grid(img):
+ draw = ImageDraw.Draw(img)
+ ml, mt, mr, mb = 26, 26, 26, 26
+ rows, cols = 6, 6
+ color = (0xBD, 0xB7, 0xAE, int(0.55 * 255))
+
+ left, right = ml, W - mr
+ top, bottom = mt, H - mb
+ iw = right - left
+ ih = bottom - top
+
+ for i in range(rows + 1):
+ y = top + int(i * ih / rows)
+ draw_dashed_line(draw, left, y, right, y, color)
+
+ for i in range(cols + 1):
+ x = left + int(i * iw / cols)
+ draw_dashed_line(draw, x, top, x, bottom, color)
+
+ # Center guides (these land on grid lines for 6x6, but spec says show them)
+ cx, cy = W // 2, H // 2
+ draw_dashed_line(draw, cx, top, cx, bottom, color)
+ draw_dashed_line(draw, left, cy, right, cy, color)
+
+
+# ── Gradient Band Stops ─────────────────────────────────────────────────────
+
+band_stops = [
+ {"pos": 0.0, "color": "#A9C4F2", "opacity": 0.95},
+ {"pos": 0.55, "color": "#B6CDF4", "opacity": 0.85},
+ {"pos": 0.78, "color": "#E58F86", "opacity": 0.85},
+ {"pos": 1.0, "color": "#F4F1EC", "opacity": 0.0},
+]
+
+
+def draw_bands(img):
+ draw_gradient_band(img, 96, 206, 408, 246, band_stops, angle_deg=0, global_opacity=0.92)
+ draw_gradient_band(img, 550, 206, 408, 246, band_stops, angle_deg=180, global_opacity=0.92)
+
+
+# ── White Tiles ─────────────────────────────────────────────────────────────
+
+def draw_tiles(img):
+ draw = ImageDraw.Draw(img)
+ draw.rectangle([456, 92, 456 + 141, 92 + 141], fill=(255, 255, 255, 255))
+ draw.rectangle([456, 442, 456 + 141, 442 + 141], fill=(255, 255, 255, 255))
+
+
+# ── Logo X Mark (refined) ──────────────────────────────────────────────────
+
+def draw_x_mark(img):
+ """Stylized X with sharp terminals — refined with anti-aliased rendering."""
+ # Render at 4x then downscale for clean anti-aliasing
+ scale = 4
+ mark_w, mark_h = 84, 92
+ big_w, big_h = mark_w * scale, mark_h * scale
+
+ big = Image.new("RGBA", (big_w, big_h), (0, 0, 0, 0))
+ draw = ImageDraw.Draw(big)
+
+ stroke_w = 14 * scale
+ hw = stroke_w / 2
+
+ # Diagonal 1: top-left to bottom-right
+ d_len = math.sqrt(big_w ** 2 + big_h ** 2)
+ ux, uy = big_w / d_len, big_h / d_len
+ px, py = -uy, ux
+
+ x0, y0 = 0, 0
+ x1, y1 = big_w, big_h
+
+ draw.polygon([
+ (x0 + px * hw, y0 + py * hw),
+ (x0 - px * hw, y0 - py * hw),
+ (x1 - px * hw, y1 - py * hw),
+ (x1 + px * hw, y1 + py * hw),
+ ], fill=(0x11, 0x11, 0x11, 255))
+
+ # Diagonal 2: top-right to bottom-left
+ x2, y2 = big_w, 0
+ x3, y3 = 0, big_h
+ ux2, uy2 = -big_w / d_len, big_h / d_len
+ px2, py2 = -uy2, ux2
+
+ draw.polygon([
+ (x2 + px2 * hw, y2 + py2 * hw),
+ (x2 - px2 * hw, y2 - py2 * hw),
+ (x3 - px2 * hw, y3 - py2 * hw),
+ (x3 + px2 * hw, y3 + py2 * hw),
+ ], fill=(0x11, 0x11, 0x11, 255))
+
+ # Downscale with high-quality resampling
+ mark = big.resize((mark_w, mark_h), Image.LANCZOS)
+ img.paste(mark, (486, 118), mark)
+
+
+# ── Connector Group (refined) ──────────────────────────────────────────────
+
+def draw_connector(img):
+ """Center connector: white slot, twin red bars, gradient bridge."""
+ # White slot
+ slot = Image.new("RGBA", (44, 206), (255, 255, 255, 255))
+ img.paste(slot, (505, 234), slot)
+
+ # Red bars — render at 2x for cleaner blur edges
+ def make_red_bar():
+ scale = 2
+ bw, bh = 18 * scale, 198 * scale
+ bar = Image.new("RGBA", (bw, bh), hex_to_rgba("#E08A83", 0.9))
+ bar = bar.filter(ImageFilter.GaussianBlur(radius=1.0 * scale))
+ # Apply 0.85 opacity
+ pixels = bar.load()
+ for x in range(bw):
+ for y in range(bh):
+ r, g, b, a = pixels[x, y]
+ pixels[x, y] = (r, g, b, int(a * 0.85))
+ return bar.resize((18, 198), Image.LANCZOS)
+
+ bar_l = make_red_bar()
+ bar_r = make_red_bar()
+ img.paste(bar_l, (492, 238), bar_l)
+ img.paste(bar_r, (544, 238), bar_r)
+
+ # Horizontal bridge with gradient
+ bridge_w, bridge_h = 70, 58
+ bridge_stops = [
+ {"pos": 0.0, "color": "#E08A83", "opacity": 0.75},
+ {"pos": 0.5, "color": "#B59AD0", "opacity": 0.85},
+ {"pos": 1.0, "color": "#E08A83", "opacity": 0.75},
+ ]
+
+ bridge = Image.new("RGBA", (bridge_w, bridge_h), (0, 0, 0, 0))
+ pixels = bridge.load()
+ for px_x in range(bridge_w):
+ t = px_x / max(bridge_w - 1, 1)
+ r, g, b, a = gradient_color_at(t, bridge_stops)
+ a = int(a * 0.9) # global opacity
+ for px_y in range(bridge_h):
+ pixels[px_x, px_y] = (r, g, b, a)
+
+ bridge = bridge.filter(ImageFilter.GaussianBlur(radius=0.6))
+ img.paste(bridge, (492, 310), bridge)
+
+
+# ── Starburst Mark (refined — soft rounded spokes) ─────────────────────────
+
+def draw_starburst(img):
+ """Radial starburst with 13 rounded spokes, soft ends. Rendered at 4x."""
+ scale = 4
+ box_size = 64
+ big_size = box_size * scale
+ cx = big_size // 2
+ cy = big_size // 2
+
+ big = Image.new("RGBA", (big_size, big_size), (0, 0, 0, 0))
+ draw = ImageDraw.Draw(big)
+
+ color = hex_to_rgba("#C77456", 1.0)
+ num_spokes = 13
+ outer_r = 28 * scale
+ inner_r = 9 * scale
+ spoke_half_w_base = 4.0 * scale
+ spoke_half_w_tip = 1.8 * scale
+
+ # Central disk
+ draw.ellipse(
+ [cx - inner_r, cy - inner_r, cx + inner_r, cy + inner_r],
+ fill=color,
+ )
+
+ # Spokes as smooth tapered shapes
+ for i in range(num_spokes):
+ angle = (2 * math.pi * i) / num_spokes - math.pi / 2
+
+ cos_a = math.cos(angle)
+ sin_a = math.sin(angle)
+ perp_x = -sin_a
+ perp_y = cos_a
+
+ # Base point (just inside the disk edge)
+ base_dist = inner_r * 0.65
+ bx = cx + cos_a * base_dist
+ by = cy + sin_a * base_dist
+
+ # Tip point
+ tx = cx + cos_a * outer_r
+ ty = cy + sin_a * outer_r
+
+ # Mid point for curvature
+ mid_dist = (base_dist + outer_r) * 0.55
+ mx = cx + cos_a * mid_dist
+ my = cy + sin_a * mid_dist
+
+ # Draw spoke as a polygon with tapered width
+ # Base width -> mid width -> tip width
+ mid_half = spoke_half_w_base * 0.7
+
+ poly = [
+ (bx + perp_x * spoke_half_w_base, by + perp_y * spoke_half_w_base),
+ (mx + perp_x * mid_half, my + perp_y * mid_half),
+ (tx + perp_x * spoke_half_w_tip, ty + perp_y * spoke_half_w_tip),
+ (tx - perp_x * spoke_half_w_tip, ty - perp_y * spoke_half_w_tip),
+ (mx - perp_x * mid_half, my - perp_y * mid_half),
+ (bx - perp_x * spoke_half_w_base, by - perp_y * spoke_half_w_base),
+ ]
+ draw.polygon(poly, fill=color)
+
+ # Rounded tip: small circle at spoke end
+ tip_r = spoke_half_w_tip * 1.1
+ draw.ellipse(
+ [tx - tip_r, ty - tip_r, tx + tip_r, ty + tip_r],
+ fill=color,
+ )
+
+ # Downscale for anti-aliased smoothness
+ mark = big.resize((box_size, box_size), Image.LANCZOS)
+ img.paste(mark, (495, 485), mark)
+
+
+# ── Assemble (correct z-order) ──────────────────────────────────────────────
+
+# 1. Gradient bands (lowest)
+draw_bands(canvas)
+
+# 2. Grid overlay (above bands, below tiles)
+draw_grid(canvas)
+
+# 3. White tiles (above bands)
+draw_tiles(canvas)
+
+# 4. Connector (sits between tiles, above bands)
+draw_connector(canvas)
+
+# 5. Logo marks (topmost)
+draw_x_mark(canvas)
+draw_starburst(canvas)
+
+# ── Export ───────────────────────────────────────────────────────────────────
+
+out_path = "/home/tilo/Workspace/docs-main-reorder/symmetric-convergence.png"
+
+# Flatten RGBA to RGB against the background
+flat = Image.new("RGB", (W, H), BG)
+flat.paste(canvas, (0, 0), canvas)
+flat.save(out_path, "PNG", dpi=(144, 144))
+
+print(f"Saved: {out_path}")
+print(f"Size: {W}x{H}px")
diff --git a/resources/addresses-and-urls.mdx b/resources/addresses-and-urls.mdx
index c7f3308e..edae0590 100644
--- a/resources/addresses-and-urls.mdx
+++ b/resources/addresses-and-urls.mdx
@@ -5,6 +5,7 @@ keywords: ["light protocol addresses", "zk compression endpoints"]
---
import SystemAccountsList from '/snippets/accounts-list/compressed-pdas-system-accounts-list.mdx';
+import SupportFooter from "/snippets/support-footer.mdx";
## RPC URLs
@@ -174,20 +175,21 @@ main();
# Next Steps
-Start building with Compressed Tokens or PDAs
+
+
diff --git a/resources/cli-installation.mdx b/resources/cli.mdx
similarity index 63%
rename from resources/cli-installation.mdx
rename to resources/cli.mdx
index b29b6b37..9f72b115 100644
--- a/resources/cli-installation.mdx
+++ b/resources/cli.mdx
@@ -1,6 +1,6 @@
---
-title: "CLI Installation & Commands"
-description: "Steps to set up your local environment for ZK Compression development. CLI to interact with compressed accounts and compressed tokens on Solana."
+title: "CLI installation & commands"
+description: "Steps to set up your local environment for Light Protocol development. CLI to interact with Light Tokens and compressed accounts on Solana."
keywords: ["light protocol cli", "zk compression cli"]
---
@@ -11,26 +11,16 @@ The CLI will use this wallet as the default fee payer and mint authority.
# Installation
-
-
- Ask anything about the ZK Compression CLI via
-
-
-
-
-
-
-
-### Install the ZK Compression CLI
+### Install the CLI
Ensure you have Node >= v20.9.0 installed on your machine. Windows users do not require WSL.
-Run this single command to install the ZK Compression CLI.
+Run this single command to install the CLI.
```bash
npm i -g @lightprotocol/zk-compression-cli
@@ -75,7 +65,7 @@ which light
-### Set Up Your Environment
+### Set up your environment
By default, the CLI interacts with localnet. You can view the current config by running:
@@ -149,7 +139,7 @@ solana address
# Commands
-### Create a compressed token mint
+### Create a Light Token mint
```bash
light create-mint
@@ -162,15 +152,14 @@ USAGE
FLAGS
--mint-authority= Path to the mint authority keypair file.
- Defaults to default local Solana wallet file
- path.
+ Defaults to the fee payer.
--mint-decimals= Number of base 10 digits to the right
of the decimal place [default: 9].
--mint-keypair= Path to a mint keypair file. Defaults to a
random keypair.
```
-### Mint compressed tokens to a Solana wallet
+### Mint Light Tokens to a Solana wallet
```bash
light mint-to --mint "YOUR_MINT_ADDRESS" --to "YOUR_WALLET_ADDRESS" --amount 4200000000
@@ -189,7 +178,7 @@ FLAGS
--to= (required) Recipient address.
```
-### Transfer compressed tokens from one wallet to another
+### Transfer Light Tokens from one wallet to another
```bash
light transfer --mint "YOUR_MINT_ADDRESS" --to "RECIPIENT_WALLET_ADDRESS" --amount 4200000000
@@ -209,51 +198,107 @@ FLAGS
```
-### Assign native SOL to a compressed account
+### Enable Light Token Interoperability for existing SPL mint
+
+```bash
+light create-interface-pda --mint "YOUR_MINT_ADDRESS"
+```
+
+```bash
+USAGE
+ $ light create-interface-pda --mint
+
+FLAGS
+ --mint= (required) Base58 encoded mint address to register.
+```
+
+### Create a Light Token associated token account
+
+```bash
+light create-token-account "YOUR_MINT_ADDRESS"
+```
+
+```bash
+USAGE
+ $ light create-token-account MINT [--owner ]
+
+ARGUMENTS
+ MINT (required) Base58 encoded mint address.
+
+FLAGS
+ --owner= Owner of the token account. Defaults to the fee
+ payer's public key.
+```
+
+### Wrap SPL tokens into a Light Token account
+
+```bash
+light wrap-spl --mint "YOUR_MINT_ADDRESS" --to "RECIPIENT_ADDRESS" --amount 1000
+```
+
+```bash
+USAGE
+ $ light wrap-spl --mint --to --amount
+
+FLAGS
+ --amount= (required) Amount to wrap, in tokens.
+ --mint= (required) Mint address.
+ --to= (required) Recipient address (owner of destination
+ Light Token account).
+```
+
+### Unwrap Light Tokens into an SPL token account
+
+```bash
+light unwrap-spl --mint "YOUR_MINT_ADDRESS" --to "RECIPIENT_ADDRESS" --amount 1000
+```
+
+```bash
+USAGE
+ $ light unwrap-spl --mint --to --amount
+
+FLAGS
+ --amount= (required) Amount to unwrap, in tokens.
+ --mint= (required) Mint address.
+ --to= (required) Recipient address (owner of destination
+ SPL token account).
+```
+
+### Check Light Token balance
```bash
-light compress-sol --amount 1000 --to "YOUR_WALLET_ADDRESS_BASE58"
+light token-balance --mint "YOUR_MINT_ADDRESS" --owner "YOUR_WALLET_ADDRESS"
```
```bash
USAGE
- $ light compress-sol --to --amount
+ $ light token-balance --mint --owner
FLAGS
- --amount= (required) Amount to compress in lamports.
- --to= (required) Specify the recipient address.
+ --mint= (required) Mint address of the token account.
+ --owner= (required) Address of the token owner.
```
-### Decompress into native SOL
+### Check wrapped SOL balance
```bash
-light decompress-sol --amount 42 --to "YOUR_WALLET_ADDRESS_BASE58"
+light balance --owner "YOUR_WALLET_ADDRESS"
```
```bash
USAGE
- $ light decompress-sol --to --amount
+ $ light balance --owner
FLAGS
- --amount= (required) Amount to decompress in lamports.
- --to= (required) Specify the recipient address.
+ --owner= (required) Address of the owner.
```
# Next Steps
-
-
-
diff --git a/resources/error-cheatsheet.mdx b/resources/error-cheatsheet.mdx
index 30338b04..d7526e5f 100644
--- a/resources/error-cheatsheet.mdx
+++ b/resources/error-cheatsheet.mdx
@@ -4,6 +4,8 @@ sidebarTitle: "Overview"
description: "Complete error code reference for ZK Compression. Search error codes with hex values and messages."
---
+import SupportFooter from "/snippets/support-footer.mdx";
+
## How to use this page
1. **Search your error code or hex value** with `Cmd+F`/ `Ctrl+F`
@@ -312,3 +314,5 @@ description: "Complete error code reference for ZK Compression. Search error cod
| 16032 | 0x3EA0 | `InvalidCpiContextAccount` | "Invalid CPI context account" |
| 16033 | 0x3EA1 | `InvalidSolPoolPdaAccount` | "Invalid SolPool PDA account" |
| 16034 | 0x3EA2 | `InvalidCpiAccountsOffset` | "CpiAccounts accounts slice starts with an invalid account. It should start with LightSystemProgram SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7." |
+
+
diff --git a/references/migration-v1-to-v2.mdx b/resources/migration-v1-to-v2.mdx
similarity index 98%
rename from references/migration-v1-to-v2.mdx
rename to resources/migration-v1-to-v2.mdx
index f89b9580..8f6bea07 100644
--- a/references/migration-v1-to-v2.mdx
+++ b/resources/migration-v1-to-v2.mdx
@@ -5,6 +5,7 @@ sidebarTitle: V2 Migration Guide
---
import V1ToV2MigrationPrompt from "/snippets/ai-prompts/v1-to-v2-migration.mdx";
+import SupportFooter from "/snippets/support-footer.mdx";
## V2 Improvements
@@ -335,6 +336,8 @@ const remainingAccounts = PackedAccounts.newWithSystemAccountsV2(systemAccountCo
title="Program examples"
icon="chevron-right"
color="#0066ff"
- href="/compressed-pdas/program-examples"
+ href="/pda/compressed-pdas/program-examples"
horizontal
/>
+
+
diff --git a/references/node-operators.mdx b/resources/node-operators.mdx
similarity index 100%
rename from references/node-operators.mdx
rename to resources/node-operators.mdx
diff --git a/resources/sdks/client-development.mdx b/resources/sdks/client-development.mdx
deleted file mode 100644
index a26c6ee7..00000000
--- a/resources/sdks/client-development.mdx
+++ /dev/null
@@ -1,85 +0,0 @@
----
-title: "Client Development"
-description: Overview of Rust and TypeScript SDKs for client side development.
----
-
-
-### Installation
-
-
-```bash npm
-npm install --save \
- @lightprotocol/stateless.js \
- @lightprotocol/compressed-token \
- @solana/web3.js \
- @lightprotocol/zk-compression-cli
-```
-
-```bash Yarn
-yarn add \
- @lightprotocol/stateless.js \
- @lightprotocol/compressed-token \
- @solana/web3.js \
- @lightprotocol/zk-compression-cli
-```
-
-
-
-### Dependencies
-```toml
-[dependencies]
-light-client = "0.16.0"
-light-sdk = "0.16.0"
-```
-
-### Examples and Guide
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/resources/sdks/program-development.mdx b/resources/sdks/program-development.mdx
deleted file mode 100644
index 7ae55b87..00000000
--- a/resources/sdks/program-development.mdx
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: Program Development
-description: "Overview of on-chain program development using Anchor, Pinocchio, or native Rust SDKs."
----
-
-import DevelopmentEnvironmentSetup from '/snippets/setup/development-environment-setup.mdx';
-
-## Rust Crates
-
-ZK Compression's Rust crates are published to [crates.io](https://docs.rs/releases/search?query=zk+compression) and can be found on [docs.rs](https://crates.io/search?q=zk%20compression) with the `light-` prefix.
-
-- [`light-sdk`](https://github.com/Lightprotocol/light-protocol/tree/main/sdk-libs/sdk) — For Anchor and native programs. Includes CPI utilities, compressed account abstractions similar to anchor Account, and metadata structs for CPIs to the Light System program.
-- [`light-sdk-pinocchio`](https://github.com/Lightprotocol/light-protocol/tree/main/sdk-libs/sdk-pinocchio) — For Pinocchio programs. Pinocchio-optimized SDK with compressed account abstractions and CPI utilities.
-
-## Light Programs Overview
-
-
-Your custom program invokes the _Light system program_ via Cross-Program Invocation (CPI) to leverage ZK Compression.
-
-
-| Program | Description |
-|:-|:-|
-| [light-system-program](https://github.com/Lightprotocol/light-protocol/tree/main/programs/system) | Enforces compressed account layout, ownership checks, and validity proof verification. Used to create/write compressed accounts and PDAs. |
-| [light-compressed-token](https://crates.io/crates/light-compressed-token) | SPL-compatible compressed token implementation with arbitrary compression/decompression support. |
-| [account-compression](https://github.com/Lightprotocol/light-protocol/tree/main/programs/account-compression) | State and address tree implementation used by the Light System program. Clients and custom programs do not interact with the Account Compression Program — this is handled under the hood. |
-
-## Version Requirements
-
-
-Required versions:
-
-* **Rust**: 1.86.0 or later
-* **Solana CLI**: 2.2.15
-* **Anchor CLI**: 0.31.1
-* **Zk compression CLI**: 0.27.0 or later
-* **Node.js**: 23.5.0 or later
-
-
-
-
-
-
-
-## Next Steps
-
-Build your own program or view program examples.
-
-
-
-
-
\ No newline at end of file
diff --git a/resources/security.mdx b/resources/security.mdx
new file mode 100644
index 00000000..4b7e1fe8
--- /dev/null
+++ b/resources/security.mdx
@@ -0,0 +1,37 @@
+---
+title: "Security"
+description: "Overview to Light Protocol's bug bounty program, third party security audits, and formal verification of circuits."
+keywords: ["light protocol security", "zk compression audits"]
+---
+
+### Bug Bounty
+
+Light Protocol is hosting a [bug bounty program](https://immunefi.com/bug-bounty/light-protocol/information/).
+
+### Security Audits
+
+The Light protocol on-chain programs were audited by independent security firms Certora, OtterSec, Accretion, HashCloak, Neodyme, and Zellic.
+
+| Firm | Scope | Date | Report |
+| :--- | :--- | :--- | :--- |
+| **Certora** | Light Token | December '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/certora_2025-12_light-token.pdf) |
+| **OtterSec** | CPI Context Refactor | December '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec_2025-12_cpi-context-refactor.pdf) |
+| **Accretion** | ZK Compression v2 | June '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/accretion_2025-06_zkcompression-v2.pdf) |
+| **OtterSec** | Batched Merkle Trees | June '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec_2025-06_batched-merkle-trees.pdf) |
+| **HashCloak** | Compressed Token & ZK Compression v2 | March '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/hashcloak_2025-03_compressed-token-update-and-zkcompression-v2.pdf) |
+| **OtterSec** | Zerocopy | March '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec_2025-03_zerocopy.pdf) |
+| **Accretion** | Compressed Token Program Update | January '25 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/accretion_2025-01_compressed-token-program-update.pdf) |
+| **Zellic** | ZK Compression v1 | September '24 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/zellic_2024-09_zkcompression-v1.pdf) |
+| **Neodyme** | ZK Compression v1 | August '24 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/neodyme_2024-08_zkcompression-v1.pdf) |
+| **OtterSec** | ZK Compression v1 | August '24 | [View](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec_2024-08_zkcompression-v1.pdf) |
+
+### Groth16 Circuit Security
+
+The ZK Compression circuit was formally verified by Reilabs. See the report [here](https://github.com/Lightprotocol/light-protocol/blob/main/audits/reilabs_2024-08_circuits_formal_verification_report.pdf).
+
+Information about the Trusted Setup Ceremony for the groth16 circuits is [here](https://github.com/Lightprotocol/gnark-mt-setup/blob/main/README.md).
+
+
+**For additional information on Light Protocol's security policy, read** [**here**](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md)**.**
+
+
diff --git a/resources/terminology.mdx b/resources/terminology.mdx
new file mode 100644
index 00000000..393d8159
--- /dev/null
+++ b/resources/terminology.mdx
@@ -0,0 +1,525 @@
+---
+title: "Terminology"
+description: "Overview of terminology related to ZK Compression, Light Token, and Solana"
+---
+
+import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
+import CompressibleVsSolanaRent from "/snippets/compressible-vs-solana-rent.mdx";
+
+## Account
+
+An entry in the Solana ledger that holds data or executable program code, stored on chain.
+
+There are different kinds of accounts, including
+
+- Data Accounts: Store arbitrary data used by programs.
+- SPL Token Accounts: Manage token balances (similar to ERC-20 tokens on Ethereum).
+- Program Accounts: Contain the executable code of a Solana program.
+
+## Account Compression Program
+
+Light Protocol's program that implements state and address trees for ZK Compression. The Light System Program uses the Account Compression Program's Merkle tree infrastructure to store compressed account state transitions.
+
+> **Program ID**: `compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq` | [Source](https://github.com/Lightprotocol/light-protocol/tree/main/programs/account-compression)
+
+## Account Compression Authority
+
+A PDA that signs CPI calls from the Light System Program to the Account Compression Program. Derived from the Light System Program ID with seed `b'cpi_authority'`.
+
+> **Address**: `HZH7qSLcpAeDqCopVU4e5XkhT9j3JFsQiq8CmruY3aru`
+
+## Agent skills
+
+Folders of instructions, scripts, and resources that AI agents can discover and use to build on Light Protocol more accurately and efficiently.
+Light Protocol provides agent skills for rent-free Solana development: Light-PDA, token and mint accounts.
+Skills for compressed PDAs and more are in development.
+
+| Use case | Skill |
+|----------|-------|
+| Build rent-free Solana programs with Light SDK (Anchor or Pinocchio). Includes router integration. | [light-sdk](https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk) |
+| Use Light Token client SDKs (TypeScript and Rust) for mints, ATAs, transfers | [light-token-client](https://github.com/Lightprotocol/skills/tree/main/skills/light-token-client) |
+| Stream account state via Laserstream gRPC | [data-streaming](https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming) |
+| Wallets and payment flows with Light Token. Optional nullifier to prevent your on-chain instruction from being executed more than once. | [payments-and-wallets](https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets) |
+| Airdrops, DePIN, token distribution | [token-distribution](https://github.com/Lightprotocol/skills/tree/main/skills/token-distribution) |
+| Anti-double-spend nullifiers for privacy-preserving ZK programs | [zk-nullifier](https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier) |
+| Testing programs and clients on localnet, devnet, mainnet | [testing](https://github.com/Lightprotocol/skills/tree/main/skills/testing) |
+| For per-user state, DePIN nodes, and infrequently accessed app state with compressed PDAs | [solana-compression](https://github.com/Lightprotocol/skills/tree/main/skills/solana-compression) |
+| Help with debugging and questions via DeepWiki MCP | [ask-mcp](https://github.com/Lightprotocol/skills/tree/main/skills/ask-mcp) |
+
+Built on [Anthropic's Skills](https://github.com/anthropics/skills) and the [Agent Skills Specification](https://agentskills.io).
+
+> [Source Code](https://github.com/Lightprotocol/skills) | [Claude plugin](https://github.com/Lightprotocol/skills/tree/main/.claude-plugin) | [OpenClaw plugin](https://github.com/Lightprotocol/skills/blob/main/openclaw.plugin.json)
+
+## Address tree
+
+A Merkle tree that stores derived addresses that serves as optional, persistent identifiers for compressed accounts. These addresses serve as persistent identifiers that don't change when account data updates.
+
+Address trees are separate from state trees. Unlike state trees that store account hashes, address trees store actual address values in an indexed structure with pointers to maintain sorted order.
+
+Two address tree versions are currently supported:
+
+- **V1 address trees**: Height 26 (~67 million addresses)
+- **V2 batched address trees**: Height 40 (~1 trillion addresses), optimizing compute unit consumption by up to 70%. V2 is currently on Devnet.
+
+| Version | Address Tree | Address Queue |
+|:--------|:-------------|:--------------|
+| V2 | `amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx` | — |
+| V1 (deprecated) | `amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2` | `aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F` |
+
+## Address queue
+
+A queue used in V1 address trees to buffer new addresses before Forester nodes insert them into the address tree. V2 address trees do not use a separate queue.
+
+> **Address (V1)**: `aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F`
+
+## [Client](https://solana.com/docs/core/transactions#client)
+
+A computer program that accesses the Solana server network [cluster](https://solana.com/docs/core/transactions#cluster).
+
+## [Cluster](https://solana.com/docs/references/terminology#cluster)
+
+A set of [validators](https://solana.com/docs/references/terminology#validator) maintaining a single [ledger](https://solana.com/docs/references/terminology#ledger).
+
+## Cold account
+
+A Light Token account, Light Token mint, or Light-PDA that has been compressed after extended inactivity. The account's state is cryptographically preserved on the Solana ledger as a compressed account. On-chain lookups return `is_initialized: false`. Clients call `create_load_instructions` to load the account.
+
+## Compressible account
+
+A Solana account (Light Token account, Light Token mint, or Light-PDA) that automatically compresses when its rent balance drops below threshold. Forester nodes execute the compression. The account can be loaded when accessed again.
+
+## Compressed account
+
+A data structure that holds arbitrary data, represented as a 32-byte hash stored in a leaf of a state Merkle tree. Compressed accounts do not require a rent exempt balance upon creation.
+
+## Compressed account hash
+
+A 32-byte identifier that uniquely represents a compressed account's state, stored in a state tree.
+
+## Compressed PDA
+
+Compressed accounts with an address stored in an address Merkle tree.
+Full Solana PDA functionality and composability without rent-exemption.
+
+> [Docs](/pda/compressed-pdas/overview)
+
+## Compressed token
+
+An SPL token stored as a compressed account hash in a state tree. Compressed tokens incur no rent and do not require a token account per holder.
+
+> [Docs](/compressed-tokens/overview)
+
+## Compressed token account
+
+A compressed account that stores a token balance for a specific mint.
+Compressed token accounts do not require a rent exempt balance upon creation.
+Compressed token accounts are compressed accounts that do not need an address.
+
+## [Compute unit budget](https://solana.com/docs/references/terminology#compute-budget)
+
+The maximum number of [compute units](https://solana.com/docs/references/terminology#compute-units) consumed per transaction.
+
+Developers set the compute unit budget via the`ComputeBudget`instruction, by default 200,000 CU, with a maximum of 1,400,000 CU.
+
+If the transaction exceeds its compute unit limit, it fails and no changes occur.
+
+## Compute unit limits per block
+
+The total amount of compute units that all transactions in a single Solana block - the _blockspace_ - can collectively consume is currently set at 48 million CU.
+
+The maximum compute units that can be used to modify a single account within a block - the _write lock limit -_ is currently set at 12 million CU.
+
+## [Compute units](https://solana.com/docs/references/terminology#compute-units)
+
+The smallest unit of measure for consumption of computational resources of the transactions on the Solana blockchain.
+
+## [Cross-program invocation (CPI)](https://solana.com/docs/core/transactions#cross-program-invocation-cpi)
+
+A call from one [program](https://solana.com/docs/core/transactions#onchain-program) to another.
+
+For more information, see [calling between programs](https://solana.com/docs/core/cpi).
+
+## CPI context account
+
+An account passed in transactions that stores intermediate CPI state for compressed account operations. Each state tree has a dedicated CPI context account.
+
+Addresses are listed under the state tree entry.
+
+## CPI signer
+
+A PDA that signs CPI calls from your program to the Light System Program. Verified by the Light System Program during CPI. Derived from your program ID using `derive_light_cpi_signer`.
+
+## Decompression
+
+The process of converting a compressed account to a regular Solana account. For token decompression, SPL tokens are released from the SPL interface PDA to an associated token account, and the compressed token account is invalidated.
+
+## Forester node / Forester
+
+A keeper node to incorporate state updates into state Merkle Trees for ZK Compression.
+
+## Groth16
+
+A zero-knowledge SNARK that produces constant-size proofs using bilinear pairings on elliptic curves.
+
+ZK Compression uses Groth16 to generate 128 byte validity proofs to verify compressed account state transitions against the on-chain root.
+
+## [Hash](https://solana.com/docs/references/terminology#hash)
+
+A hash is a digital fingerprint of a sequence of bytes representing arbitrary data, while requiring far less storage space than the original data.
+
+## Hot account
+
+A Light Token account, Light Token mint, or Light-PDA that is active on-chain with a rent-exempt balance. Programs interact only with hot accounts. Clients call `create_load_instructions` to load cold accounts before use.
+
+## Indexer
+
+A service that tracks state changes of compressed accounts on the Solana ledger. The indexer exposes RPC APIs for querying compressed accounts and generating validity proofs.
+
+The ZK Compression indexer is named Photon and is maintained by Helius Labs.
+
+**Source**: https://github.com/helius-labs/photon
+
+## [Instruction](https://solana.com/docs/references/terminology#instruction)
+
+A call to invoke a specific [instruction handler](https://solana.com/docs/references/terminology#instruction-handler) in a [program](https://solana.com/docs/references/terminology#program).
+
+An instruction also specifies which accounts it wants to read or modify, and additional data that serves as auxiliary input to the [instruction handler](https://solana.com/docs/references/terminology#instruction-handler). A [client](https://solana.com/docs/references/terminology#client) must include at least one instruction in a [transaction](https://solana.com/docs/references/terminology#transaction), and all instructions must complete for the transaction to be considered successful.
+
+For example, compressed accounts are created or updated with the `InvokeCpiInstruction` to the Light System Program.
+
+## Leaf index
+
+The numerical position (u32) of a compressed account within a state tree, used for Merkle proof generation.
+
+## Ledger
+
+The ledger is an immutable historical record of all Solana transactions signed by clients since the genesis block.
+
+A helpful analogy to differentiate Solana ledger and state:
+
+- Ledger is the entire bank statement history.
+- State is the current account balance, derived from all transactions in the bank statement history.
+
+## Light-PDA
+
+A Solana PDA with sponsored rent-exemption. Programs create Light-PDAs using Anchor `#[account(init)]` with `#[light_account(init)]`. Compresses automatically after extended inactivity; clients load the account when it's accessed again. Program logic does not change for reads, updates, or closes. Only the init instruction and state struct require additions.
+
+> [Docs](/pda/light-pda/overview) | [Overview](/pda/overview) | [Example](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter)
+
+## Light System Program
+
+ZK Compression's core program that validates compressed account state transitions by verifying validity proofs and managing compressed state changes.
+
+The program enforces compressed account layout with ownership and sum checks, and is invoked to create and write to compressed accounts and PDAs.
+
+> **Program ID**: `SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7` | [Source](https://github.com/Lightprotocol/light-protocol/tree/main/programs/system)
+
+## Light Token
+
+A token standard that reduces the cost of mint and token accounts by 200x compared to SPL. Functionally equivalent to SPL but stores accounts more efficiently. The Light Token SDK API is a superset of the SPL-token API.
+
+Light Token accounts exist in two states: hot (active on-chain) and cold (compressed after inactivity). The Light Token Program sponsors rent-exemption for account creation.
+
+Different from ZK Compression, interactions with Light Token accounts do not require a validity proof for interactions.
+ZK Compression is used under the hood for inactive token accounts (cold state).
+
+> [Docs](/light-token/welcome) | [Example](https://github.com/Lightprotocol/examples-light-token)
+
+## Light Token account
+
+A Solana account that holds a token balance for a specific mint (SPL, Token 2022, or Light Token). The Light Token Program sponsors the rent-exemption cost. Follows the same layout as SPL token accounts. Compresses automatically after extended inactivity and can be loaded when accessed.
+
+> [Docs](/light-token/cookbook/create-token-account) | [Example](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-token-account)
+
+## Light Token associated token account
+
+An associated token account created by the Light Token Program. The address is deterministically derived from the owner's address, Light Token Program ID, and mint address. Holds token balances of SPL, Token 2022, or Light Token mints with sponsored rent-exemption.
+
+> [Docs](/light-token/cookbook/create-ata) | [Example](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-associated-token-account)
+
+## Light Token mint
+
+An on-chain mint account owned by the Light Token Program. Functionally equivalent to an SPL mint but with sponsored rent-exemption. Stores a compressed address in an address Merkle tree at creation to preserve mint state when the account compresses.
+
+> [Docs](/light-token/cookbook/create-mint) | [Example](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-mint) | [Source Code](https://github.com/Lightprotocol/light-protocol/blob/main/sdk-libs/token-sdk/src/instruction/create_mint.rs)
+
+## Light Token Program
+
+Light Protocol's SPL-compatible token program. The Light Token Program compresses and decompresses token accounts, sponsors rent-exemption, and enforces SPL token layout standards.
+
+> **Program ID**: `cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m` | [Source](https://github.com/Lightprotocol/light-protocol/tree/main/programs/compressed-token)
+
+## Load associated token account
+
+Loads token balances into a Light Token associated token account (hot balance). `loadAta` unifies balances from compressed tokens, SPL, and Token 2022 into a single Light Token associated token account. Returns `null` if there's nothing to load (idempotent). Creates the associated token account if it doesn't exist.
+
+> [Docs](/light-token/cookbook/load-ata) | [Source Code](https://github.com/Lightprotocol/light-protocol/blob/0c4e2417b2df2d564721b89e18d1aad3665120e7/js/compressed-token/src/v3/actions/load-ata.ts)
+
+## Lookup table
+
+A Solana [address lookup table](https://solana.com/docs/advanced/lookup-tables) that reduces transaction size by referencing accounts by index instead of full public key. Light Protocol provides pre-initialized lookup tables covering program IDs and protocol accounts.
+
+| Network | Address |
+|:--------|:--------|
+| Mainnet | `9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ` |
+| Devnet | `qAJZMgnQJ8G6vA3WRcjD9Jan1wtKkaCFWLWskxJrR5V` |
+
+## Merkle proof
+
+A cryptographic proof consisting of sibling node hashes required to verify that a specific leaf exists within a Merkle tree and calculate the root hash.
+
+ZK Compression encodes Merkle proofs into zero-knowledge proofs (validity proofs). These verify compressed account operations with a constant 128-byte size without exposing the underlying variable-size Merkle proof data.
+
+## Merkle tree
+
+A tree data structure to allow for cryptographic verification of the integrity of all leaves in a tree.
+
+Each leaf on a Merkle tree is a hash of that leaf's data. A Merkle tree compresses data by hashing pairs of data repeatedly into a single root hash, starting from the lowest level. Only this root hash is stored on chain. On Solana, this process is called state compression.
+
+## Merkle tree account
+
+The public key of the on-chain Merkle tree account used in ZK Compression. This identifier references the state tree that stores compressed account hashes.
+
+## Nullification
+
+The process of marking compressed accounts as spent to prevent double-spending.
+
+When compressed accounts are used as inputs in transactions, their previous states are invalidated by inserting their hashes into nullifier queues. Forester nodes process these queues to permanently update the corresponding Merkle tree leaves, ensuring each compressed account state can only be used once.
+
+## Nullifier
+
+A nullifier is a unique identifier used to prevent an event from being executed more than once. It acts as a one-way, irreversible proof that a specific resource (such as a payment, note, token, or vote) has already been consumed. To implement nullifiers we need a data structure that ensures every nullifier is only created once and never deleted. On Solana a straight forward way to implement nullifiers is to create a PDA account with the nullifier as seed.
+
+The documentation provides two implementations with rent-free PDA accounts:
+
+**Nullifier PDA** — For use cases such as sending payments, where you want to prevent your on-chain instruction from being executed more than once. The nullifier program utility creates a rent-free PDA derived from id. If the id has been used before, the PDA already exists, causing the instruction to fail.
+
+| | |
+|---|---|
+| **Program ID** | `NFLx5WGPrTHHvdRNsidcrNcLxRruMC92E4yv7zhZBoT` |
+| **Source code** | [github.com/Lightprotocol/nullifier-program](https://github.com/Lightprotocol/nullifier-program/) |
+| **Rust SDK** | [light-nullifier-program](https://crates.io/crates/light-nullifier-program) |
+| **TypeScript SDK** | [@lightprotocol/nullifier-program](https://www.npmjs.com/package/@lightprotocol/nullifier-program) |
+
+> [Docs](/pda/compressed-pdas/guides/how-to-create-nullifier-pdas) | [Skill](https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets) | [Example](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs)
+
+**ZK nullifier** — For ZK or privacy-preserving programs on Solana to prevent double-spending. Can be integrated with minimal code changes.
+
+> [Docs](/zk/overview) | [Skill](https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier) | [Example](https://github.com/Lightprotocol/program-examples/tree/main/zk/zk-nullifier)
+
+## Nullifier queue
+
+A queue where compressed accounts hashes used as input for transactions are temporarily stored to prevent double spending. A Forester node empties the queue by inserting queue elements into a state Merkle tree.
+
+## Output queue
+
+A queue in V2 state trees that buffers compressed account state changes before Forester nodes incorporate them into the state tree. Replaces the nullifier queue used in V1 state trees.
+
+Addresses are listed under the state tree entry.
+
+## Parallelism
+
+The ability of the SVM to execute multiple transactions simultaneously, as long as they modify different regular and/or compressed accounts.
+
+## Poseidon hash
+
+A cryptographic hash function optimized for zero-knowledge proof systems that works natively with finite field arithmetic.
+
+The Poseidon hash is designed to minimize computational complexity in ZK circuits. ZK Compression uses Poseidon hashes to generate the account hashes stored as leaves in state trees.
+
+## [Prioritization fee](https://solana.com/docs/references/terminology#prioritization-fee)
+
+An additional fee user can specify in the compute budget [instruction](https://solana.com/docs/references/terminology#instruction) to prioritize their [transactions](https://solana.com/docs/references/terminology#transaction).
+
+The priority fee is derived from the compute unit limit and the compute unit price. The price per compute unit set by the user in micro-lamports (1 lamport = 1,000,000 micro-lamports), rounded up to the nearest lamport.
+
+## [Program](https://solana.com/docs/references/terminology#onchain-program)
+
+Programs run executable code similar to smart contracts on other blockchains with optimizations specific to Solana.
+
+Solana programs key characteristics include:
+
+- Solana programs are stateless and do not store state internally. Separate accounts store state for programs to execute on, such as program, user or token data. This makes Solana's account model [different from Ethereum's](https://solana.com/news/evm-to-svm).
+- Programs are typically written in Rust.
+- Programs interpret the [instructions](https://solana.com/docs/references/terminology#instruction) sent inside of each [transaction](https://solana.com/docs/references/terminology#transaction) to read and modify accounts over which it has control, hence update state.
+
+## [Program derived addresses (PDA)](https://solana.com/docs/references/terminology#program-derived-account-pda)
+
+PDAs are special account addresses derived deterministically using optional seeds, a bump seed, and a program ID.
+
+They are off the Ed25519 curve, meaning they have no private key. The PDA itself, once derived, is 32 bytes, matching a regular public key.
+
+## Proof verification
+
+The on-chain process of validating zero-knowledge proofs to confirm the correctness of compressed account state transitions.
+
+## Registered Program PDA
+
+A PDA that grants a program access control to the Account Compression Program. Required as an account in transactions that modify compressed state.
+
+## Rent
+
+A fee paid in SOL for the creation of [Accounts](https://solana.com/docs/references/terminology#account) to store data on the blockchain, tied to account size. When accounts do not have enough balance to pay rent, they may be Garbage Collected.
+
+## [Rent exempt](https://solana.com/docs/references/terminology#rent-exempt)
+
+An account that maintains a minimum lamport balance proportional to the amount of data stored on the account.
+
+All newly created accounts are stored on chain permanently until the account is closed. It is not possible to create an account that falls below the rent exemption threshold.
+
+The rent exemption balance remains locked while an account is active and can be fully recovered when the account is closed.
+
+The minimum balance is paid by the creator and is calculated as follows:
+
+```markdown
+Minimum Rent Balance = 2 × 0.00000348 SOL/byte/year × Account Size (Bytes)
+```
+
+## Rent sponsorship
+
+
+
+
+
+
+
+## Remote Procedure Calls (RPC)
+
+A bridge between users (or applications) and the blockchain to facilitate interactions and data retrieval.
+
+The [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) extends [Solana's JSON RPC API](https://solana.com/docs/rpc) with additional endpoints to interact with compressed accounts, provided by Helius Labs.
+
+
+ Find more information on [ZK Compression's JSON RPC Methods
+ here](/api-reference/json-rpc-methods/overview).
+
+
+## [Smart contract](https://solana.com/docs/references/terminology#smart-contract)
+
+Smart contracts on Solana are called programs with key characteristics and optimizations.
+
+## Solana account model
+
+The native framework to store and manage data on the Solana blockchain.
+
+Solana's account model separates program logic from state to optimize for parallel and faster transactions. Separate accounts store state for programs to execute on, such as program, user or token data. This makes Solana's account model [different from Ethereum's](https://solana.com/news/evm-to-svm).
+
+ZK Compression extends Solana's account model with compressed accounts.
+
+## [Solana Program Library (SPL)](https://solana.com/docs/references/terminology#solana-program-library-spl)
+
+A [library of programs](https://spl.solana.com/) on Solana such as spl-token that facilitates tasks such as creating and using tokens.
+
+## SPL interface PDA
+
+A PDA owned by the Light Token Program's CPI authority that holds SPL tokens corresponding to compressed tokens and Light Token balances in circulation. Each SPL interface PDA is associated with a specific mint.
+
+> **Address**: `GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy`
+
+## State
+
+A snapshot representing the current status of all accounts and programs on Solana.
+
+The state is derived from the ledger by sequentially applying every transaction. State is mutable and changes with every transaction to represent the latest state.
+
+State is kept in RAM by validators for transaction validation.
+
+## State compression
+
+A process to lower the amount of data stored on chain using Merkle trees.
+
+The process of state compression involves the following steps:
+
+1. Millions of accounts are compressed into a 'fingerprint' - the Merkle tree root hash
+2. This 'fingerprint' is stored in one Solana account
+3. The account history is stored on the Solana ledger
+4. The latest compressed data is fetched from an indexer
+5. To verify the data, recompute the hashes and compare the final hash to the on chain root hash
+
+
+ Learn more [on generalized state compression
+ here](https://solana.com/developers/courses/state-compression/generalized-state-compression).
+
+
+## State root
+
+The root hash of a Merkle tree that serves as a cryptographic fingerprint representing all compressed accounts in the tree.
+
+State roots are stored on-chain and used by the Light System Program to verify validity proofs during compressed account operations. Each state root represents the complete state of compressed accounts at a specific point in time.
+
+## State tree
+
+A Merkle tree that stores compressed account hashes as leaf nodes.
+
+State trees organize compressed account data into a binary tree structure where each parent node is the hash of its two children nodes. The tree's root hash is stored on-chain as a cryptographic fingerprint representing all accounts in the tree.
+
+Two state tree versions with different proof mechanisms are currently supported:
+
+- **V1 state trees**: Always require the full 128-byte validity proof. With a depth of 26, a single V1 state tree stores approximately 67 million compressed accounts.
+- **V2 batched state trees**: Support `prove_by_index` optimization that verifies account existence with one byte instead of 128 bytes, optimizing compute unit consumption by up to 70%.
+
+| Instance | State Tree | Output Queue | CPI Context |
+|:---------|:-----------|:-------------|:------------|
+| V2 #1 | `bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU` | `oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto` | `cpi15BoVPKgEPw5o8wc2T816GE7b378nMXnhH3Xbq4y` |
+| V2 #2 | `bmt2UxoBxB9xWev4BkLvkGdapsz6sZGkzViPNph7VFi` | `oq2UkeMsJLfXt2QHzim242SUi3nvjJs8Pn7Eac9H9vg` | `cpi2yGapXUR3As5SjnHBAVvmApNiLsbeZpF3euWnW6B` |
+| V2 #3 | `bmt3ccLd4bqSVZVeCJnH1F6C8jNygAhaDfxDwePyyGb` | `oq3AxjekBWgo64gpauB6QtuZNesuv19xrhaC1ZM1THQ` | `cpi3mbwMpSX8FAGMZVP85AwxqCaQMfEk9Em1v8QK9Rf` |
+| V2 #4 | `bmt4d3p1a4YQgk9PeZv5s4DBUmbF5NxqYpk9HGjQsd8` | `oq4ypwvVGzCUMoiKKHWh4S1SgZJ9vCvKpcz6RT6A8dq` | `cpi4yyPDc4bCgHAnsenunGA8Y77j3XEDyjgfyCKgcoc` |
+| V2 #5 | `bmt5yU97jC88YXTuSukYHa8Z5Bi2ZDUtmzfkDTA2mG2` | `oq5oh5ZR3yGomuQgFduNDzjtGvVWfDRGLuDVjv9a96P` | `cpi5ZTjdgYpZ1Xr7B1cMLLUE81oTtJbNNAyKary2nV6` |
+| V1 | `smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho` | `nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X` | `cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK` |
+
+## Token account
+
+A token account is an account type in Solana's Token Programs that stores information about an individual's ownership of a specific token (mint). Each token account is associated with a single mint and tracks details like the token balance and owner.
+
+## [Token mint](https://solana.com/docs/references/terminology#token-mint)
+
+A [mint account](https://solana.com/docs/tokens/basics/create-mint) is an account type in Solana's Token Programs that can produce (or 'mint') tokens.
+
+Different tokens are distinguished by their unique token mint addresses. Token mints uniquely represent a token on the network and store global metadata about the token, including the `mint_authority`, supply, and decimals. SPL tokens can be compressed if the mint has an SPL interface PDA.
+
+## [Transaction](https://solana.com/docs/references/terminology#transaction)
+
+One or more [instructions](https://solana.com/docs/references/terminology#instruction) signed by a [client](https://solana.com/docs/references/terminology#client) using one or more [keypairs](https://solana.com/docs/references/terminology#keypair) and executed atomically with only two possible outcomes: success or failure.
+
+## Validity proof
+
+A zero-knowledge proof of compressed state included in a transaction to read or write compressed accounts.
+
+Developers don't need to generate _validity proofs_.
+
+The _validity proof_ is
+
+- constant 128 byte in size (other than Merkle proofs with varying proof size), fitting well in Solana's 1232 byte transaction limit
+- verified against the respective on chain fingerprint to ensure the provided data was previously emitted
+- provided and generated by indexers that support the [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) which extend Solana's [JSON RPC API](https://solana.com/docs/rpc) to interact with compressed accounts.
+
+## Wrap and Unwrap SPL, Token-2022, and Light Token Accounts
+
+**Wrap** moves tokens from an SPL or Token 2022 account into a Light Token associated token account. **Unwrap** moves tokens from a Light Token associated token account back to an SPL or Token 2022 account. Use wrap/unwrap to interact with applications that only support SPL or Token 2022.
+
+> [Docs](/light-token/cookbook/wrap-unwrap) | [Source Code](https://github.com/Lightprotocol/light-protocol/blob/0c4e2417b2df2d564721b89e18d1aad3665120e7/js/compressed-token/src/v3/actions/wrap.ts)
+
+## Zero-knowledge proof (ZKP)
+
+A cryptographic proof to verify the validity of a statement without revealing the underlying data.
+
+ZK Compression uses a Groth16 SNARK zk proof
+
+- for its constant _validity_ proof size, to ensures the integrity of many compressed accounts, not for private or confidential transactions, and
+- to store data in zk friendly data structures. Applications on Solana can prove custom off chain computations over zk compressed state (native zk compute).
+
+## ZK Compression
+
+A generalized compression framework to compress and verify arbitrary data with zero-knowledge proofs, to
+
+- enable the Compressed Account Model, the rent-free equivalent to Solana's Account Model,
+- solve Solana's state growth problem, and
+- build a foundation for native zk compute.
+
+The Light Token program uses ZK Compression under the hood for inactive token accounts (cold state).
+
+## ZK-SNARK
+
+Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge. A cryptographic proof system where a prover demonstrates knowledge of information without revealing the information itself.
+
+zk-SNARKs produce constant-size proofs that can be verified efficiently without interaction between prover and verifier. ZK Compression uses the Groth16 zk-SNARK construction to generate validity proofs for compressed account state transitions.
diff --git a/references/whitepaper.mdx b/resources/whitepaper.mdx
similarity index 100%
rename from references/whitepaper.mdx
rename to resources/whitepaper.mdx
diff --git a/scripts/copy-privy-snippets.sh b/scripts/copy-privy-snippets.sh
index 3c368c54..0e91d602 100755
--- a/scripts/copy-privy-snippets.sh
+++ b/scripts/copy-privy-snippets.sh
@@ -1,21 +1,22 @@
#!/bin/bash
-# Script to copy TypeScript code from Privy examples to docs/snippets/code-snippets/privy
-# Wraps each file in typescript markdown code blocks
+# Script to copy TypeScript code from Light Token Privy examples to docs snippets.
+# Source: examples-light-token/privy/{nodejs,react}
+# Output: snippets/code-snippets/privy/{operation}/{nodejs,react}.mdx
-NODEJS_SRC="/home/tilo/Workspace/examples-zk-compression/privy/nodejs-privy-compressed/src"
-REACT_SRC="/home/tilo/Workspace/examples-zk-compression/privy/react-privy-compressed/src/hooks"
-SNIPPETS_DIR="/home/tilo/Workspace/docs/snippets/code-snippets/privy"
+NODEJS_SRC="/home/tilo/Workspace/examples-light-token/privy/nodejs/src"
+REACT_SRC="/home/tilo/Workspace/examples-light-token/privy/react/src/hooks"
+SNIPPETS_DIR="/home/tilo/Workspace/docs-main-reorder/snippets/code-snippets/privy"
# Operations to process
-OPERATIONS=("transfer" "compress" "decompress" "balances" "transaction-history")
+OPERATIONS=("transfer" "wrap" "unwrap" "balances" "transaction-history")
-# Function to wrap TypeScript code in markdown
+# Wrap TypeScript code in markdown code block, stripping "// --- main ---" runner section
wrap_typescript() {
local input_file="$1"
local output_file="$2"
echo '```typescript' > "$output_file"
- cat "$input_file" >> "$output_file"
+ sed '/^\/\/ --- main ---$/,$d' "$input_file" >> "$output_file"
echo '```' >> "$output_file"
echo "Created: $output_file"
}
@@ -28,8 +29,8 @@ done
# Process Node.js operations
echo "Processing Node.js operations..."
wrap_typescript "$NODEJS_SRC/transfer.ts" "$SNIPPETS_DIR/transfer/nodejs.mdx"
-wrap_typescript "$NODEJS_SRC/compress.ts" "$SNIPPETS_DIR/compress/nodejs.mdx"
-wrap_typescript "$NODEJS_SRC/decompress.ts" "$SNIPPETS_DIR/decompress/nodejs.mdx"
+wrap_typescript "$NODEJS_SRC/wrap.ts" "$SNIPPETS_DIR/wrap/nodejs.mdx"
+wrap_typescript "$NODEJS_SRC/unwrap.ts" "$SNIPPETS_DIR/unwrap/nodejs.mdx"
wrap_typescript "$NODEJS_SRC/balances.ts" "$SNIPPETS_DIR/balances/nodejs.mdx"
wrap_typescript "$NODEJS_SRC/get-transaction-history.ts" "$SNIPPETS_DIR/transaction-history/nodejs.mdx"
@@ -37,11 +38,17 @@ wrap_typescript "$NODEJS_SRC/get-transaction-history.ts" "$SNIPPETS_DIR/transact
echo ""
echo "Processing React operations..."
wrap_typescript "$REACT_SRC/useTransfer.ts" "$SNIPPETS_DIR/transfer/react.mdx"
-wrap_typescript "$REACT_SRC/useCompress.ts" "$SNIPPETS_DIR/compress/react.mdx"
-wrap_typescript "$REACT_SRC/useDecompress.ts" "$SNIPPETS_DIR/decompress/react.mdx"
-wrap_typescript "$REACT_SRC/useCompressedBalances.ts" "$SNIPPETS_DIR/balances/react.mdx"
+wrap_typescript "$REACT_SRC/useWrap.ts" "$SNIPPETS_DIR/wrap/react.mdx"
+wrap_typescript "$REACT_SRC/useUnwrap.ts" "$SNIPPETS_DIR/unwrap/react.mdx"
+wrap_typescript "$REACT_SRC/useLightTokenBalances.ts" "$SNIPPETS_DIR/balances/react.mdx"
wrap_typescript "$REACT_SRC/useTransactionHistory.ts" "$SNIPPETS_DIR/transaction-history/react.mdx"
+# Copy shared React helper
+echo ""
+echo "Processing shared helpers..."
+mkdir -p "$SNIPPETS_DIR/helpers"
+wrap_typescript "$REACT_SRC/signAndSendBatches.ts" "$SNIPPETS_DIR/helpers/sign-and-send-batches.mdx"
+
echo ""
echo "Done! Created snippets in: $SNIPPETS_DIR"
echo ""
diff --git a/skill.md b/skill.md
index dd9bf23e..da7ae988 100644
--- a/skill.md
+++ b/skill.md
@@ -90,17 +90,16 @@ npx skills add https://zkcompression.com
| Use case | Skill |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
-| Build DeFi programs (AMMs, vaults, lending) with Anchor or Pinocchio | [defi-program](https://github.com/Lightprotocol/skills/tree/main/skills/defi-program) |
-| Integrate rent-free markets into routers and aggregators | [defi-router](https://github.com/Lightprotocol/skills/tree/main/skills/defi-router) |
+| Build rent-free Solana programs with Light SDK (Anchor or Pinocchio). Includes router integration. | [light-sdk](https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk) |
+| Use Light Token client SDKs (TypeScript and Rust) for mints, ATAs, transfers | [light-token-client](https://github.com/Lightprotocol/skills/tree/main/skills/light-token-client) |
| Stream account state via Laserstream gRPC | [data-streaming](https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming) |
| Wallets and payment flows with light-token. Includes privy, wallet adapter, mobile wallet adapter signing. Optional nullifier to prevent your onchain instruction from being executed more than once. | [payments-and-wallets](https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets) |
-| Airdrops, DePIN, token distribution | [airdrop](https://github.com/Lightprotocol/skills/tree/main/skills/airdrop) |
+| Airdrops, DePIN, token distribution | [token-distribution](https://github.com/Lightprotocol/skills/tree/main/skills/token-distribution) |
| Anti-double-spend nullifiers for Privacy-preserving ZK programs | [zk-nullifier](https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier) |
| Testing programs and clients on localnet, devnet, mainnet | [testing](https://github.com/Lightprotocol/skills/tree/main/skills/testing) |
+| For per-user state, DePIN nodes, and infrequently accessed app state with compressed PDAs | [solana-compression](https://github.com/Lightprotocol/skills/tree/main/skills/solana-compression) |
| Help with Debugging and Questions via DeepWiki MCP | [ask-mcp](https://github.com/Lightprotocol/skills/tree/main/skills/ask-mcp) |
-Skills for compressed PDAs and more are in development.
-
### Install to Claude Code
Add the marketplace and install:
@@ -110,7 +109,7 @@ Add the marketplace and install:
/plugin install solana-rent-free-dev
```
-All skills are included. Use them by name (`/defi-program`, `/airdrop`, `/testing`, etc.) or let Claude invoke them based on task context.
+All skills are included. Use them by name (`/light-sdk`, `/token-distribution`, `/testing`, etc.) or let Claude invoke them based on task context.
### Install to Cursor
diff --git a/snippets/ai-prompts/all-prompts.mdx b/snippets/ai-prompts/all-prompts.mdx
new file mode 100644
index 00000000..2d001e8b
--- /dev/null
+++ b/snippets/ai-prompts/all-prompts.mdx
@@ -0,0 +1,141 @@
+import LightTokenRecipes from "/snippets/ai-prompts/light-token-recipes.mdx";
+
+{/* anchor-programs */}
+import DefiAnchor from "/snippets/ai-prompts/anchor-programs/defi-anchor.mdx";
+import DefiPinocchio from "/snippets/ai-prompts/anchor-programs/defi-pinocchio.mdx";
+import LightPda from "/snippets/ai-prompts/anchor-programs/light-pda.mdx";
+
+{/* cpi-programs */}
+import CpiCreate from "/snippets/ai-prompts/cpi-programs/create.mdx";
+import CpiUpdate from "/snippets/ai-prompts/cpi-programs/update.mdx";
+import CpiClose from "/snippets/ai-prompts/cpi-programs/close.mdx";
+import CpiReinitialize from "/snippets/ai-prompts/cpi-programs/reinitialize.mdx";
+import CpiBurn from "/snippets/ai-prompts/cpi-programs/burn.mdx";
+import CpiClientGuide from "/snippets/ai-prompts/cpi-programs/client-guide.mdx";
+
+{/* defi - routers */}
+import Routers from "/snippets/ai-prompts/defi/routers.mdx";
+
+{/* streaming */}
+import StreamingMints from "/snippets/ai-prompts/streaming/mints.mdx";
+import StreamingTokens from "/snippets/ai-prompts/streaming/tokens.mdx";
+
+{/* toolkits */}
+import Payments from "/snippets/ai-prompts/toolkits/payments.mdx";
+import WalletsIntegration from "/snippets/ai-prompts/toolkits/wallets.mdx";
+import Nullifiers from "/snippets/ai-prompts/toolkits/nullifiers.mdx";
+import Airdrop from "/snippets/ai-prompts/toolkits/airdrop.mdx";
+
+{/* wallets */}
+import Privy from "/snippets/ai-prompts/wallets/privy.mdx";
+
+{/* migration */}
+import V1ToV2Migration from "/snippets/ai-prompts/v1-to-v2-migration.mdx";
+
+## Light Token Recipes
+
+
+
+## DeFi
+
+
+Copy the prompt below or view the [guide](/light-token/defi/programs).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/defi/programs-pinocchio).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/defi/routers).
+
+
+
+## Data Streaming
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-streaming-mints).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-streaming-tokens).
+
+
+
+## Stablecoin Payments
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-payments).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-create-nullifier-pdas).
+
+
+
+## Wallets
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-wallets).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-privy).
+
+
+
+## Light-PDA
+
+
+Copy the prompt below or view the [guide](/pda/light-pda/overview).
+
+
+
+## Compressed PDA
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/client-guide).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-create-compressed-accounts).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-update-compressed-accounts).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-close-compressed-accounts).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-reinitialize-compressed-accounts).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-burn-compressed-accounts).
+
+
+
+
+Copy the prompt below or view the [guide](/resources/migration-v1-to-v2).
+
+
+
+## Token Distribution
+
+
+Copy the prompt below or view the [guide](/compressed-tokens/airdrop).
+
+
diff --git a/snippets/ai-prompts/anchor-program-template.mdx b/snippets/ai-prompts/anchor-program-template.mdx
new file mode 100644
index 00000000..b4949b47
--- /dev/null
+++ b/snippets/ai-prompts/anchor-program-template.mdx
@@ -0,0 +1,57 @@
+```text
+---
+description: {{OPERATION_DESCRIPTION}}
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## {{OPERATION_DESCRIPTION}}
+
+Context:
+- Guide: https://zkcompression.com/{{PAGE_PATH}}
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: {{CRATES}}
+{{EXTRA_REFS}}
+
+Key macros/APIs: {{KEY_MACROS}}
+
+### 1. Index project
+- Grep `{{INDEX_GREP}}` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- AskUserQuestion: which account types need to be rent-free? (PDAs, token accounts, ATAs, mints)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: {{STEP_ORDER}}
+- Identify which existing structs need changes (CompressionInfo field, LightAccount derive, etc.)
+- 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 `cargo add {{DEPS}}`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `{{BUILD_CMD}}`
+- Bash `{{TEST_CMD}}` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/anchor-programs/defi-anchor.mdx b/snippets/ai-prompts/anchor-programs/defi-anchor.mdx
new file mode 100644
index 00000000..b115a81a
--- /dev/null
+++ b/snippets/ai-prompts/anchor-programs/defi-anchor.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Add rent-free accounts to an Anchor DeFi program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free accounts to an Anchor DeFi program
+
+Context:
+- Guide: https://zkcompression.com/light-token/defi/programs
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk
+- Crates: light-sdk (features: anchor, v2, cpi-context), light-sdk-macros, light-token (features: anchor), light-anchor-spl
+- AMM reference: https://github.com/Lightprotocol/cp-swap-reference
+
+Key macros/APIs: #[light_program], LightAccount, LightAccounts, #[light_account(init)], CompressionInfo
+
+### 1. Index project
+- Grep \`#\[program\]|anchor_lang|Account<|Accounts|InitSpace|seeds|init|payer\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- AskUserQuestion: which account types need to be rent-free? (PDAs, token accounts, ATAs, mints)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → State Struct → Program Module → Accounts Struct → Instructions
+- Identify which existing structs need changes (CompressionInfo field, LightAccount derive, etc.)
+- 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 \`cargo add light-sdk@0.19 --features anchor,v2,cpi-context\` and \`cargo add light-sdk-macros@0.19\` and \`cargo add light-token@0.4 --features anchor\` and \`cargo add light-anchor-spl@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add rent-free accounts to an Anchor DeFi program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free accounts to an Anchor DeFi program
+
+Context:
+- Guide: https://zkcompression.com/light-token/defi/programs
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk
+- Crates: light-sdk (features: anchor, v2, cpi-context), light-sdk-macros, light-token (features: anchor), light-anchor-spl
+- AMM reference: https://github.com/Lightprotocol/cp-swap-reference
+
+Key macros/APIs: #[light_program], LightAccount, LightAccounts, #[light_account(init)], CompressionInfo
+
+### 1. Index project
+- Grep `#\[program\]|anchor_lang|Account<|Accounts|InitSpace|seeds|init|payer` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- AskUserQuestion: which account types need to be rent-free? (PDAs, token accounts, ATAs, mints)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → State Struct → Program Module → Accounts Struct → Instructions
+- Identify which existing structs need changes (CompressionInfo field, LightAccount derive, etc.)
+- 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 `cargo add light-sdk@0.19 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.19` and `cargo add light-token@0.4 --features anchor` and `cargo add light-anchor-spl@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/anchor-programs/defi-pinocchio.mdx b/snippets/ai-prompts/anchor-programs/defi-pinocchio.mdx
new file mode 100644
index 00000000..b558f6fb
--- /dev/null
+++ b/snippets/ai-prompts/anchor-programs/defi-pinocchio.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Add rent-free accounts to a Pinocchio DeFi program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free accounts to a Pinocchio DeFi program
+
+Context:
+- Guide: https://zkcompression.com/light-token/defi/programs-pinocchio
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk
+- Crates: light-account-pinocchio (features: token, std), light-token-pinocchio, pinocchio
+- Swap reference: https://github.com/Lightprotocol/examples-light-token/tree/simplify-trait/pinocchio/swap
+
+Key macros/APIs: LightPinocchioAccount, LightProgramPinocchio, CreateTokenAccountCpi, derive_light_cpi_signer!
+
+### 1. Index project
+- Grep \`pinocchio|entrypoint!|ProgramError|AccountInfo|process_instruction\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- AskUserQuestion: which account types need to be rent-free? (PDAs, token accounts, ATAs, mints)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → State Struct → Program Enum → Entrypoint → Init Handler
+- Identify which existing structs need changes (CompressionInfo field, LightPinocchioAccount derive, etc.)
+- 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 \`cargo add light-account-pinocchio@0.20 --features token,std\` and \`cargo add light-token-pinocchio@0.20\` and \`cargo add pinocchio@0.9\`
+- 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\`
+- Bash \`cargo test-sbf\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add rent-free accounts to a Pinocchio DeFi program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free accounts to a Pinocchio DeFi program
+
+Context:
+- Guide: https://zkcompression.com/light-token/defi/programs-pinocchio
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk
+- Crates: light-account-pinocchio (features: token, std), light-token-pinocchio, pinocchio
+- Swap reference: https://github.com/Lightprotocol/examples-light-token/tree/simplify-trait/pinocchio/swap
+
+Key macros/APIs: LightPinocchioAccount, LightProgramPinocchio, CreateTokenAccountCpi, derive_light_cpi_signer!
+
+### 1. Index project
+- Grep `pinocchio|entrypoint!|ProgramError|AccountInfo|process_instruction` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- AskUserQuestion: which account types need to be rent-free? (PDAs, token accounts, ATAs, mints)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → State Struct → Program Enum → Entrypoint → Init Handler
+- Identify which existing structs need changes (CompressionInfo field, LightPinocchioAccount derive, etc.)
+- 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 `cargo add light-account-pinocchio@0.20 --features token,std` and `cargo add light-token-pinocchio@0.20` and `cargo add pinocchio@0.9`
+- 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`
+- Bash `cargo test-sbf` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/anchor-programs/light-pda.mdx b/snippets/ai-prompts/anchor-programs/light-pda.mdx
new file mode 100644
index 00000000..45e528d3
--- /dev/null
+++ b/snippets/ai-prompts/anchor-programs/light-pda.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add rent-free PDAs to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free PDAs to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/pda/light-pda/overview
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-account (features: anchor), light-sdk (features: anchor, v2, cpi-context)
+- Counter example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter
+
+Key macros/APIs: #[light_program], LightAccount, LightAccounts, #[light_account(init)], CompressionInfo, CreateAccountsProof
+
+### 1. Index project
+- Grep \`#\[program\]|anchor_lang|Account<|Accounts|InitSpace|seeds|init|payer\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → State Struct → Program Module → Accounts Struct
+- Identify which existing structs need changes (CompressionInfo field, LightAccount derive, etc.)
+- 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 \`cargo add light-account@0.20 --features anchor\` and \`cargo add light-sdk@0.20 --features anchor,v2,cpi-context\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add rent-free PDAs to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free PDAs to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/pda/light-pda/overview
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-account (features: anchor), light-sdk (features: anchor, v2, cpi-context)
+- Counter example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter
+
+Key macros/APIs: #[light_program], LightAccount, LightAccounts, #[light_account(init)], CompressionInfo, CreateAccountsProof
+
+### 1. Index project
+- Grep `#\[program\]|anchor_lang|Account<|Accounts|InitSpace|seeds|init|payer` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, PDA seeds, token accounts, init instructions
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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, migrate existing program to rent-free, add rent-free accounts to specific instructions)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → State Struct → Program Module → Accounts Struct
+- Identify which existing structs need changes (CompressionInfo field, LightAccount derive, etc.)
+- 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 `cargo add light-account@0.20 --features anchor` and `cargo add light-sdk@0.20 --features anchor,v2,cpi-context`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-program-template.mdx b/snippets/ai-prompts/cpi-program-template.mdx
new file mode 100644
index 00000000..f9cf32cc
--- /dev/null
+++ b/snippets/ai-prompts/cpi-program-template.mdx
@@ -0,0 +1,57 @@
+```text
+---
+description: {{OPERATION_DESCRIPTION}}
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## {{OPERATION_DESCRIPTION}}
+
+Context:
+- Guide: https://zkcompression.com/pda/compressed-pdas/guides/{{PAGE_SLUG}}
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-sdk (LightAccount, CpiAccounts, LightSystemProgramCpi, derive_light_cpi_signer!)
+{{EXTRA_REFS}}
+
+Key SDK API: {{KEY_API}}
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo{{EXTRA_GREP}}` 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 {{OP_SHORT}} 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 → {{OP_SPECIFIC_STEPS}} → 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.16` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-programs/burn.mdx b/snippets/ai-prompts/cpi-programs/burn.mdx
new file mode 100644
index 00000000..2ff0e795
--- /dev/null
+++ b/snippets/ai-prompts/cpi-programs/burn.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Build a program that permanently burns compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/burn
+
+Key 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.16\` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Build a program that permanently burns compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/burn
+
+Key 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.16` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-programs/client-guide.mdx b/snippets/ai-prompts/cpi-programs/client-guide.mdx
new file mode 100644
index 00000000..efd49d33
--- /dev/null
+++ b/snippets/ai-prompts/cpi-programs/client-guide.mdx
@@ -0,0 +1,127 @@
+
+{`---
+description: Write client code to interact with compressed PDA programs
+allowed-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 programs
+
+Context:
+- Guide: https://zkcompression.com/pda/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/anchor
+
+Key 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.16 light-sdk@0.16\`
+- 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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Write client code to interact with compressed PDA programs
+allowed-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 programs
+
+Context:
+- Guide: https://zkcompression.com/pda/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/anchor
+
+Key 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.16 light-sdk@0.16`
+- 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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-programs/close.mdx b/snippets/ai-prompts/cpi-programs/close.mdx
new file mode 100644
index 00000000..e7833fac
--- /dev/null
+++ b/snippets/ai-prompts/cpi-programs/close.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Build a program that closes compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/close
+
+Key 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.16\` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Build a program that closes compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/close
+
+Key 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.16` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-programs/create.mdx b/snippets/ai-prompts/cpi-programs/create.mdx
new file mode 100644
index 00000000..1dfb4799
--- /dev/null
+++ b/snippets/ai-prompts/cpi-programs/create.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Build a program that creates compressed accounts with addresses
+allowed-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 addresses
+
+Context:
+- Guide: https://zkcompression.com/pda/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/create
+
+Key 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.16\` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Build a program that creates compressed accounts with addresses
+allowed-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 addresses
+
+Context:
+- Guide: https://zkcompression.com/pda/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/create
+
+Key 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.16` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-programs/reinitialize.mdx b/snippets/ai-prompts/cpi-programs/reinitialize.mdx
new file mode 100644
index 00000000..0f608254
--- /dev/null
+++ b/snippets/ai-prompts/cpi-programs/reinitialize.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Build a program that reinitializes closed compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/reinit
+
+Key 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.16\` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Build a program that reinitializes closed compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/reinit
+
+Key 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.16` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/cpi-programs/update.mdx b/snippets/ai-prompts/cpi-programs/update.mdx
new file mode 100644
index 00000000..cbf94761
--- /dev/null
+++ b/snippets/ai-prompts/cpi-programs/update.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Build a program that updates compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/update
+
+Key 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.16\` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Build a program that updates compressed accounts
+allowed-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 accounts
+
+Context:
+- Guide: https://zkcompression.com/pda/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/update
+
+Key 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.16` (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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/defi/routers.mdx b/snippets/ai-prompts/defi/routers.mdx
new file mode 100644
index 00000000..88896ace
--- /dev/null
+++ b/snippets/ai-prompts/defi/routers.mdx
@@ -0,0 +1,125 @@
+
+{`---
+description: Integrate rent-free AMM markets into a router or aggregator
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Integrate rent-free AMM markets into a router or aggregator
+
+Context:
+- Guide: https://zkcompression.com/light-token/defi/routers
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk
+- Crate: light-client (features: v2) — provides AccountInterface, LightProgramInterface, create_load_instructions
+- AMM reference: https://github.com/Lightprotocol/cp-swap-reference
+- Streaming guides: https://zkcompression.com/light-token/toolkits/for-streaming-tokens
+
+Key APIs: create_load_instructions(), LightProgramInterface trait, get_account_interface(), get_multiple_account_interfaces(), is_cold()
+
+### 1. Index project
+- Grep \`LightProgramInterface|create_load_instructions|AccountInterface|is_cold|get_account_interface|swap|amm|router|aggregator\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing routing/quoting logic, account caching, swap instruction building, streaming setup
+- Read Cargo.toml — note existing dependencies and light-client version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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? (add cold market support to existing router, build new router with rent-free market support, integrate a specific AMM SDK)
+- AskUserQuestion: does the project already stream account updates, or does it fetch at swap time?
+- AskUserQuestion: does the project use Jito bundles for multi-transaction swaps?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's progression: Cold Account Cache → Detecting Cold Accounts → Building Swap Transactions with Load Instructions
+- If streaming: add account + transaction subscriptions for the Light Token Program
+- If fetch-at-swap-time: add get_multiple_account_interfaces + is_cold() check before building swap tx
+- 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 \`cargo add light-client@0.19 --features v2\`
+- Add AMM SDK dependency per the approved plan
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Integrate rent-free AMM markets into a router or aggregator
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Integrate rent-free AMM markets into a router or aggregator
+
+Context:
+- Guide: https://zkcompression.com/light-token/defi/routers
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/light-sdk
+- Crate: light-client (features: v2) — provides AccountInterface, LightProgramInterface, create_load_instructions
+- AMM reference: https://github.com/Lightprotocol/cp-swap-reference
+- Streaming guides: https://zkcompression.com/light-token/toolkits/for-streaming-tokens
+
+Key APIs: create_load_instructions(), LightProgramInterface trait, get_account_interface(), get_multiple_account_interfaces(), is_cold()
+
+### 1. Index project
+- Grep `LightProgramInterface|create_load_instructions|AccountInterface|is_cold|get_account_interface|swap|amm|router|aggregator` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing routing/quoting logic, account caching, swap instruction building, streaming setup
+- Read Cargo.toml — note existing dependencies and light-client version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above
+- 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? (add cold market support to existing router, build new router with rent-free market support, integrate a specific AMM SDK)
+- AskUserQuestion: does the project already stream account updates, or does it fetch at swap time?
+- AskUserQuestion: does the project use Jito bundles for multi-transaction swaps?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's progression: Cold Account Cache → Detecting Cold Accounts → Building Swap Transactions with Load Instructions
+- If streaming: add account + transaction subscriptions for the Light Token Program
+- If fetch-at-swap-time: add get_multiple_account_interfaces + is_cold() check before building swap tx
+- 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 `cargo add light-client@0.19 --features v2`
+- Add AMM SDK dependency per the approved plan
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/light-token-prompts.mdx b/snippets/ai-prompts/light-token-prompts.mdx
new file mode 100644
index 00000000..97a837d0
--- /dev/null
+++ b/snippets/ai-prompts/light-token-prompts.mdx
@@ -0,0 +1,77 @@
+import LightTokenRecipes from "/snippets/ai-prompts/light-token-recipes.mdx";
+
+{/* anchor-programs */}
+import DefiAnchor from "/snippets/ai-prompts/anchor-programs/defi-anchor.mdx";
+import DefiPinocchio from "/snippets/ai-prompts/anchor-programs/defi-pinocchio.mdx";
+
+{/* defi - routers */}
+import Routers from "/snippets/ai-prompts/defi/routers.mdx";
+
+{/* streaming */}
+import StreamingMints from "/snippets/ai-prompts/streaming/mints.mdx";
+import StreamingTokens from "/snippets/ai-prompts/streaming/tokens.mdx";
+
+{/* toolkits */}
+import Payments from "/snippets/ai-prompts/toolkits/payments.mdx";
+import WalletsIntegration from "/snippets/ai-prompts/toolkits/wallets.mdx";
+import Nullifiers from "/snippets/ai-prompts/toolkits/nullifiers.mdx";
+
+{/* wallets */}
+import Privy from "/snippets/ai-prompts/wallets/privy.mdx";
+
+## Light Token Recipes
+
+
+
+## DeFi
+
+
+Copy the prompt below or view the [guide](/light-token/defi/programs).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/defi/programs-pinocchio).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/defi/routers).
+
+
+
+## Data Streaming
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-streaming-mints).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-streaming-tokens).
+
+
+
+## Stablecoin Payments
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-payments).
+
+
+
+
+Copy the prompt below or view the [guide](/pda/compressed-pdas/guides/how-to-create-nullifier-pdas).
+
+
+
+## Wallets
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-wallets).
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/toolkits/for-privy).
+
+
diff --git a/snippets/ai-prompts/light-token-recipes.mdx b/snippets/ai-prompts/light-token-recipes.mdx
new file mode 100644
index 00000000..affa361b
--- /dev/null
+++ b/snippets/ai-prompts/light-token-recipes.mdx
@@ -0,0 +1,191 @@
+{/* ts-cookbook */}
+import TsCreateMint from "/snippets/ai-prompts/ts-cookbook/create-mint.mdx";
+import TsCreateAta from "/snippets/ai-prompts/ts-cookbook/create-ata.mdx";
+import TsMintTo from "/snippets/ai-prompts/ts-cookbook/mint-to.mdx";
+import TsTransferInterface from "/snippets/ai-prompts/ts-cookbook/transfer-interface.mdx";
+import TsApproveRevoke from "/snippets/ai-prompts/ts-cookbook/approve-revoke.mdx";
+import TsWrapUnwrap from "/snippets/ai-prompts/ts-cookbook/wrap-unwrap.mdx";
+
+{/* rust-cookbook */}
+import RustCreateMint from "/snippets/ai-prompts/rust-cookbook/create-mint.mdx";
+import RustCreateAta from "/snippets/ai-prompts/rust-cookbook/create-ata.mdx";
+import RustCreateTokenAccount from "/snippets/ai-prompts/rust-cookbook/create-token-account.mdx";
+import RustMintTo from "/snippets/ai-prompts/rust-cookbook/mint-to.mdx";
+import RustTransferInterface from "/snippets/ai-prompts/rust-cookbook/transfer-interface.mdx";
+import RustTransferChecked from "/snippets/ai-prompts/rust-cookbook/transfer-checked.mdx";
+import RustApproveRevoke from "/snippets/ai-prompts/rust-cookbook/approve-revoke.mdx";
+import RustFreezeThaw from "/snippets/ai-prompts/rust-cookbook/freeze-thaw.mdx";
+import RustWrapUnwrap from "/snippets/ai-prompts/rust-cookbook/wrap-unwrap.mdx";
+import RustCloseTokenAccount from "/snippets/ai-prompts/rust-cookbook/close-token-account.mdx";
+import RustBurn from "/snippets/ai-prompts/rust-cookbook/burn.mdx";
+
+{/* program-cookbook */}
+import ProgCreateMintCpi from "/snippets/ai-prompts/program-cookbook/create-mint-cpi.mdx";
+import ProgCreateMintMacros from "/snippets/ai-prompts/program-cookbook/create-mint-macros.mdx";
+import ProgCreateAtaCpi from "/snippets/ai-prompts/program-cookbook/create-ata-cpi.mdx";
+import ProgCreateAtaMacros from "/snippets/ai-prompts/program-cookbook/create-ata-macros.mdx";
+import ProgCreateTokenAccountCpi from "/snippets/ai-prompts/program-cookbook/create-token-account-cpi.mdx";
+import ProgCreateTokenAccountMacros from "/snippets/ai-prompts/program-cookbook/create-token-account-macros.mdx";
+import ProgMintTo from "/snippets/ai-prompts/program-cookbook/mint-to.mdx";
+import ProgTransferInterface from "/snippets/ai-prompts/program-cookbook/transfer-interface.mdx";
+import ProgTransferChecked from "/snippets/ai-prompts/program-cookbook/transfer-checked.mdx";
+import ProgApproveRevoke from "/snippets/ai-prompts/program-cookbook/approve-revoke.mdx";
+import ProgFreezeThaw from "/snippets/ai-prompts/program-cookbook/freeze-thaw.mdx";
+import ProgCloseTokenAccount from "/snippets/ai-prompts/program-cookbook/close-token-account.mdx";
+import ProgBurn from "/snippets/ai-prompts/program-cookbook/burn.mdx";
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/create-mint).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/create-ata).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/create-token-account).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/mint-to).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/transfer-interface).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/transfer-checked).
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/approve-revoke).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/freeze-thaw).
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/wrap-unwrap).
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/close-token-account).
+
+
+
+
+
+
+
+
+
+
+
+Copy the prompt below or view the [guide](/light-token/cookbook/burn).
+
+
+
+
+
+
+
+
+
diff --git a/snippets/ai-prompts/privy-nodejs-compressed.mdx b/snippets/ai-prompts/privy-nodejs-compressed.mdx
deleted file mode 100644
index 4f8df269..00000000
--- a/snippets/ai-prompts/privy-nodejs-compressed.mdx
+++ /dev/null
@@ -1,77 +0,0 @@
-~~~~text
----
-argument-hint:
-description: Add compressed token support to Privy Node.js app
-allowed-tools: [Bash, Read, Glob, Grep, Task, mcp__deepwiki, mcp__zkcompression]
----
-
-## Task: Add compressed token support to Privy Node.js app
-
-References:
-- Privy Docs: https://docs.privy.io/recipes/solana/send-spl-tokens
-- Privy Node Examples:
- - SPL: https://github.com/privy-io/examples/tree/main/privy-node-starter
- - Compressed: https://github.com/Lightprotocol/examples-zk-compression/tree/main/privy/nodejs-privy-compressed
-- SPL vs Compressed comparison: https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/COMPARISON.md
-- Compressed Token Guide for Privy Node.js: https://zkcompression.com/compressed-tokens/for-privy
-
-MCP:
-* deepwiki https://mcp.deepwiki.com/mcp
-* ZK Compression https://www.zkcompression.com/mcp
-
-## Workflow
-
-- This plan must execute without user intervention
-- All questions have been resolved in planning phase
-- If blocked, find alternative approach - do not stop
-- Keep working until ALL todos are complete
-- Use Task tool with subagents for parallel research or when stuck
-- Use subagents with Read, Glob, Grep, and Deepwiki permissions when stuck
-- Always assign Tasks to subagents and tell the user
-
-## DeepWiki fallback
-
-```
-mcp__deepwiki__read_wiki_structure("Lightprotocol/light-protocol"),
-mcp__deepwiki__read_wiki_contents("Lightprotocol/light-protocol"),
-mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "")
-```
-
-## Quick Reference
-
-| Operation | SPL | Compressed |
-| -------------- | ------------------------------ | ---------------------------------------------- |
-| Transfer | transferChecked() | transfer() |
-| Compress SPL to recipient | N/A | compress() |
-| Decompress to SPL | N/A | decompress() |
-| Get Balance | getAccount() | getCompressedTokenAccountsByOwner() |
-| Tx History | getSignaturesForAddress() | getCompressionSignaturesForOwner() |
-
-### Phase 1: Index project
-
-```bash
-grep -r "createTransferInstruction\|getAssociatedTokenAddress\|@solana/spl-token" src/
-```
-
-### Phase 2: Add dependencies
-
-```bash
-npm install @lightprotocol/stateless.js @lightprotocol/compressed-token
-```
-
-### Phase 3: Implement operations
-
-See Code Reference below all signed with Privy SDK.
-
-1. **Setup**: Connect to ZK Compression RPC (Helius, Triton) https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/nodejs-privy-compressed/src/index.ts
-2. **Get Balance**: Fetch SPL and compressed token balances https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/nodejs-privy-compressed/src/compressed/balances.ts
-3. **Transfer**: Send compressed tokens to another recipient, signed with Privy SDK https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/nodejs-privy-compressed/src/compressed/transfer.ts
-4. **Compress**: Convert SPL to compressed tokens and send to a recipient in one instruction https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/nodejs-privy-compressed/src/compressed/compress.ts
-5. **Decompress**: Convert compressed tokens back to SPL tokens for offramps https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/nodejs-privy-compressed/src/compressed/decompress.ts
-6. **Tx History**: Fetch compressed token transaction history for an owner
-
-### Phase 4: Test
-
-Run the implemented functions. On failure, debug and retry. Assign always to subagents with Tasktool
-
-~~~~
\ No newline at end of file
diff --git a/snippets/ai-prompts/privy-react-compressed.mdx b/snippets/ai-prompts/privy-react-compressed.mdx
deleted file mode 100644
index fc34cec7..00000000
--- a/snippets/ai-prompts/privy-react-compressed.mdx
+++ /dev/null
@@ -1,77 +0,0 @@
-~~~~text
----
-argument-hint:
-description: Add compressed token support to Privy React app
-allowed-tools: [Bash, Read, Glob, Grep, Task, mcp__deepwiki, mcp__zkcompression]
----
-
-## Task: Add compressed token support to Privy React app
-
-References:
-- Privy Docs: https://docs.privy.io/recipes/solana/send-spl-tokens
-- Privy React Examples:
- - SPL: https://github.com/privy-io/examples/tree/main/privy-react-starter
- - Compressed: https://github.com/Lightprotocol/examples-zk-compression/tree/main/privy/react-privy-compressed
-- SPL vs Compressed comparison: https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/COMPARISON.md
-- Compressed Token Guide for Privy React: https://zkcompression.com/compressed-tokens/for-privy
-
-MCP:
-* deepwiki https://mcp.deepwiki.com/mcp
-* ZK Compression https://www.zkcompression.com/mcp
-
-## Workflow
-
-- This plan must execute without user intervention
-- All questions have been resolved in planning phase
-- If blocked, find alternative approach - do not stop
-- Keep working until ALL todos are complete
-- Use Task tool with subagents for parallel research or when stuck
-- Use subagents with Read, Glob, Grep, and Deepwiki permissions when stuck
-- Always assign Tasks to subagents and tell the user
-
-## DeepWiki fallback
-
-```
-mcp__deepwiki__read_wiki_structure("Lightprotocol/light-protocol"),
-mcp__deepwiki__read_wiki_contents("Lightprotocol/light-protocol"),
-mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "")
-```
-
-## Quick Reference
-
-| Operation | SPL | Compressed |
-| -------------- | ------------------------------ | ---------------------------------------------- |
-| Transfer | transferChecked() | transfer() |
-| Compress SPL to recipient | N/A | compress() |
-| Decompress to SPL | N/A | decompress() |
-| Get Balance | getAccount() | getCompressedTokenAccountsByOwner() |
-| Tx History | getSignaturesForAddress() | getCompressionSignaturesForOwner() |
-
-### Phase 1: Index project
-
-```bash
-grep -r "createTransferInstruction\|getAssociatedTokenAddress\|@solana/spl-token" src/
-```
-
-### Phase 2: Add dependencies
-
-```bash
-npm install @lightprotocol/stateless.js @lightprotocol/compressed-token
-```
-
-### Phase 3: Implement operations
-
-See Code Reference below all signed with Privy SDK.
-
-1. **Setup**: Connect to ZK Compression RPC (Helius, Triton) https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/react-privy-compressed/src/config/rpc.ts
-2. **Get Balance**: Fetch SPL and compressed token balances https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/react-privy-compressed/src/hooks/useCompressedBalances.ts
-3. **Transfer**: Send compressed tokens to another recipient, signed with Privy SDK https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/react-privy-compressed/src/hooks/useTransfer.ts
-4. **Compress**: Convert SPL to compressed tokens and send to a recipient in one instruction https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/react-privy-compressed/src/hooks/useCompress.ts
-5. **Decompress**: Convert compressed tokens back to SPL tokens for offramps https://github.com/Lightprotocol/examples-zk-compression/blob/main/privy/react-privy-compressed/src/hooks/useDecompress.ts
-6. **Tx History**: Fetch compressed token transaction history for an owner
-
-### Phase 4: Test
-
-Run the implemented functions. On failure, debug and retry. Assign always to subagents with Tasktool
-
-~~~~
diff --git a/snippets/ai-prompts/program-cookbook/approve-revoke.mdx b/snippets/ai-prompts/program-cookbook/approve-revoke.mdx
new file mode 100644
index 00000000..d9b6f668
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/approve-revoke.mdx
@@ -0,0 +1,115 @@
+
+{`---
+description: Add approve and revoke CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add approve and revoke CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/approve-revoke
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (ApproveCpi, RevokeCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/approve
+
+Key CPI structs: \`light_token::instruction::ApproveCpi\`, \`light_token::instruction::RevokeCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|approve|revoke|delegate\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, delegate accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review both Approve and Revoke CPI 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? (add approve/revoke to existing program, new program from scratch, migrate from SPL approve/revoke)
+- AskUserQuestion: should the owner be an external signer or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: do you need both approve and revoke, or just 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: Build ApproveCpi/RevokeCpi structs → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add approve and revoke CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add approve and revoke CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/approve-revoke
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (ApproveCpi, RevokeCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/approve
+
+Key CPI structs: `light_token::instruction::ApproveCpi`, `light_token::instruction::RevokeCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|approve|revoke|delegate` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, delegate accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review both Approve and Revoke CPI 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? (add approve/revoke to existing program, new program from scratch, migrate from SPL approve/revoke)
+- AskUserQuestion: should the owner be an external signer or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: do you need both approve and revoke, or just 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: Build ApproveCpi/RevokeCpi structs → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/burn.mdx b/snippets/ai-prompts/program-cookbook/burn.mdx
new file mode 100644
index 00000000..83277207
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/burn.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add burn CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add burn CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/burn
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (BurnCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/burn
+
+Key CPI struct: \`light_token::instruction::BurnCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|burn|destroy|supply\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add burn to existing program, new program from scratch, migrate from SPL burn)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build BurnCpi struct → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add burn CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add burn CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/burn
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (BurnCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/burn
+
+Key CPI struct: `light_token::instruction::BurnCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|burn|destroy|supply` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add burn to existing program, new program from scratch, migrate from SPL burn)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build BurnCpi struct → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/close-token-account.mdx b/snippets/ai-prompts/program-cookbook/close-token-account.mdx
new file mode 100644
index 00000000..fe54be99
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/close-token-account.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add close-account CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add close-account CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/close-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CloseAccountCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/close
+
+Key CPI struct: \`light_token::instruction::CloseAccountCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|close|destination|rent\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add close-account to existing program, new program from scratch, migrate from SPL close_account)
+- AskUserQuestion: should the owner be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build CloseAccountCpi struct → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add close-account CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add close-account CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/close-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CloseAccountCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/close
+
+Key CPI struct: `light_token::instruction::CloseAccountCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|close|destination|rent` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add close-account to existing program, new program from scratch, migrate from SPL close_account)
+- AskUserQuestion: should the owner be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build CloseAccountCpi struct → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/create-ata-cpi.mdx b/snippets/ai-prompts/program-cookbook/create-ata-cpi.mdx
new file mode 100644
index 00000000..17df7a8e
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/create-ata-cpi.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add create-ATA CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add create-ATA CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CreateAssociatedAccountCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-associated-token-account
+
+Key CPI struct: \`light_token::instruction::CreateAssociatedAccountCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|ata|associated|owner|mint\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, ATA derivation
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the CPI tab under Program: ATA creation with .rent_free() chain
+- 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? (add create-ATA to existing program, new program from scratch, migrate from SPL create_associated_token_account)
+- AskUserQuestion: should the payer be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build CreateAssociatedAccountCpi → .rent_free() → .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add create-ATA CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add create-ATA CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CreateAssociatedAccountCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-associated-token-account
+
+Key CPI struct: `light_token::instruction::CreateAssociatedAccountCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|ata|associated|owner|mint` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, ATA derivation
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the CPI tab under Program: ATA creation with .rent_free() chain
+- 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? (add create-ATA to existing program, new program from scratch, migrate from SPL create_associated_token_account)
+- AskUserQuestion: should the payer be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build CreateAssociatedAccountCpi → .rent_free() → .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/create-ata-macros.mdx b/snippets/ai-prompts/program-cookbook/create-ata-macros.mdx
new file mode 100644
index 00000000..397584fd
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/create-ata-macros.mdx
@@ -0,0 +1,111 @@
+
+{`---
+description: Create a rent-free ATA with Anchor macros
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create a rent-free ATA with Anchor macros
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-sdk, light-sdk-macros, light-compressible, anchor-lang
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-associated-token-account
+
+Key macros: \`#[light_program]\`, \`LightAccounts\`, \`#[light_account(init, associated_token::...)]\`
+
+### 1. Index project
+- Grep \`#\[program\]|anchor_lang|Account<|Accounts|seeds|init|payer|ata|associated\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing program module, account structs, ATA patterns
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Anchor Macros tab under Program
+- 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 rent-free ATA to existing program, migrate from SPL create_associated_token_account)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → Program Module (#[light_program]) → Accounts Struct (#[light_account(init, associated_token::...)])
+- 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 \`cargo add light-sdk@0.18 --features anchor,v2,cpi-context\` and \`cargo add light-sdk-macros@0.18 light-compressible@0.1 anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create a rent-free ATA with Anchor macros
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create a rent-free ATA with Anchor macros
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-sdk, light-sdk-macros, light-compressible, anchor-lang
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-associated-token-account
+
+Key macros: `#[light_program]`, `LightAccounts`, `#[light_account(init, associated_token::...)]`
+
+### 1. Index project
+- Grep `#\[program\]|anchor_lang|Account<|Accounts|seeds|init|payer|ata|associated` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, ATA patterns
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Anchor Macros tab under Program
+- 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 rent-free ATA to existing program, migrate from SPL create_associated_token_account)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → Program Module (#[light_program]) → Accounts Struct (#[light_account(init, associated_token::...)])
+- 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 `cargo add light-sdk@0.18 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.18 light-compressible@0.1 anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/create-mint-cpi.mdx b/snippets/ai-prompts/program-cookbook/create-mint-cpi.mdx
new file mode 100644
index 00000000..1ebefe3e
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/create-mint-cpi.mdx
@@ -0,0 +1,115 @@
+
+{`---
+description: Add create-mint CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add create-mint CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CreateMintCpi, CreateMintParams, SystemAccountInfos)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-mint
+
+Key CPI struct: \`light_token::instruction::CreateMintCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|mint|decimals|authority|metadata\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, mint seeds
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the CPI tab under Program: token metadata config, mint params, system accounts, invoke patterns
+- 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? (add create-mint to existing program, new program from scratch, migrate from SPL create_mint)
+- AskUserQuestion: should the mint seed be an external keypair or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: do you need token metadata (name, symbol, uri)?
+- 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: Configure Token Metadata → Configure Mint Params → System Accounts → Build CPI and invoke
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add create-mint CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add create-mint CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CreateMintCpi, CreateMintParams, SystemAccountInfos)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-mint
+
+Key CPI struct: `light_token::instruction::CreateMintCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|mint|decimals|authority|metadata` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, mint seeds
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the CPI tab under Program: token metadata config, mint params, system accounts, invoke patterns
+- 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? (add create-mint to existing program, new program from scratch, migrate from SPL create_mint)
+- AskUserQuestion: should the mint seed be an external keypair or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: do you need token metadata (name, symbol, uri)?
+- 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: Configure Token Metadata → Configure Mint Params → System Accounts → Build CPI and invoke
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/create-mint-macros.mdx b/snippets/ai-prompts/program-cookbook/create-mint-macros.mdx
new file mode 100644
index 00000000..f871b97d
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/create-mint-macros.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Create a rent-free mint with Anchor macros
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create a rent-free mint with Anchor macros
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-sdk, light-sdk-macros, light-compressible, anchor-lang
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-mint
+
+Key macros: \`#[light_program]\`, \`LightAccounts\`, \`#[light_account(init, mint::...)]\`
+
+### 1. Index project
+- Grep \`#\[program\]|anchor_lang|Account<|Accounts|seeds|init|payer|mint\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing program module, account structs, mint patterns, PDA seeds
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Anchor Macros tab under Program
+- 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 rent-free mint to existing program, migrate from SPL create_mint)
+- AskUserQuestion: do you need token metadata (name, symbol, uri)?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → Program Module (#[light_program]) → Accounts Struct (#[light_account(init, mint::...)])
+- 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 \`cargo add light-sdk@0.18 --features anchor,v2,cpi-context\` and \`cargo add light-sdk-macros@0.18 light-compressible@0.1 anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create a rent-free mint with Anchor macros
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create a rent-free mint with Anchor macros
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-sdk, light-sdk-macros, light-compressible, anchor-lang
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-mint
+
+Key macros: `#[light_program]`, `LightAccounts`, `#[light_account(init, mint::...)]`
+
+### 1. Index project
+- Grep `#\[program\]|anchor_lang|Account<|Accounts|seeds|init|payer|mint` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, mint patterns, PDA seeds
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Anchor Macros tab under Program
+- 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 rent-free mint to existing program, migrate from SPL create_mint)
+- AskUserQuestion: do you need token metadata (name, symbol, uri)?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → Program Module (#[light_program]) → Accounts Struct (#[light_account(init, mint::...)])
+- 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 `cargo add light-sdk@0.18 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.18 light-compressible@0.1 anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/create-token-account-cpi.mdx b/snippets/ai-prompts/program-cookbook/create-token-account-cpi.mdx
new file mode 100644
index 00000000..f64adde1
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/create-token-account-cpi.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add create-token-account CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add create-token-account CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CreateTokenAccountCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-token-account
+
+Key CPI struct: \`light_token::instruction::CreateTokenAccountCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|token_account|vault|owner|mint\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, vault/token account patterns
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the CPI tab under Program: token account creation with .rent_free() chain
+- 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? (add create-token-account to existing program, new program from scratch, migrate from SPL token account init)
+- AskUserQuestion: should the payer be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build CreateTokenAccountCpi → .rent_free() → .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add create-token-account CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add create-token-account CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (CreateTokenAccountCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/create-token-account
+
+Key CPI struct: `light_token::instruction::CreateTokenAccountCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|token_account|vault|owner|mint` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, vault/token account patterns
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the CPI tab under Program: token account creation with .rent_free() chain
+- 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? (add create-token-account to existing program, new program from scratch, migrate from SPL token account init)
+- AskUserQuestion: should the payer be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build CreateTokenAccountCpi → .rent_free() → .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/create-token-account-macros.mdx b/snippets/ai-prompts/program-cookbook/create-token-account-macros.mdx
new file mode 100644
index 00000000..bbf57fa6
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/create-token-account-macros.mdx
@@ -0,0 +1,111 @@
+
+{`---
+description: Create a rent-free token account with Anchor macros
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create a rent-free token account with Anchor macros
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-sdk, light-sdk-macros, light-compressible, anchor-lang
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-token-account
+
+Key macros: \`#[light_program]\`, \`LightAccounts\`, \`#[light_account(init, token::...)]\`
+
+### 1. Index project
+- Grep \`#\[program\]|anchor_lang|Account<|Accounts|seeds|init|payer|vault|token_account\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing program module, account structs, vault/token account patterns
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Anchor Macros tab under Program
+- 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 rent-free token account to existing program, migrate from SPL token account init)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → Program Module (#[light_program]) → Accounts Struct (#[light_account(init, token::...)])
+- 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 \`cargo add light-sdk@0.18 --features anchor,v2,cpi-context\` and \`cargo add light-sdk-macros@0.18 light-compressible@0.1 anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create a rent-free token account with Anchor macros
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create a rent-free token account with Anchor macros
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-sdk, light-sdk-macros, light-compressible, anchor-lang
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-token-account
+
+Key macros: `#[light_program]`, `LightAccounts`, `#[light_account(init, token::...)]`
+
+### 1. Index project
+- Grep `#\[program\]|anchor_lang|Account<|Accounts|seeds|init|payer|vault|token_account` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing program module, account structs, vault/token account patterns
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Anchor Macros tab under Program
+- 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 rent-free token account to existing program, migrate from SPL token account init)
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Dependencies → Program Module (#[light_program]) → Accounts Struct (#[light_account(init, token::...)])
+- 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 `cargo add light-sdk@0.18 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.18 light-compressible@0.1 anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/freeze-thaw.mdx b/snippets/ai-prompts/program-cookbook/freeze-thaw.mdx
new file mode 100644
index 00000000..3aed6dc3
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/freeze-thaw.mdx
@@ -0,0 +1,115 @@
+
+{`---
+description: Add freeze and thaw CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add freeze and thaw CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/freeze-thaw
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (FreezeCpi, ThawCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/freeze
+
+Key CPI structs: \`light_token::instruction::FreezeCpi\`, \`light_token::instruction::ThawCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|freeze|thaw|authority\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, freeze authority
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review both Freeze and Thaw CPI 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? (add freeze/thaw to existing program, new program from scratch, migrate from SPL freeze/thaw)
+- AskUserQuestion: should the freeze authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: do you need both freeze and thaw, or just 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: Build FreezeCpi/ThawCpi structs → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add freeze and thaw CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add freeze and thaw CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/freeze-thaw
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (FreezeCpi, ThawCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/freeze
+
+Key CPI structs: `light_token::instruction::FreezeCpi`, `light_token::instruction::ThawCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|freeze|thaw|authority` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, freeze authority
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review both Freeze and Thaw CPI 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? (add freeze/thaw to existing program, new program from scratch, migrate from SPL freeze/thaw)
+- AskUserQuestion: should the freeze authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: do you need both freeze and thaw, or just 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: Build FreezeCpi/ThawCpi structs → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/mint-to.mdx b/snippets/ai-prompts/program-cookbook/mint-to.mdx
new file mode 100644
index 00000000..71091488
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/mint-to.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add mint-to CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add mint-to CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/mint-to
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (MintToCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/mint-to
+
+Key CPI struct: \`light_token::instruction::MintToCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|mint|supply|amount\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, mint accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add mint-to to existing program, new program from scratch, migrate from SPL mint_to)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build MintToCpi struct → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add mint-to CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add mint-to CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/mint-to
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (MintToCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/mint-to
+
+Key CPI struct: `light_token::instruction::MintToCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|mint|supply|amount` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, mint accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add mint-to to existing program, new program from scratch, migrate from SPL mint_to)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build MintToCpi struct → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/transfer-checked.mdx b/snippets/ai-prompts/program-cookbook/transfer-checked.mdx
new file mode 100644
index 00000000..abc63102
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/transfer-checked.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Add transfer-checked CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add transfer-checked CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-checked
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (TransferCheckedCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/transfer-checked
+
+Key CPI struct: \`light_token::instruction::TransferCheckedCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|transfer|decimals|amount\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add transfer-checked to existing program, new program from scratch, migrate from SPL transfer_checked)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build TransferCheckedCpi struct → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add transfer-checked CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add transfer-checked CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-checked
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (TransferCheckedCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/transfer-checked
+
+Key CPI struct: `light_token::instruction::TransferCheckedCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|transfer|decimals|amount` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add transfer-checked to existing program, new program from scratch, migrate from SPL transfer_checked)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- 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: Build TransferCheckedCpi struct → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/program-cookbook/transfer-interface.mdx b/snippets/ai-prompts/program-cookbook/transfer-interface.mdx
new file mode 100644
index 00000000..d286834e
--- /dev/null
+++ b/snippets/ai-prompts/program-cookbook/transfer-interface.mdx
@@ -0,0 +1,115 @@
+
+{`---
+description: Add transfer-interface CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add transfer-interface CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-interface
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (TransferInterfaceCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/transfer-interface
+
+Key CPI struct: \`light_token::instruction::TransferInterfaceCpi\`
+
+### 1. Index project
+- Grep \`declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|transfer|decimals|interface\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add transfer-interface to existing program, new program from scratch, migrate from SPL transfer)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: which token types will be transferred? (SPL, Token 2022, Light Token, or all via interface)
+- 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: Build TransferInterfaceCpi → call .invoke() or .invoke_signed()
+- 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 \`cargo add light-token anchor-lang@0.31\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`anchor build\`
+- Bash \`anchor test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add transfer-interface CPI to an Anchor program
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add transfer-interface CPI to an Anchor program
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-interface
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crate: light-token (TransferInterfaceCpi)
+- Example: https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-instructions/transfer-interface
+
+Key CPI struct: `light_token::instruction::TransferInterfaceCpi`
+
+### 1. Index project
+- Grep `declare_id|#\[program\]|anchor_lang|Account<|Pubkey|invoke|transfer|decimals|interface` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: program ID, existing instructions, account structs, token accounts
+- Read Cargo.toml — note existing dependencies and framework version
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — review the Program tab CPI 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? (add transfer-interface to existing program, new program from scratch, migrate from SPL transfer)
+- AskUserQuestion: should the authority be an external signer or a PDA? (determines invoke vs invoke_signed)
+- AskUserQuestion: which token types will be transferred? (SPL, Token 2022, Light Token, or all via interface)
+- 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: Build TransferInterfaceCpi → call .invoke() or .invoke_signed()
+- 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 `cargo add light-token anchor-lang@0.31`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `anchor build`
+- Bash `anchor test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/approve-revoke.mdx b/snippets/ai-prompts/rust-cookbook/approve-revoke.mdx
new file mode 100644
index 00000000..7319e751
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/approve-revoke.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Approve and revoke token delegates
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Approve and revoke token delegates
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/approve-revoke
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::approve / revoke → Light Token: Approve / Revoke
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|Approve|Revoke|delegate\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for delegation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have delegation operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Approve and revoke token delegates
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Approve and revoke token delegates
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/approve-revoke
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::approve / revoke → Light Token: Approve / Revoke
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|Approve|Revoke|delegate` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for delegation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have delegation operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/burn.mdx b/snippets/ai-prompts/rust-cookbook/burn.mdx
new file mode 100644
index 00000000..03c0f144
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/burn.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Burn Light Tokens
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Burn Light Tokens
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/burn
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::burn → Light Token: Burn
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|Burn|burn\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for burn
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have burn operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Burn Light Tokens
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Burn Light Tokens
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/burn
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::burn → Light Token: Burn
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|Burn|burn` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for burn
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have burn operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/close-token-account.mdx b/snippets/ai-prompts/rust-cookbook/close-token-account.mdx
new file mode 100644
index 00000000..a899432f
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/close-token-account.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Close Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Close Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/close-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::close_account → Light Token: CloseAccount
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|CloseAccount|close_account\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for close account
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have close operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Close Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Close Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/close-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::close_account → Light Token: CloseAccount
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|CloseAccount|close_account` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for close account
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have close operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/create-ata.mdx b/snippets/ai-prompts/rust-cookbook/create-ata.mdx
new file mode 100644
index 00000000..3e54dc85
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/create-ata.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Create rent-free associated token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create rent-free associated token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_associated_token_account::create → Light Token: CreateAta
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|CreateAta|create_associated_token_account\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for ATA creation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have ATA operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create rent-free associated token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create rent-free associated token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_associated_token_account::create → Light Token: CreateAta
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|CreateAta|create_associated_token_account` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for ATA creation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have ATA operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/create-mint.mdx b/snippets/ai-prompts/rust-cookbook/create-mint.mdx
new file mode 100644
index 00000000..0c833942
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/create-mint.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Create rent-free mint with token metadata
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create rent-free mint with token metadata
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::initialize_mint → Light Token: CreateMint
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|CreateMint|initialize_mint\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for mint creation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create rent-free mint with token metadata
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create rent-free mint with token metadata
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::initialize_mint → Light Token: CreateMint
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|CreateMint|initialize_mint` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for mint creation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/create-token-account.mdx b/snippets/ai-prompts/rust-cookbook/create-token-account.mdx
new file mode 100644
index 00000000..a05f6e2a
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/create-token-account.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Create Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::initialize_account → Light Token: CreateTokenAccount
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|CreateTokenAccount|initialize_account\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for token account creation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have token account operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-token-account
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::initialize_account → Light Token: CreateTokenAccount
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|CreateTokenAccount|initialize_account` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for token account creation
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have token account operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/freeze-thaw.mdx b/snippets/ai-prompts/rust-cookbook/freeze-thaw.mdx
new file mode 100644
index 00000000..16a0ccf9
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/freeze-thaw.mdx
@@ -0,0 +1,121 @@
+
+{`---
+description: Freeze and thaw Light Token accounts
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Freeze and thaw Light Token accounts
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/freeze-thaw
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+- Freeze: prevents all transfers or token burns from a specific Light Token account
+- Thaw: re-enables transfers on a frozen Light Token account
+- Only the freeze authority (set at mint creation) can freeze or thaw accounts
+
+SPL equivalent: spl_token::instruction::freeze_account / thaw_account → Light Token: Freeze / Thaw
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|Freeze|Thaw|freeze_account|thaw_account\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for freeze/thaw
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have freeze/thaw operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Freeze and thaw Light Token accounts
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Freeze and thaw Light Token accounts
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/freeze-thaw
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+- Freeze: prevents all transfers or token burns from a specific Light Token account
+- Thaw: re-enables transfers on a frozen Light Token account
+- Only the freeze authority (set at mint creation) can freeze or thaw accounts
+
+SPL equivalent: spl_token::instruction::freeze_account / thaw_account → Light Token: Freeze / Thaw
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|Freeze|Thaw|freeze_account|thaw_account` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for freeze/thaw
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have freeze/thaw operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/mint-to.mdx b/snippets/ai-prompts/rust-cookbook/mint-to.mdx
new file mode 100644
index 00000000..31c235fa
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/mint-to.mdx
@@ -0,0 +1,113 @@
+
+{`---
+description: Mint tokens to Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Mint tokens to Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/mint-to
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::mint_to → Light Token: MintTo
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|MintTo|mint_to\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for minting
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Mint tokens to Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Mint tokens to Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/mint-to
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+SPL equivalent: spl_token::instruction::mint_to → Light Token: MintTo
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|MintTo|mint_to` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for minting
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/transfer-checked.mdx b/snippets/ai-prompts/rust-cookbook/transfer-checked.mdx
new file mode 100644
index 00000000..b7b4b4f6
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/transfer-checked.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Transfer tokens with decimal validation
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Transfer tokens with decimal validation
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-checked
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+TransferChecked validates that the decimals parameter matches the mint's decimals. Use for Light→Light transfers when you need decimal verification. For transfers involving SPL or Token 2022 accounts, use TransferInterface instead.
+
+SPL equivalent: spl_token::instruction::transfer_checked → Light Token: TransferChecked
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|TransferChecked|transfer_checked\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for transfer checked
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have transfer operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Transfer tokens with decimal validation
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Transfer tokens with decimal validation
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-checked
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+TransferChecked validates that the decimals parameter matches the mint's decimals. Use for Light→Light transfers when you need decimal verification. For transfers involving SPL or Token 2022 accounts, use TransferInterface instead.
+
+SPL equivalent: spl_token::instruction::transfer_checked → Light Token: TransferChecked
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|TransferChecked|transfer_checked` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for transfer checked
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have transfer operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/transfer-interface.mdx b/snippets/ai-prompts/rust-cookbook/transfer-interface.mdx
new file mode 100644
index 00000000..2158bcff
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/transfer-interface.mdx
@@ -0,0 +1,123 @@
+
+{`---
+description: Transfer tokens between Light Token and SPL accounts
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Transfer tokens between Light Token and SPL accounts
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-interface
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+TransferInterface transfers tokens between token accounts (SPL, Token 2022, or Light Token) in a single call.
+- Light Token → Light Token: transfers between Light Token accounts
+- SPL → Light Token: locks SPL tokens in interface PDA, mints to Light Token account
+- Light Token → SPL: burns Light Token balance, releases SPL tokens from interface PDA
+
+SPL equivalent: spl_token::instruction::transfer → Light Token: TransferInterface
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|TransferInterface|transfer\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for transfers
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have transfer operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Transfer tokens between Light Token and SPL accounts
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Transfer tokens between Light Token and SPL accounts
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-interface
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+TransferInterface transfers tokens between token accounts (SPL, Token 2022, or Light Token) in a single call.
+- Light Token → Light Token: transfers between Light Token accounts
+- SPL → Light Token: locks SPL tokens in interface PDA, mints to Light Token account
+- Light Token → SPL: burns Light Token balance, releases SPL tokens from interface PDA
+
+SPL equivalent: spl_token::instruction::transfer → Light Token: TransferInterface
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|TransferInterface|transfer` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for transfers
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have transfer operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-cookbook/wrap-unwrap.mdx b/snippets/ai-prompts/rust-cookbook/wrap-unwrap.mdx
new file mode 100644
index 00000000..a9291718
--- /dev/null
+++ b/snippets/ai-prompts/rust-cookbook/wrap-unwrap.mdx
@@ -0,0 +1,119 @@
+
+{`---
+description: Wrap and unwrap SPL tokens to Light Token
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Wrap and unwrap SPL tokens to Light Token
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/wrap-unwrap
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+- Wrap: move tokens from SPL or Token 2022 account → Light Token ATA (hot balance)
+- Unwrap: move tokens from Light Token ATA (hot balance) → SPL or Token 2022 account
+
+No direct SPL equivalent — Wrap/Unwrap are Light Token operations → Light Token: Wrap / Unwrap
+
+### 1. Index project
+- Grep \`light_token::|light_token_client::|solana_sdk|Keypair|async|Wrap|Unwrap|wrap|unwrap\` across src/
+- Glob \`**/*.rs\` for project structure
+- Identify: RPC setup, existing token ops, entry point for wrap/unwrap
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have wrap/unwrap operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 \`cargo add light-token-client light-token light-client --features light-client/v2\`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Wrap and unwrap SPL tokens to Light Token
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Wrap and unwrap SPL tokens to Light Token
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/wrap-unwrap
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+
+- Wrap: move tokens from SPL or Token 2022 account → Light Token ATA (hot balance)
+- Unwrap: move tokens from Light Token ATA (hot balance) → SPL or Token 2022 account
+
+No direct SPL equivalent — Wrap/Unwrap are Light Token operations → Light Token: Wrap / Unwrap
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async|Wrap|Unwrap|wrap|unwrap` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for wrap/unwrap
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have wrap/unwrap operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/rust-template.mdx b/snippets/ai-prompts/rust-template.mdx
new file mode 100644
index 00000000..ed5021d5
--- /dev/null
+++ b/snippets/ai-prompts/rust-template.mdx
@@ -0,0 +1,57 @@
+```text
+---
+description: {{OPERATION_DESCRIPTION}}
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## {{OPERATION_DESCRIPTION}}
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/{{PAGE_SLUG}}
+- Skills and resources index: https://zkcompression.com/skill.md
+- Crates: light-token-client (actions), light-token (instructions), light-client (RPC)
+{{EXTRA_REFS}}
+
+SPL equivalent: {{SPL_FUNCTION}} → Light Token: {{LIGHT_FUNCTION}}
+
+### 1. Index project
+- Grep `light_token::|light_token_client::|solana_sdk|Keypair|async{{EXTRA_GREP}}` across src/
+- Glob `**/*.rs` for project structure
+- Identify: RPC setup, existing token ops, entry point for {{OP_SHORT}}
+- Check Cargo.toml for existing light-* 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 — follow the Rust Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have token operations to extend, or is this greenfield?
+- AskUserQuestion: action-level API (high-level, fewer lines) or instruction-level API (low-level, full control)?
+- 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
+- Verify existing Rpc/signer setup is compatible with the cookbook prerequisites (light_client::rpc::Rpc, solana_sdk::signature::Keypair)
+- 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 `cargo add light-token-client light-token light-client --features light-client/v2`
+- Follow the cookbook guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/streaming/mints.mdx b/snippets/ai-prompts/streaming/mints.mdx
new file mode 100644
index 00000000..a7632a15
--- /dev/null
+++ b/snippets/ai-prompts/streaming/mints.mdx
@@ -0,0 +1,117 @@
+
+{`---
+description: Stream light-mint accounts and metadata via Laserstream gRPC
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Stream light-mint accounts and metadata via Laserstream gRPC
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-streaming-mints
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming
+- Crates: helius-laserstream, light-token-interface, borsh, futures
+- Token accounts streaming: https://zkcompression.com/light-token/toolkits/for-streaming-tokens
+
+Key APIs: LaserstreamConfig, subscribe(), Mint::deserialize(), ExtensionStruct::TokenMetadata
+
+### 1. Index project
+- Grep \`helius_laserstream|laserstream|subscribe|StreamExt|light_token_interface|Mint|cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing gRPC streaming setup, account caching, deserialization logic
+- Read Cargo.toml — note existing dependencies
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the Steps (Connect, Subscribe, Deserialize, Detect cold, Extract metadata)
+- 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 streaming pipeline for mints, add mint streaming to existing token streaming, specific use case like metadata indexing)
+- AskUserQuestion: mainnet or devnet?
+- AskUserQuestion: do you need cold/hot transition detection, or just live mint state?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Connect → Subscribe (account + transaction subs) → Deserialize Mint → Detect Cold → Extract Metadata
+- 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 \`cargo add helius-laserstream@0.1 light-token-interface@0.3 borsh@0.10 futures@0.3 bs58@0.5 tokio --features full\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Stream light-mint accounts and metadata via Laserstream gRPC
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Stream light-mint accounts and metadata via Laserstream gRPC
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-streaming-mints
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming
+- Crates: helius-laserstream, light-token-interface, borsh, futures
+- Token accounts streaming: https://zkcompression.com/light-token/toolkits/for-streaming-tokens
+
+Key APIs: LaserstreamConfig, subscribe(), Mint::deserialize(), ExtensionStruct::TokenMetadata
+
+### 1. Index project
+- Grep `helius_laserstream|laserstream|subscribe|StreamExt|light_token_interface|Mint|cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing gRPC streaming setup, account caching, deserialization logic
+- Read Cargo.toml — note existing dependencies
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the Steps (Connect, Subscribe, Deserialize, Detect cold, Extract metadata)
+- 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 streaming pipeline for mints, add mint streaming to existing token streaming, specific use case like metadata indexing)
+- AskUserQuestion: mainnet or devnet?
+- AskUserQuestion: do you need cold/hot transition detection, or just live mint state?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's step order: Connect → Subscribe (account + transaction subs) → Deserialize Mint → Detect Cold → Extract Metadata
+- 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 `cargo add helius-laserstream@0.1 light-token-interface@0.3 borsh@0.10 futures@0.3 bs58@0.5 tokio --features full`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/streaming/tokens.mdx b/snippets/ai-prompts/streaming/tokens.mdx
new file mode 100644
index 00000000..d3744a5c
--- /dev/null
+++ b/snippets/ai-prompts/streaming/tokens.mdx
@@ -0,0 +1,123 @@
+
+{`---
+description: Stream light-token accounts via Laserstream gRPC
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Stream light-token accounts via Laserstream gRPC
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-streaming-tokens
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming
+- Crates: helius-laserstream, light-token-interface, spl-pod, spl-token-2022-interface, borsh, futures
+- Mint accounts streaming: https://zkcompression.com/light-token/toolkits/for-streaming-mints
+- Point queries: light-client (LightClient, get_account_interface)
+
+Key APIs: LaserstreamConfig, subscribe(), PodAccount (pod_from_bytes), LightClient::get_account_interface()
+
+### 1. Index project
+- Grep \`helius_laserstream|laserstream|subscribe|PodAccount|pod_from_bytes|spl_token_2022_interface|cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m\` across src/
+- Glob \`**/*.rs\` and \`**/Cargo.toml\` for project structure
+- Identify: existing gRPC streaming setup, token account caching, SPL parser usage
+- Read Cargo.toml — note existing dependencies
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the Steps (Connect, Subscribe) and the transition detection sections
+- 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 streaming pipeline for token accounts, add to existing pipeline, integrate cold/hot detection for routing)
+- AskUserQuestion: mainnet or devnet?
+- AskUserQuestion: do you need point queries (get_account_interface) in addition to streaming?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's structure: Connect → Subscribe (account + transaction subs) → Detect Transitions (hot-to-cold, cold-to-hot) → Point Queries (optional)
+- Token accounts use the same 165-byte SPL layout — existing SPL parsers work directly
+- 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 \`cargo add helius-laserstream@0.1 light-token-interface@0.3 spl-pod spl-token-2022-interface borsh@0.10 futures@0.3 bs58@0.5 tokio --features full\`
+- For point queries, also: Bash \`cargo add light-client@0.19 --features v2\`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash \`cargo check\`
+- Bash \`cargo test\` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Stream light-token accounts via Laserstream gRPC
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Stream light-token accounts via Laserstream gRPC
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-streaming-tokens
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming
+- Crates: helius-laserstream, light-token-interface, spl-pod, spl-token-2022-interface, borsh, futures
+- Mint accounts streaming: https://zkcompression.com/light-token/toolkits/for-streaming-mints
+- Point queries: light-client (LightClient, get_account_interface)
+
+Key APIs: LaserstreamConfig, subscribe(), PodAccount (pod_from_bytes), LightClient::get_account_interface()
+
+### 1. Index project
+- Grep `helius_laserstream|laserstream|subscribe|PodAccount|pod_from_bytes|spl_token_2022_interface|cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m` across src/
+- Glob `**/*.rs` and `**/Cargo.toml` for project structure
+- Identify: existing gRPC streaming setup, token account caching, SPL parser usage
+- Read Cargo.toml — note existing dependencies
+- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the Steps (Connect, Subscribe) and the transition detection sections
+- 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 streaming pipeline for token accounts, add to existing pipeline, integrate cold/hot detection for routing)
+- AskUserQuestion: mainnet or devnet?
+- AskUserQuestion: do you need point queries (get_account_interface) in addition to streaming?
+- Summarize findings and wait for user confirmation before implementing
+
+### 4. Create plan
+- Based on steps 1–3, draft an implementation plan
+- Follow the guide's structure: Connect → Subscribe (account + transaction subs) → Detect Transitions (hot-to-cold, cold-to-hot) → Point Queries (optional)
+- Token accounts use the same 165-byte SPL layout — existing SPL parsers work directly
+- 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 `cargo add helius-laserstream@0.1 light-token-interface@0.3 spl-pod spl-token-2022-interface borsh@0.10 futures@0.3 bs58@0.5 tokio --features full`
+- For point queries, also: Bash `cargo add light-client@0.19 --features v2`
+- Follow the guide and the approved plan
+- Write/Edit to create or modify files
+- TaskUpdate to mark each step done
+
+### 6. Verify
+- Bash `cargo check`
+- Bash `cargo test` if tests exist
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/template.mdx b/snippets/ai-prompts/template.mdx
new file mode 100644
index 00000000..786f9661
--- /dev/null
+++ b/snippets/ai-prompts/template.mdx
@@ -0,0 +1,55 @@
+```text
+---
+description: {{OPERATION_DESCRIPTION}}
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## {{OPERATION_DESCRIPTION}}
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/{{PAGE_SLUG}}
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+{{EXTRA_REFS}}
+
+SPL equivalent: {{SPL_FUNCTION}} → Light Token: {{LIGHT_FUNCTION}}
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing token ops, entry point for {{OP_SHORT}}
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have token operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/toolkits/airdrop.mdx b/snippets/ai-prompts/toolkits/airdrop.mdx
new file mode 100644
index 00000000..cfa93282
--- /dev/null
+++ b/snippets/ai-prompts/toolkits/airdrop.mdx
@@ -0,0 +1,127 @@
+
+{`---
+description: Distribute compressed tokens via airdrop
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Distribute compressed tokens via airdrop
+
+Context:
+- Guide: https://zkcompression.com/compressed-tokens/airdrop
+- 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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Distribute compressed tokens via airdrop
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Distribute compressed tokens via airdrop
+
+Context:
+- Guide: https://zkcompression.com/compressed-tokens/airdrop
+- 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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/toolkits/nullifiers.mdx b/snippets/ai-prompts/toolkits/nullifiers.mdx
new file mode 100644
index 00000000..6c7eabae
--- /dev/null
+++ b/snippets/ai-prompts/toolkits/nullifiers.mdx
@@ -0,0 +1,129 @@
+
+{`---
+description: Create rent-free nullifier PDAs to prevent duplicate actions
+allowed-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 actions
+
+Context:
+- Guide: https://zkcompression.com/pda/compressed-pdas/guides/how-to-create-nullifier-pdas
+- 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.19\`
+- For TypeScript: Bash \`npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@beta\`
+- 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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create rent-free nullifier PDAs to prevent duplicate actions
+allowed-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 actions
+
+Context:
+- Guide: https://zkcompression.com/pda/compressed-pdas/guides/how-to-create-nullifier-pdas
+- 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.19`
+- For TypeScript: Bash `npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@beta`
+- 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("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/toolkits/payments.mdx b/snippets/ai-prompts/toolkits/payments.mdx
new file mode 100644
index 00000000..9b729f04
--- /dev/null
+++ b/snippets/ai-prompts/toolkits/payments.mdx
@@ -0,0 +1,137 @@
+
+{`---
+description: Integrate light-token APIs for stablecoin payments
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Integrate light-token APIs for stablecoin payments
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-payments
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+- Full examples: https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets
+
+SPL → Light Token API mapping:
+| Operation | SPL | Light Token |
+| Receive | getOrCreateAssociatedTokenAccount() | createLoadAtaInstructions() / loadAta() |
+| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
+| Get Balance | getAccount() | getAtaInterface() |
+| Tx History | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
+| Wrap SPL | N/A | createWrapInstruction() / wrap() |
+| Unwrap | N/A | createUnwrapInstructions() / unwrap() |
+
+### 1. Index project
+- Grep \`@solana/spl-token|@lightprotocol|createTransferInstruction|getAccount|Connection|Keypair|stablecoin|payment\` across src/
+- Glob \`**/*.ts\` and \`**/*.tsx\` for project structure
+- Identify: RPC setup, existing token operations, payment flow, wallet signing pattern
+- 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 Instruction and Action tabs for each operation
+- 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 payment integration, migrate existing SPL payment flow, add alongside existing SPL)
+- AskUserQuestion: which operations? (receive, send, balance, history, wrap, unwrap — or all)
+- AskUserQuestion: instruction-level API (build your own transactions) or action-level API (high-level, fewer lines)?
+- 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
+- Verify existing connection/signer setup is compatible (createRpc with ZK Compression endpoint)
+- Key pattern: import from \`@lightprotocol/compressed-token/unified\` for all interface APIs
+- 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\`
+- Set up RPC: \`createRpc(RPC_ENDPOINT)\` with a ZK Compression endpoint (Helius, Triton)
+- Import from \`@lightprotocol/compressed-token/unified\` for the interface APIs
+- 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Integrate light-token APIs for stablecoin payments
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Integrate light-token APIs for stablecoin payments
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-payments
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+- Full examples: https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets
+
+SPL → Light Token API mapping:
+| Operation | SPL | Light Token |
+| Receive | getOrCreateAssociatedTokenAccount() | createLoadAtaInstructions() / loadAta() |
+| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
+| Get Balance | getAccount() | getAtaInterface() |
+| Tx History | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
+| Wrap SPL | N/A | createWrapInstruction() / wrap() |
+| Unwrap | N/A | createUnwrapInstructions() / unwrap() |
+
+### 1. Index project
+- Grep `@solana/spl-token|@lightprotocol|createTransferInstruction|getAccount|Connection|Keypair|stablecoin|payment` across src/
+- Glob `**/*.ts` and `**/*.tsx` for project structure
+- Identify: RPC setup, existing token operations, payment flow, wallet signing pattern
+- 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 Instruction and Action tabs for each operation
+- 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 payment integration, migrate existing SPL payment flow, add alongside existing SPL)
+- AskUserQuestion: which operations? (receive, send, balance, history, wrap, unwrap — or all)
+- AskUserQuestion: instruction-level API (build your own transactions) or action-level API (high-level, fewer lines)?
+- 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
+- Verify existing connection/signer setup is compatible (createRpc with ZK Compression endpoint)
+- Key pattern: import from `@lightprotocol/compressed-token/unified` for all interface APIs
+- 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`
+- Set up RPC: `createRpc(RPC_ENDPOINT)` with a ZK Compression endpoint (Helius, Triton)
+- Import from `@lightprotocol/compressed-token/unified` for the interface APIs
+- 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/toolkits/wallets.mdx b/snippets/ai-prompts/toolkits/wallets.mdx
new file mode 100644
index 00000000..0a4c0a50
--- /dev/null
+++ b/snippets/ai-prompts/toolkits/wallets.mdx
@@ -0,0 +1,139 @@
+
+{`---
+description: Add light-token support to a wallet application
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add light-token support to a wallet application
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-wallets
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+- Full examples: https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets
+
+SPL → Light Token API mapping:
+| Operation | SPL | Light Token |
+| Receive | getOrCreateAssociatedTokenAccount() | createLoadAtaInstructions() / loadAta() |
+| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
+| Get Balance | getAccount() | getAtaInterface() |
+| Tx History | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
+| Wrap SPL | N/A | createWrapInstruction() / wrap() |
+| Unwrap | N/A | createUnwrapInstructions() / unwrap() |
+
+### 1. Index project
+- Grep \`@solana/spl-token|@lightprotocol|createTransferInstruction|getAccount|wallet|signTransaction|signAllTransactions|Connection\` across src/
+- Glob \`**/*.ts\` and \`**/*.tsx\` for project structure
+- Identify: RPC setup, existing token display/balance logic, wallet adapter, transaction signing pattern
+- 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 Instruction and Action tabs for each operation
+- 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 wallet integration, migrate existing SPL wallet to light-token, add light-token alongside existing SPL)
+- AskUserQuestion: which operations? (receive, send, balance, history, wrap, unwrap — or all)
+- AskUserQuestion: instruction-level API (build your own transactions) or action-level API (high-level, fewer lines)?
+- 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
+- Verify existing connection/signer setup is compatible (createRpc with ZK Compression endpoint)
+- Key pattern: import from \`@lightprotocol/compressed-token/unified\` for all interface APIs
+- APIs return TransactionInstruction[][] — handle multi-tx case with signAllTransactions
+- 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\`
+- Set up RPC: \`createRpc(RPC_ENDPOINT)\` with a ZK Compression endpoint (Helius, Triton)
+- Import from \`@lightprotocol/compressed-token/unified\` for the interface APIs
+- 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add light-token support to a wallet application
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add light-token support to a wallet application
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-wallets
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+- Full examples: https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets
+
+SPL → Light Token API mapping:
+| Operation | SPL | Light Token |
+| Receive | getOrCreateAssociatedTokenAccount() | createLoadAtaInstructions() / loadAta() |
+| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
+| Get Balance | getAccount() | getAtaInterface() |
+| Tx History | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
+| Wrap SPL | N/A | createWrapInstruction() / wrap() |
+| Unwrap | N/A | createUnwrapInstructions() / unwrap() |
+
+### 1. Index project
+- Grep `@solana/spl-token|@lightprotocol|createTransferInstruction|getAccount|wallet|signTransaction|signAllTransactions|Connection` across src/
+- Glob `**/*.ts` and `**/*.tsx` for project structure
+- Identify: RPC setup, existing token display/balance logic, wallet adapter, transaction signing pattern
+- 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 Instruction and Action tabs for each operation
+- 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 wallet integration, migrate existing SPL wallet to light-token, add light-token alongside existing SPL)
+- AskUserQuestion: which operations? (receive, send, balance, history, wrap, unwrap — or all)
+- AskUserQuestion: instruction-level API (build your own transactions) or action-level API (high-level, fewer lines)?
+- 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
+- Verify existing connection/signer setup is compatible (createRpc with ZK Compression endpoint)
+- Key pattern: import from `@lightprotocol/compressed-token/unified` for all interface APIs
+- APIs return TransactionInstruction[][] — handle multi-tx case with signAllTransactions
+- 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`
+- Set up RPC: `createRpc(RPC_ENDPOINT)` with a ZK Compression endpoint (Helius, Triton)
+- Import from `@lightprotocol/compressed-token/unified` for the interface APIs
+- 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/ts-cookbook/approve-revoke.mdx b/snippets/ai-prompts/ts-cookbook/approve-revoke.mdx
new file mode 100644
index 00000000..b8927232
--- /dev/null
+++ b/snippets/ai-prompts/ts-cookbook/approve-revoke.mdx
@@ -0,0 +1,109 @@
+
+{`---
+description: Approve and revoke token delegates
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Approve and revoke token delegates
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/approve-revoke
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: approve() / revoke() → Light Token: approve() / revoke()
+
+### 1. Index project
+- Grep \`@solana/spl-token|Connection|Keypair|approve|revoke|delegate\` across src/
+- Glob \`**/*.ts\` for project structure
+- Identify: RPC setup, existing delegation logic, entry point for delegation
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have delegate operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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\`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Approve and revoke token delegates
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Approve and revoke token delegates
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/approve-revoke
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: approve() / revoke() → Light Token: approve() / revoke()
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair|approve|revoke|delegate` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing delegation logic, entry point for delegation
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have delegate operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/ts-cookbook/create-ata.mdx b/snippets/ai-prompts/ts-cookbook/create-ata.mdx
new file mode 100644
index 00000000..8731bd4d
--- /dev/null
+++ b/snippets/ai-prompts/ts-cookbook/create-ata.mdx
@@ -0,0 +1,109 @@
+
+{`---
+description: Create rent-free associated token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create rent-free associated token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: createAssociatedTokenAccount() → Light Token: createAtaInterface()
+
+### 1. Index project
+- Grep \`@solana/spl-token|Connection|Keypair|createAssociatedTokenAccount|createAtaInterface\` across src/
+- Glob \`**/*.ts\` for project structure
+- Identify: RPC setup, existing ATA logic, entry point for ATA creation
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have ATA operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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\`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Create rent-free associated token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Create rent-free associated token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-ata
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: createAssociatedTokenAccount() → Light Token: createAtaInterface()
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair|createAssociatedTokenAccount|createAtaInterface` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing ATA logic, entry point for ATA creation
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have ATA operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/ts-cookbook/create-mint.mdx b/snippets/ai-prompts/ts-cookbook/create-mint.mdx
new file mode 100644
index 00000000..bd177f08
--- /dev/null
+++ b/snippets/ai-prompts/ts-cookbook/create-mint.mdx
@@ -0,0 +1,109 @@
+
+{`---
+description: Add rent-free mint with token metadata
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free mint with token metadata
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: createMint() → Light Token: createMintInterface()
+
+### 1. Index project
+- Grep \`@solana/spl-token|Connection|Keypair|createMint\` across src/
+- Glob \`**/*.ts\` for project structure
+- Identify: RPC setup, existing mint logic, entry point for mint creation
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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\`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Add rent-free mint with token metadata
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Add rent-free mint with token metadata
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/create-mint
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: createMint() → Light Token: createMintInterface()
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair|createMint` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing mint logic, entry point for mint creation
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/ts-cookbook/mint-to.mdx b/snippets/ai-prompts/ts-cookbook/mint-to.mdx
new file mode 100644
index 00000000..0e24f3f1
--- /dev/null
+++ b/snippets/ai-prompts/ts-cookbook/mint-to.mdx
@@ -0,0 +1,109 @@
+
+{`---
+description: Mint tokens to Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Mint tokens to Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/mint-to
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: mintTo() → Light Token: mintToInterface()
+
+### 1. Index project
+- Grep \`@solana/spl-token|Connection|Keypair|mintTo|mintToInterface\` across src/
+- Glob \`**/*.ts\` for project structure
+- Identify: RPC setup, existing mint logic, entry point for minting
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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\`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Mint tokens to Light Token account
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Mint tokens to Light Token account
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/mint-to
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+SPL equivalent: mintTo() → Light Token: mintToInterface()
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair|mintTo|mintToInterface` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing mint logic, entry point for minting
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have mint operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/ts-cookbook/transfer-interface.mdx b/snippets/ai-prompts/ts-cookbook/transfer-interface.mdx
new file mode 100644
index 00000000..2138a6ad
--- /dev/null
+++ b/snippets/ai-prompts/ts-cookbook/transfer-interface.mdx
@@ -0,0 +1,115 @@
+
+{`---
+description: Transfer tokens between Light Token and SPL accounts
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Transfer tokens between Light Token and SPL accounts
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-interface
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+transferInterface() transfers tokens between token accounts (SPL, Token 2022, or Light Token) in a single call.
+- Light Token → Light Token: transfers between Light Token accounts
+- SPL → Light Token: locks SPL tokens in interface PDA, mints to Light Token account
+- Light Token → SPL: burns Light Token balance, releases SPL tokens from interface PDA
+
+### 1. Index project
+- Grep \`@solana/spl-token|Connection|Keypair|transfer|transferInterface\` across src/
+- Glob \`**/*.ts\` for project structure
+- Identify: RPC setup, existing transfer logic, entry point for transfers
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have transfer operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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\`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Transfer tokens between Light Token and SPL accounts
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Transfer tokens between Light Token and SPL accounts
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/transfer-interface
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+transferInterface() transfers tokens between token accounts (SPL, Token 2022, or Light Token) in a single call.
+- Light Token → Light Token: transfers between Light Token accounts
+- SPL → Light Token: locks SPL tokens in interface PDA, mints to Light Token account
+- Light Token → SPL: burns Light Token balance, releases SPL tokens from interface PDA
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair|transfer|transferInterface` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing transfer logic, entry point for transfers
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have transfer operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/ts-cookbook/wrap-unwrap.mdx b/snippets/ai-prompts/ts-cookbook/wrap-unwrap.mdx
new file mode 100644
index 00000000..9db38063
--- /dev/null
+++ b/snippets/ai-prompts/ts-cookbook/wrap-unwrap.mdx
@@ -0,0 +1,111 @@
+
+{`---
+description: Wrap and unwrap SPL tokens to Light Token
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Wrap and unwrap SPL tokens to Light Token
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/wrap-unwrap
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+- Wrap: Move tokens from SPL or Token 2022 account → Light Token associated token account (hot balance)
+- Unwrap: Move tokens from Light Token associated token account (hot balance) → SPL or Token 2022 account
+
+### 1. Index project
+- Grep \`@solana/spl-token|Connection|Keypair|wrap|unwrap|WrapTokens|UnwrapTokens\` across src/
+- Glob \`**/*.ts\` for project structure
+- Identify: RPC setup, existing wrap/unwrap logic, entry point for wrap/unwrap
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have wrap/unwrap operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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\`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Wrap and unwrap SPL tokens to Light Token
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Wrap and unwrap SPL tokens to Light Token
+
+Context:
+- Guide: https://zkcompression.com/light-token/cookbook/wrap-unwrap
+- Skills and resources index: https://zkcompression.com/skill.md
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+
+- Wrap: Move tokens from SPL or Token 2022 account → Light Token associated token account (hot balance)
+- Unwrap: Move tokens from Light Token associated token account (hot balance) → SPL or Token 2022 account
+
+### 1. Index project
+- Grep `@solana/spl-token|Connection|Keypair|wrap|unwrap|WrapTokens|UnwrapTokens` across src/
+- Glob `**/*.ts` for project structure
+- Identify: RPC setup, existing wrap/unwrap logic, entry point for wrap/unwrap
+- Task subagent (Grep/Read/WebFetch) if project has multiple packages to scan in parallel
+
+### 2. Read references
+- WebFetch the guide above — follow the TypeScript Client tab
+- 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 feature, migrate existing SPL code, add alongside existing)
+- AskUserQuestion: does the project already have wrap/unwrap operations to extend, or is this greenfield?
+- 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
+- Verify existing connection/signer setup is compatible with the cookbook prerequisites
+- 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`
+- Follow the cookbook 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/ai-prompts/v1-to-v2-migration.mdx b/snippets/ai-prompts/v1-to-v2-migration.mdx
index 466aa94f..11bed006 100644
--- a/snippets/ai-prompts/v1-to-v2-migration.mdx
+++ b/snippets/ai-prompts/v1-to-v2-migration.mdx
@@ -1,3 +1,114 @@
+
+{`---
+argument-hint:
+description: Migrate Light Protocol program from v1 to v2 Merkle trees
+allowed-tools: [Bash, Read, Glob, Grep, Task, WebFetch]
+---
+
+Migrate this Light Protocol program from v1 to v2 Merkle trees.
+
+## Goal
+
+Produce a **fully working migration** that builds and tests pass.
+
+## Available commands
+
+Via 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 repos
+
+program-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 program
+
+Find 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 dependencies
+
+Update 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 reports
+2. Each attempt tries something DIFFERENT
+3. **NEVER GIVE UP** - keep spawning until fixed
+
+Do NOT proceed until all tests pass.
+
+## DeepWiki fallback
+
+If no matching pattern in reference repos:
+
+ mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "How to migrate {pattern} from v1 to v2?")`}
+
+
~~~~text
---
argument-hint:
diff --git a/snippets/ai-prompts/wallets/privy.mdx b/snippets/ai-prompts/wallets/privy.mdx
new file mode 100644
index 00000000..c3c9be8c
--- /dev/null
+++ b/snippets/ai-prompts/wallets/privy.mdx
@@ -0,0 +1,137 @@
+
+{`---
+description: Integrate light-token with Privy embedded wallets
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Integrate light-token with Privy embedded wallets
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-privy
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+- Node.js example: https://github.com/Lightprotocol/examples-light-token/tree/main/privy/nodejs
+- React example: https://github.com/Lightprotocol/examples-light-token/tree/main/privy/react
+
+SPL → Light Token API mapping:
+| Operation | SPL | Light Token |
+| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
+| Wrap SPL→Light | N/A | createWrapInstruction() |
+| Unwrap Light→SPL | N/A | createUnwrapInstructions() |
+| Get balance | getAccount() | getAtaInterface() |
+| Tx history | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
+
+### 1. Index project
+- Grep \`privy|@privy-io|usePrivy|PrivyProvider|createTransferInstruction|@solana/spl-token|Connection\` across src/
+- Glob \`**/*.ts\` and \`**/*.tsx\` for project structure
+- Identify: Privy SDK version, existing wallet setup, RPC config, token operations
+- 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 both Node.js and React code examples
+- 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: Node.js or React?
+- AskUserQuestion: what is the goal? (new Privy integration, migrate existing Privy+SPL code, add light-token alongside existing SPL)
+- AskUserQuestion: which operations? (transfer, wrap, unwrap, balances, tx history — or all)
+- 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
+- Verify existing Privy wallet setup is compatible (signTransaction or sendTransaction pattern)
+- Key integration pattern: build unsigned tx with light-token SDK → sign with Privy → send to RPC
+- 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\`
+- Set up RPC: \`createRpc(RPC_ENDPOINT)\` with a ZK Compression endpoint (Helius, Triton)
+- Import from \`@lightprotocol/compressed-token/unified\` for the interface APIs
+- 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work`}
+
+
+```text
+---
+description: Integrate light-token with Privy embedded wallets
+allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
+---
+
+## Integrate light-token with Privy embedded wallets
+
+Context:
+- Guide: https://zkcompression.com/light-token/toolkits/for-privy
+- Skills and resources index: https://zkcompression.com/skill.md
+- Dedicated skill: https://github.com/Lightprotocol/skills/tree/main/skills/payments-and-wallets
+- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
+- Node.js example: https://github.com/Lightprotocol/examples-light-token/tree/main/privy/nodejs
+- React example: https://github.com/Lightprotocol/examples-light-token/tree/main/privy/react
+
+SPL → Light Token API mapping:
+| Operation | SPL | Light Token |
+| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
+| Wrap SPL→Light | N/A | createWrapInstruction() |
+| Unwrap Light→SPL | N/A | createUnwrapInstructions() |
+| Get balance | getAccount() | getAtaInterface() |
+| Tx history | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
+
+### 1. Index project
+- Grep `privy|@privy-io|usePrivy|PrivyProvider|createTransferInstruction|@solana/spl-token|Connection` across src/
+- Glob `**/*.ts` and `**/*.tsx` for project structure
+- Identify: Privy SDK version, existing wallet setup, RPC config, token operations
+- 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 both Node.js and React code examples
+- 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: Node.js or React?
+- AskUserQuestion: what is the goal? (new Privy integration, migrate existing Privy+SPL code, add light-token alongside existing SPL)
+- AskUserQuestion: which operations? (transfer, wrap, unwrap, balances, tx history — or all)
+- 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
+- Verify existing Privy wallet setup is compatible (signTransaction or sendTransaction pattern)
+- Key integration pattern: build unsigned tx with light-token SDK → sign with Privy → send to RPC
+- 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`
+- Set up RPC: `createRpc(RPC_ENDPOINT)` with a ZK Compression endpoint (Helius, Triton)
+- Import from `@lightprotocol/compressed-token/unified` for the interface APIs
+- 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 if present
+- TaskUpdate to mark complete
+
+### Tools
+- mcp__zkcompression__SearchLightProtocol("") for API details
+- mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "") for architecture
+- Task subagent with Grep/Read/WebFetch for parallel lookups
+- TaskList to check remaining work
+```
diff --git a/snippets/code-snippets/light-token/counter/anchor-macro/full-example.mdx b/snippets/code-snippets/light-token/counter/anchor-macro/full-example.mdx
new file mode 100644
index 00000000..dd4680f2
--- /dev/null
+++ b/snippets/code-snippets/light-token/counter/anchor-macro/full-example.mdx
@@ -0,0 +1,266 @@
+
+
+
+```rust lib.rs expandable
+use anchor_lang::prelude::*;
+use light_account::{
+ CompressionInfo, LightAccount, LightAccounts, CreateAccountsProof,
+ derive_light_cpi_signer, light_program, CpiSigner,
+};
+
+declare_id!("YourProgramId11111111111111111111111111111111");
+
+pub const LIGHT_CPI_SIGNER: CpiSigner =
+ derive_light_cpi_signer!("YourProgramId11111111111111111111111111111111");
+
+pub const COUNTER_SEED: &[u8] = b"counter";
+
+#[derive(Default, Debug, InitSpace, LightAccount)]
+#[account]
+pub struct Counter {
+ pub compression_info: CompressionInfo,
+ pub owner: Pubkey,
+ pub count: u64,
+}
+
+#[derive(AnchorSerialize, AnchorDeserialize, Clone)]
+pub struct CreateCounterParams {
+ pub create_accounts_proof: CreateAccountsProof,
+ pub count: u64,
+}
+
+#[light_program]
+#[program]
+pub mod counter {
+ use super::*;
+
+ pub fn create_counter<'info>(
+ ctx: Context<'_, '_, '_, 'info, CreateCounter<'info>>,
+ params: CreateCounterParams,
+ ) -> Result<()> {
+ ctx.accounts.counter.owner = ctx.accounts.owner.key();
+ ctx.accounts.counter.count = params.count;
+ Ok(())
+ }
+
+ /// Standard Anchor — no Light-specific changes.
+ pub fn increment(ctx: Context) -> Result<()> {
+ ctx.accounts.counter.count = ctx.accounts.counter.count.checked_add(1).unwrap();
+ Ok(())
+ }
+
+ /// Standard Anchor — no Light-specific changes.
+ pub fn close_counter(_ctx: Context) -> Result<()> {
+ Ok(())
+ }
+}
+
+#[derive(Accounts, LightAccounts)]
+#[instruction(params: CreateCounterParams)]
+pub struct CreateCounter<'info> {
+ #[account(mut)]
+ pub fee_payer: Signer<'info>,
+
+ /// CHECK: Read-only, used for PDA derivation.
+ pub owner: AccountInfo<'info>,
+
+ /// CHECK: Validated by Light Protocol CPI.
+ pub compression_config: AccountInfo<'info>,
+
+ /// CHECK: PDA rent sponsor for compression rent reimbursement.
+ #[account(mut)]
+ pub pda_rent_sponsor: AccountInfo<'info>,
+
+ #[account(
+ init,
+ payer = fee_payer,
+ space = 8 + ::INIT_SPACE,
+ seeds = [COUNTER_SEED, owner.key().as_ref()],
+ bump,
+ )]
+ #[light_account(init)]
+ pub counter: Account<'info, Counter>,
+
+ pub system_program: Program<'info, System>,
+}
+
+/// Standard Anchor
+#[derive(Accounts)]
+pub struct Increment<'info> {
+ pub owner: Signer<'info>,
+
+ #[account(
+ mut,
+ seeds = [COUNTER_SEED, owner.key().as_ref()],
+ bump,
+ has_one = owner,
+ )]
+ pub counter: Account<'info, Counter>,
+}
+
+/// Standard Anchor close
+#[derive(Accounts)]
+pub struct CloseCounter<'info> {
+ #[account(mut)]
+ pub fee_payer: Signer<'info>,
+
+ pub owner: Signer<'info>,
+
+ #[account(
+ mut,
+ close = fee_payer,
+ seeds = [COUNTER_SEED, owner.key().as_ref()],
+ bump,
+ has_one = owner,
+ )]
+ pub counter: Account<'info, Counter>,
+}
+```
+
+
+
+
+```rust counter.rs expandable
+//! Light-PDA lifecycle test: create → increment → close.
+
+use anchor_lang::{InstructionData, ToAccountMetas};
+use light_client::interface::{
+ get_create_accounts_proof, CreateAccountsProofInput, InitializeRentFreeConfig,
+};
+use light_program_test::{
+ program_test::{setup_mock_program_data, LightProgramTest},
+ ProgramTestConfig, Rpc,
+};
+use light_token::instruction::RENT_SPONSOR;
+use solana_instruction::Instruction;
+use solana_keypair::Keypair;
+use solana_pubkey::Pubkey;
+use solana_signer::Signer;
+
+const PROGRAM_ID: Pubkey = counter::ID;
+
+/// Setup: create test RPC and initialize rent-free config for the counter program.
+async fn setup() -> (LightProgramTest, Keypair, Pubkey) {
+ let config = ProgramTestConfig::new_v2(true, Some(vec![("counter", PROGRAM_ID)]));
+ let mut rpc = LightProgramTest::new(config).await.unwrap();
+ let payer = rpc.get_payer().insecure_clone();
+
+ let program_data_pda = setup_mock_program_data(&mut rpc, &payer, &PROGRAM_ID);
+
+ // Register this program for rent-free accounts. One-time setup per program.
+ let (init_config_ix, compression_config) = InitializeRentFreeConfig::new(
+ &PROGRAM_ID,
+ &payer.pubkey(),
+ &program_data_pda,
+ RENT_SPONSOR,
+ payer.pubkey(),
+ )
+ .build();
+
+ rpc.create_and_send_transaction(&[init_config_ix], &payer.pubkey(), &[&payer])
+ .await
+ .expect("initialize rent-free config");
+
+ (rpc, payer, compression_config)
+}
+
+#[tokio::test]
+async fn test_counter_lifecycle() {
+ let (mut rpc, payer, compression_config) = setup().await;
+
+ // ── Create ───────────────────────────────────────────────────────────
+ let (counter_pda, _) = Pubkey::find_program_address(
+ &[counter::COUNTER_SEED, payer.pubkey().as_ref()],
+ &PROGRAM_ID,
+ );
+
+ let proof_result = get_create_accounts_proof(
+ &rpc,
+ &PROGRAM_ID,
+ vec![CreateAccountsProofInput::pda(counter_pda)],
+ )
+ .await
+ .unwrap();
+
+ let create_accounts = counter::accounts::CreateCounter {
+ fee_payer: payer.pubkey(),
+ owner: payer.pubkey(),
+ compression_config,
+ counter: counter_pda,
+ system_program: solana_sdk::system_program::ID,
+ };
+
+ let create_data = counter::instruction::CreateCounter {
+ params: counter::CreateCounterParams {
+ create_accounts_proof: proof_result.create_accounts_proof,
+ count: 0,
+ },
+ };
+
+ let create_ix = Instruction {
+ program_id: PROGRAM_ID,
+ accounts: [
+ create_accounts.to_account_metas(None),
+ proof_result.remaining_accounts,
+ ]
+ .concat(),
+ data: create_data.data(),
+ };
+
+ rpc.create_and_send_transaction(&[create_ix], &payer.pubkey(), &[&payer])
+ .await
+ .expect("create_counter");
+
+ // Verify initial state.
+ let account = rpc.get_account(counter_pda).await.unwrap().unwrap();
+ let ctr: counter::Counter =
+ anchor_lang::AccountDeserialize::try_deserialize(&mut account.data.as_slice()).unwrap();
+ assert_eq!(ctr.count, 0);
+ assert_eq!(ctr.owner, payer.pubkey());
+
+ // ── Increment (standard Anchor) ────────────────────────────
+ let inc_accounts = counter::accounts::Increment {
+ owner: payer.pubkey(),
+ counter: counter_pda,
+ };
+ let inc_data = counter::instruction::Increment {};
+ let inc_ix = Instruction {
+ program_id: PROGRAM_ID,
+ accounts: inc_accounts.to_account_metas(None),
+ data: inc_data.data(),
+ };
+
+ rpc.create_and_send_transaction(&[inc_ix], &payer.pubkey(), &[&payer])
+ .await
+ .expect("increment");
+
+ let account = rpc.get_account(counter_pda).await.unwrap().unwrap();
+ let ctr: counter::Counter =
+ anchor_lang::AccountDeserialize::try_deserialize(&mut account.data.as_slice()).unwrap();
+ assert_eq!(ctr.count, 1);
+
+ // ── Close (standard Anchor) ────────────────────────────────
+ let close_accounts = counter::accounts::CloseCounter {
+ fee_payer: payer.pubkey(),
+ owner: payer.pubkey(),
+ counter: counter_pda,
+ };
+ let close_data = counter::instruction::CloseCounter {};
+ let close_ix = Instruction {
+ program_id: PROGRAM_ID,
+ accounts: close_accounts.to_account_metas(None),
+ data: close_data.data(),
+ };
+
+ rpc.create_and_send_transaction(&[close_ix], &payer.pubkey(), &[&payer])
+ .await
+ .expect("close_counter");
+
+ // Account should no longer exist.
+ let account = rpc.get_account(counter_pda).await.unwrap();
+ assert!(account.is_none(), "counter should be closed");
+}
+```
+
+
+
diff --git a/snippets/code-snippets/light-token/mint-spl-and-wrap/action.mdx b/snippets/code-snippets/light-token/mint-spl-and-wrap/action.mdx
new file mode 100644
index 00000000..c7912507
--- /dev/null
+++ b/snippets/code-snippets/light-token/mint-spl-and-wrap/action.mdx
@@ -0,0 +1,96 @@
+```typescript
+import "dotenv/config";
+import { Keypair, PublicKey } from "@solana/web3.js";
+import { createRpc } from "@lightprotocol/stateless.js";
+import {
+ createMintInterface,
+ createAtaInterfaceIdempotent,
+ getAssociatedTokenAddressInterface,
+ wrap,
+ transferInterface,
+} from "@lightprotocol/compressed-token";
+import {
+ TOKEN_2022_PROGRAM_ID,
+ createAssociatedTokenAccount,
+ mintTo,
+} from "@solana/spl-token";
+import { homedir } from "os";
+import { readFileSync } from "fs";
+
+// devnet:
+const RPC_URL = `https://devnet.helius-rpc.com?api-key=${process.env.API_KEY!}`;
+const rpc = createRpc(RPC_URL);
+// localnet:
+// const rpc = createRpc();
+
+const payer = Keypair.fromSecretKey(
+ new Uint8Array(
+ JSON.parse(readFileSync(`${homedir()}/.config/solana/id.json`, "utf8"))
+ )
+);
+
+(async function () {
+ const decimals = 9;
+ const tokenAmount = BigInt(100 * Math.pow(10, decimals));
+ const recipient = Keypair.generate();
+
+ // Creates on-chain SPL or Token-2022 mint and registers SPL interface PDA.
+ // SPL interface PDA enables wrap/unwrap between SPL/Token-2022 and Light Token.
+ const mintKeypair = Keypair.generate();
+ const { mint } = await createMintInterface(
+ rpc,
+ payer,
+ payer,
+ null,
+ decimals,
+ mintKeypair,
+ undefined,
+ TOKEN_2022_PROGRAM_ID,
+ );
+
+ // 1. Mint SPL tokens to payer's associated token account
+ const payerSplAta = await createAssociatedTokenAccount(
+ rpc,
+ payer,
+ mint,
+ payer.publicKey,
+ undefined,
+ TOKEN_2022_PROGRAM_ID,
+ );
+ await mintTo(
+ rpc,
+ payer,
+ mint,
+ payerSplAta,
+ payer,
+ tokenAmount,
+ [],
+ undefined,
+ TOKEN_2022_PROGRAM_ID,
+ );
+
+ // 2. Wrap SPL tokens into payer's light associated token account
+ await createAtaInterfaceIdempotent(rpc, payer, mint, payer.publicKey);
+ const payerLightAta = getAssociatedTokenAddressInterface(mint, payer.publicKey);
+ await wrap(rpc, payer, payerSplAta, payerLightAta, payer, mint, tokenAmount);
+
+ // 3. Transfer to recipient's light associated token account
+ await createAtaInterfaceIdempotent(rpc, payer, mint, recipient.publicKey);
+ const recipientLightAta = getAssociatedTokenAddressInterface(mint, recipient.publicKey);
+ await transferInterface(
+ rpc,
+ payer,
+ payerLightAta,
+ mint,
+ recipientLightAta,
+ payer,
+ tokenAmount,
+ );
+
+ console.log("Transferred", 100, "tokens to", recipient.publicKey.toBase58());
+})();
+```
+
+
+Source: [mint-spl-and-wrap.ts](https://github.com/Lightprotocol/examples-light-token/blob/main/toolkits/sign-with-privy/scripts/src/mint-spl-and-wrap.ts)
+
diff --git a/snippets/code-snippets/light-token/sponsor-rent-top-ups/rust-instruction.mdx b/snippets/code-snippets/light-token/sponsor-rent-top-ups/rust-instruction.mdx
new file mode 100644
index 00000000..87d23e7e
--- /dev/null
+++ b/snippets/code-snippets/light-token/sponsor-rent-top-ups/rust-instruction.mdx
@@ -0,0 +1,53 @@
+```rust
+use light_client::rpc::Rpc;
+use light_program_test::{LightProgramTest, ProgramTestConfig};
+use light_token::instruction::{
+ get_associated_token_address, CreateAssociatedTokenAccount,
+ TransferInterface, LIGHT_TOKEN_PROGRAM_ID,
+};
+use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer};
+
+#[tokio::main]
+async fn main() -> Result<(), Box> {
+ let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(true, None)).await?;
+
+ // Top-Up Sponsor: your application server, pays SOL for rent top-ups
+ let sponsor = rpc.get_payer().insecure_clone();
+
+ // User: only signs to authorize the transfer
+ let sender: Keypair = /* user's keypair */;
+ let recipient: Pubkey = /* recipient address */;
+ let mint: Pubkey = /* e.g. USDC mint */;
+ let decimals = 6u8;
+
+ let sender_ata = get_associated_token_address(&sender.pubkey(), &mint);
+ let recipient_ata = get_associated_token_address(&recipient, &mint);
+
+ // Create recipient associated token account if it doesn't exist
+ let create_ata_ix =
+ CreateAssociatedTokenAccount::new(sponsor.pubkey(), recipient, mint).instruction()?;
+ rpc.create_and_send_transaction(&[create_ata_ix], &sponsor.pubkey(), &[&sponsor])
+ .await?;
+
+ let transfer_ix = TransferInterface {
+ source: sender_ata,
+ destination: recipient_ata,
+ amount: 500_000,
+ decimals,
+ authority: sender.pubkey(),
+ payer: sponsor.pubkey(),
+ spl_interface: None,
+ source_owner: LIGHT_TOKEN_PROGRAM_ID,
+ destination_owner: LIGHT_TOKEN_PROGRAM_ID,
+ }
+ .instruction()?;
+
+ let sig = rpc
+ .create_and_send_transaction(&[transfer_ix], &sponsor.pubkey(), &[&sponsor, &sender])
+ .await?;
+
+ println!("Tx: {sig}");
+
+ Ok(())
+}
+```
diff --git a/snippets/code-snippets/light-token/sponsor-rent-top-ups/ts-instruction.mdx b/snippets/code-snippets/light-token/sponsor-rent-top-ups/ts-instruction.mdx
new file mode 100644
index 00000000..7b5dca14
--- /dev/null
+++ b/snippets/code-snippets/light-token/sponsor-rent-top-ups/ts-instruction.mdx
@@ -0,0 +1,41 @@
+```typescript
+import { Keypair, Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
+import { createRpc } from "@lightprotocol/stateless.js";
+import {
+ createAtaInterface,
+ createLightTokenTransferInstruction,
+ getAssociatedTokenAddressInterface,
+} from "@lightprotocol/compressed-token";
+import { PublicKey } from "@solana/web3.js";
+
+const rpc = createRpc();
+
+// Top-Up Sponsor: your application server, pays SOL for rent top-ups
+const sponsor: Keypair = /* your server keypair */;
+
+// User: only signs to authorize the transfer
+const sender: Keypair = /* user's keypair */;
+const recipient = new PublicKey(/* recipient address */);
+const mint = new PublicKey(/* e.g. USDC mint */);
+
+(async function () {
+ const senderAta = getAssociatedTokenAddressInterface(mint, sender.publicKey);
+ const recipientAta = getAssociatedTokenAddressInterface(mint, recipient);
+
+ // Create recipient associated token account if it doesn't exist
+ await createAtaInterface(rpc, sponsor, mint, recipient);
+
+ const ix = createLightTokenTransferInstruction(
+ senderAta,
+ recipientAta,
+ sender.publicKey,
+ 500_000,
+ sponsor.publicKey,
+ );
+
+ const tx = new Transaction().add(ix);
+ const sig = await sendAndConfirmTransaction(rpc, tx, [sponsor, sender]);
+
+ console.log("Tx:", sig);
+})();
+```
diff --git a/snippets/code-snippets/light-token/transfer-interface/anchor-program/create-and-transfer-example.mdx b/snippets/code-snippets/light-token/transfer-interface/anchor-program/create-and-transfer-example.mdx
new file mode 100644
index 00000000..868d48b6
--- /dev/null
+++ b/snippets/code-snippets/light-token/transfer-interface/anchor-program/create-and-transfer-example.mdx
@@ -0,0 +1,249 @@
+
+```rust lib.rs
+#![allow(unexpected_cfgs, deprecated)]
+
+use anchor_lang::prelude::*;
+use light_sdk::interface::CreateAccountsProof;
+use light_token::anchor::{derive_light_cpi_signer, light_program, CpiSigner, LightAccounts};
+use light_token::instruction::TransferInterfaceCpi;
+
+declare_id!("672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E");
+
+pub const LIGHT_CPI_SIGNER: CpiSigner =
+ derive_light_cpi_signer!("672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E");
+
+#[derive(AnchorSerialize, AnchorDeserialize, Clone)]
+pub struct TransferParams {
+ pub create_accounts_proof: CreateAccountsProof,
+ pub dest_associated_token_account_bump: u8,
+ pub amount: u64,
+ pub decimals: u8,
+}
+
+#[light_program]
+#[program]
+pub mod create_and_transfer {
+ use super::*;
+
+ pub fn transfer<'info>(
+ ctx: Context<'_, '_, '_, 'info, Transfer<'info>>,
+ params: TransferParams,
+ ) -> Result<()> {
+ TransferInterfaceCpi::new(
+ params.amount,
+ params.decimals,
+ ctx.accounts.source.to_account_info(),
+ ctx.accounts.destination.to_account_info(),
+ ctx.accounts.authority.to_account_info(),
+ ctx.accounts.payer.to_account_info(),
+ ctx.accounts.light_token_cpi_authority.to_account_info(),
+ ctx.accounts.system_program.to_account_info(),
+ )
+ .invoke()
+ .map_err(|e| anchor_lang::prelude::ProgramError::from(e))?;
+ Ok(())
+ }
+}
+
+#[derive(Accounts, LightAccounts)]
+#[instruction(params: TransferParams)]
+pub struct Transfer<'info> {
+ #[account(mut)]
+ pub payer: Signer<'info>,
+
+ pub authority: Signer<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ pub mint: AccountInfo<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ #[account(mut)]
+ pub source: AccountInfo<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ pub recipient: AccountInfo<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ #[account(mut)]
+ #[light_account(init,
+ associated_token::authority = recipient,
+ associated_token::mint = mint,
+ associated_token::bump = params.dest_associated_token_account_bump
+ )]
+ pub destination: UncheckedAccount<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ pub light_token_program: AccountInfo<'info>,
+
+ pub system_program: Program<'info, System>,
+
+ /// CHECK: Validated by light-token CPI
+ pub light_token_compressible_config: AccountInfo<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ #[account(mut)]
+ pub rent_sponsor: AccountInfo<'info>,
+
+ /// CHECK: Validated by light-token CPI
+ pub light_token_cpi_authority: AccountInfo<'info>,
+}
+```
+
+```rust test.rs
+use anchor_lang::{InstructionData, ToAccountMetas};
+use light_client::interface::{get_create_accounts_proof, InitializeRentFreeConfig};
+use light_program_test::{
+ program_test::{setup_mock_program_data, LightProgramTest},
+ Indexer, ProgramTestConfig, Rpc,
+};
+use light_sdk_types::LIGHT_TOKEN_PROGRAM_ID;
+use light_token::instruction::{
+ derive_token_ata, find_mint_address, COMPRESSIBLE_CONFIG_V1, RENT_SPONSOR,
+};
+use solana_instruction::Instruction;
+use solana_keypair::Keypair;
+use solana_signer::Signer;
+use create_and_transfer::{TransferParams, ID};
+
+#[tokio::test]
+async fn test_transfer() {
+ let config = ProgramTestConfig::new_v2(true, Some(vec![("create_and_transfer", ID)]))
+ .with_light_protocol_events();
+
+ let mut rpc = LightProgramTest::new(config).await.unwrap();
+ let payer = rpc.get_payer().insecure_clone();
+
+ let program_data_pda = setup_mock_program_data(&mut rpc, &payer, &ID);
+
+ let (init_config_ix, _config_pda) = InitializeRentFreeConfig::new(
+ &ID,
+ &payer.pubkey(),
+ &program_data_pda,
+ RENT_SPONSOR,
+ payer.pubkey(),
+ )
+ .build();
+
+ rpc.create_and_send_transaction(&[init_config_ix], &payer.pubkey(), &[&payer])
+ .await
+ .unwrap();
+
+ let (mint_pda, _mint_seed) = setup_create_mint(
+ &mut rpc,
+ &payer,
+ payer.pubkey(), // mint_authority
+ 9, // decimals
+ )
+ .await;
+
+ println!("Mint created at: {}", mint_pda);
+
+ let sender = Keypair::new();
+ let (sender_associated_token_account, _sender_associated_token_account_bump) =
+ derive_token_ata(&sender.pubkey(), &mint_pda);
+
+ let create_sender_associated_token_account_ix =
+ light_token::instruction::CreateAssociatedTokenAccount::new(
+ payer.pubkey(),
+ sender.pubkey(),
+ mint_pda,
+ )
+ .instruction()
+ .unwrap();
+
+ rpc.create_and_send_transaction(
+ &[create_sender_associated_token_account_ix],
+ &payer.pubkey(),
+ &[&payer],
+ )
+ .await
+ .unwrap();
+
+ let mint_amount: u64 = 1_000_000_000;
+ mint_tokens(&mut rpc, &payer, mint_pda, sender_associated_token_account, mint_amount).await;
+
+ println!(
+ "Minted {} tokens to sender: {}",
+ mint_amount, sender_associated_token_account
+ );
+
+ let recipient = Keypair::new();
+ let (recipient_associated_token_account, recipient_associated_token_account_bump) =
+ derive_token_ata(&recipient.pubkey(), &mint_pda);
+
+ let transfer_proof_result = get_create_accounts_proof(&rpc, &ID, vec![]).await.unwrap();
+
+ let transfer_accounts = create_and_transfer::accounts::Transfer {
+ payer: payer.pubkey(),
+ authority: sender.pubkey(),
+ mint: mint_pda,
+ source: sender_associated_token_account,
+ recipient: recipient.pubkey(),
+ destination: recipient_associated_token_account,
+ light_token_program: LIGHT_TOKEN_PROGRAM_ID.into(),
+ system_program: solana_sdk::system_program::ID,
+ light_token_compressible_config: COMPRESSIBLE_CONFIG_V1,
+ rent_sponsor: RENT_SPONSOR,
+ light_token_cpi_authority: light_token_types::CPI_AUTHORITY_PDA.into(),
+ };
+
+ let transfer_amount: u64 = 500_000_000; // 0.5 tokens
+ let decimals: u8 = 9;
+
+ let transfer_ix = Instruction {
+ program_id: ID,
+ accounts: [
+ transfer_accounts.to_account_metas(None),
+ transfer_proof_result.remaining_accounts,
+ ]
+ .concat(),
+ data: create_and_transfer::instruction::Transfer {
+ params: TransferParams {
+ create_accounts_proof: transfer_proof_result.create_accounts_proof,
+ dest_associated_token_account_bump: recipient_associated_token_account_bump,
+ amount: transfer_amount,
+ decimals,
+ },
+ }
+ .data(),
+ };
+
+ let sig = rpc
+ .create_and_send_transaction(&[transfer_ix], &payer.pubkey(), &[&payer, &sender])
+ .await
+ .unwrap();
+
+ println!("Transfer Tx: {}", sig);
+
+ use light_token_interface::state::Token;
+
+ let recipient_account = rpc
+ .get_account(recipient_associated_token_account)
+ .await
+ .unwrap()
+ .unwrap();
+ let recipient_token: Token =
+ borsh::BorshDeserialize::deserialize(&mut &recipient_account.data[..]).unwrap();
+
+ assert_eq!(recipient_token.amount, transfer_amount);
+ assert_eq!(recipient_token.owner, recipient.pubkey().to_bytes());
+
+ println!(
+ "Recipient balance: {}, owner: {}",
+ recipient_token.amount,
+ recipient.pubkey()
+ );
+
+ let sender_account = rpc
+ .get_account(sender_associated_token_account)
+ .await
+ .unwrap()
+ .unwrap();
+ let sender_token: Token =
+ borsh::BorshDeserialize::deserialize(&mut &sender_account.data[..]).unwrap();
+
+ assert_eq!(sender_token.amount, mint_amount - transfer_amount);
+ println!("Sender remaining balance: {}", sender_token.amount);
+}
+```
+
\ No newline at end of file
diff --git a/snippets/code-snippets/light-token/transfer-interface/instruction.mdx b/snippets/code-snippets/light-token/transfer-interface/instruction.mdx
index cbebec35..8fd08921 100644
--- a/snippets/code-snippets/light-token/transfer-interface/instruction.mdx
+++ b/snippets/code-snippets/light-token/transfer-interface/instruction.mdx
@@ -47,12 +47,14 @@ const payer = Keypair.fromSecretKey(
recipient.publicKey,
);
- // Transfer tokens between light-token associated token accounts
+ // Transfer tokens. Optional feePayer lets an application cover top-ups
+ // so the sender only signs to authorize the transfer.
const ix = createLightTokenTransferInstruction(
senderAta,
recipientAta,
- sender.publicKey,
+ sender.publicKey, // owner (signs the transfer)
500_000_000,
+ payer.publicKey, // optional: separate feePayer covers top-up
);
const tx = new Transaction().add(ix);
diff --git a/snippets/code-snippets/privy/balances/nodejs.mdx b/snippets/code-snippets/privy/balances/nodejs.mdx
index ebf6e51d..7322f3fc 100644
--- a/snippets/code-snippets/privy/balances/nodejs.mdx
+++ b/snippets/code-snippets/privy/balances/nodejs.mdx
@@ -1,38 +1,141 @@
```typescript
-import {PublicKey} from '@solana/web3.js';
+import 'dotenv/config';
+import {PublicKey, LAMPORTS_PER_SOL} from '@solana/web3.js';
+import {TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID} from '@solana/spl-token';
import {createRpc} from '@lightprotocol/stateless.js';
-import {HELIUS_RPC_URL} from './config.js';
+import {
+ getAtaInterface,
+ getAssociatedTokenAddressInterface,
+} from '@lightprotocol/compressed-token/unified';
-export async function getCompressedBalances(ownerAddress: string) {
- const rpc = createRpc(HELIUS_RPC_URL);
+interface TokenBalance {
+ mint: string;
+ decimals: number;
+ hot: number;
+ cold: number;
+ spl: number;
+ t22: number;
+ unified: number;
+}
+
+interface BalanceBreakdown {
+ sol: number;
+ tokens: TokenBalance[];
+}
+
+export async function getBalances(
+ ownerAddress: string,
+): Promise {
+ const rpc = createRpc(process.env.HELIUS_RPC_URL!);
const owner = new PublicKey(ownerAddress);
- // Get compressed SOL balance
- const compressedSol = await rpc.getCompressedBalanceByOwner(owner);
- const compressedSolLamports = compressedSol.value ? BigInt(compressedSol.value.toString()) : 0n;
-
- // Get compressed token accounts (filter out null items from indexer)
- const compressedAccounts = await rpc.getCompressedTokenAccountsByOwner(owner);
- const validItems = (compressedAccounts.items || []).filter((item): item is NonNullable => item !== null);
-
- // Aggregate balances by mint
- const balances = new Map();
- for (const account of validItems) {
- if (account.parsed) {
- const mint = account.parsed.mint.toBase58();
- const amount = BigInt(account.parsed.amount.toString());
- const current = balances.get(mint) || 0n;
- balances.set(mint, current + amount);
- }
+ // SOL balance
+ let solLamports = 0;
+ try {
+ solLamports = await rpc.getBalance(owner);
+ } catch (e) {
+ console.error('Failed to fetch SOL balance:', e);
}
- return {
- sol: compressedSolLamports.toString(),
- tokens: Array.from(balances.entries()).map(([mint, amount]) => ({
- mint,
- amount: amount.toString(),
- accounts: validItems.filter(a => a.parsed?.mint.toBase58() === mint).length
- }))
+ // Per-mint accumulator
+ const mintMap = new Map();
+
+ const getOrCreate = (mintStr: string) => {
+ let entry = mintMap.get(mintStr);
+ if (!entry) {
+ entry = {spl: 0, t22: 0, hot: 0, cold: 0, decimals: 9};
+ mintMap.set(mintStr, entry);
+ }
+ return entry;
};
+
+ // 1. SPL accounts
+ try {
+ const splAccounts = await rpc.getTokenAccountsByOwner(owner, {
+ programId: TOKEN_PROGRAM_ID,
+ });
+ for (const {account} of splAccounts.value) {
+ const buf = toBuffer(account.data);
+ if (!buf || buf.length < 72) continue;
+ const mint = new PublicKey(buf.subarray(0, 32));
+ const amount = buf.readBigUInt64LE(64);
+ const mintStr = mint.toBase58();
+ getOrCreate(mintStr).spl += toUiAmount(amount, 9);
+ }
+ } catch {
+ // No SPL accounts
+ }
+
+ // 2. Token 2022 accounts
+ try {
+ const t22Accounts = await rpc.getTokenAccountsByOwner(owner, {
+ programId: TOKEN_2022_PROGRAM_ID,
+ });
+ for (const {account} of t22Accounts.value) {
+ const buf = toBuffer(account.data);
+ if (!buf || buf.length < 72) continue;
+ const mint = new PublicKey(buf.subarray(0, 32));
+ const amount = buf.readBigUInt64LE(64);
+ const mintStr = mint.toBase58();
+ getOrCreate(mintStr).t22 += toUiAmount(amount, 9);
+ }
+ } catch {
+ // No Token 2022 accounts
+ }
+
+ // 3. Hot balance from Light Token associated token account
+ const mintKeys = [...mintMap.keys()];
+ await Promise.allSettled(
+ mintKeys.map(async (mintStr) => {
+ try {
+ const mint = new PublicKey(mintStr);
+ const ata = getAssociatedTokenAddressInterface(mint, owner);
+ const {parsed} = await getAtaInterface(rpc, ata, owner, mint);
+ getOrCreate(mintStr).hot = toUiAmount(parsed.amount, 9);
+ } catch {
+ // Associated token account does not exist for this mint
+ }
+ }),
+ );
+
+ // 4. Cold balance from compressed token accounts
+ try {
+ const compressed = await rpc.getCompressedTokenBalancesByOwnerV2(owner);
+ for (const item of compressed.value.items) {
+ const mintStr = item.mint.toBase58();
+ getOrCreate(mintStr).cold += toUiAmount(BigInt(item.balance.toString()), 9);
+ }
+ } catch {
+ // No compressed accounts
+ }
+
+ // Assemble result
+ const tokens: TokenBalance[] = [];
+ for (const [mintStr, entry] of mintMap) {
+ tokens.push({
+ mint: mintStr,
+ decimals: entry.decimals,
+ hot: entry.hot,
+ cold: entry.cold,
+ spl: entry.spl,
+ t22: entry.t22,
+ unified: entry.hot + entry.cold,
+ });
+ }
+
+ return {sol: solLamports / LAMPORTS_PER_SOL, tokens};
+}
+
+function toBuffer(data: Buffer | Uint8Array | string | unknown): Buffer | null {
+ if (data instanceof Buffer) return data;
+ if (data instanceof Uint8Array) return Buffer.from(data);
+ return null;
}
+
+function toUiAmount(raw: bigint | {toNumber: () => number}, decimals: number): number {
+ const value = typeof raw === 'bigint' ? Number(raw) : raw.toNumber();
+ return value / 10 ** decimals;
+}
+
+export default getBalances;
```
diff --git a/snippets/code-snippets/privy/balances/react.mdx b/snippets/code-snippets/privy/balances/react.mdx
index cd6310f8..8792502e 100644
--- a/snippets/code-snippets/privy/balances/react.mdx
+++ b/snippets/code-snippets/privy/balances/react.mdx
@@ -1,21 +1,25 @@
```typescript
import { useState, useCallback } from 'react';
import { PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';
-import { getAccount, getAssociatedTokenAddressSync } from '@solana/spl-token';
+import { TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
import { createRpc } from '@lightprotocol/stateless.js';
-
-const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
-const TEST_MINT = '7cT3PeXyDLkyEcvr9YzsjGLuZneKsea4c8hPbJQEjMCZ';
+import {
+ getAssociatedTokenAddressInterface,
+ getAtaInterface,
+} from '@lightprotocol/compressed-token/unified';
export interface TokenBalance {
mint: string;
- amount: string;
decimals: number;
- isCompressed: boolean;
isNative: boolean;
+ hot: bigint;
+ cold: bigint;
+ spl: bigint;
+ t22: bigint;
+ unified: bigint;
}
-export function useCompressedBalances() {
+export function useUnifiedBalance() {
const [balances, setBalances] = useState([]);
const [isLoading, setIsLoading] = useState(false);
@@ -26,141 +30,118 @@ export function useCompressedBalances() {
try {
const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
const owner = new PublicKey(ownerAddress);
- const allBalances: TokenBalance[] = [];
- // Get compressed SOL balance
- try {
- const compressedSol = await rpc.getCompressedBalanceByOwner(owner);
- if (compressedSol && BigInt(compressedSol.toString()) > 0n) {
- allBalances.push({
- mint: 'So11111111111111111111111111111111111111112',
- amount: compressedSol.toString(),
- decimals: 9,
- isCompressed: true,
- isNative: true,
- });
+ // Per-mint accumulator
+ const mintMap = new Map();
+
+ const getOrCreate = (mintStr: string) => {
+ let entry = mintMap.get(mintStr);
+ if (!entry) {
+ entry = { spl: 0n, t22: 0n, hot: 0n, cold: 0n, decimals: 9 };
+ mintMap.set(mintStr, entry);
}
+ return entry;
+ };
+
+ // 1. SOL balance
+ let solLamports = 0;
+ try {
+ solLamports = await rpc.getBalance(owner);
} catch {
- // No compressed SOL
+ // Failed to fetch SOL balance
}
- // Get regular SOL balance
+ // 2. SPL accounts
try {
- const solBalance = await rpc.getBalance(owner);
- allBalances.push({
- mint: 'So11111111111111111111111111111111111111112',
- amount: solBalance.toString(),
- decimals: 9,
- isCompressed: false,
- isNative: true,
+ const splAccounts = await rpc.getTokenAccountsByOwner(owner, {
+ programId: TOKEN_PROGRAM_ID,
});
+ for (const { account } of splAccounts.value) {
+ const buf = toBuffer(account.data);
+ if (!buf || buf.length < 72) continue;
+ const mint = new PublicKey(buf.subarray(0, 32));
+ const amount = buf.readBigUInt64LE(64);
+ const mintStr = mint.toBase58();
+ getOrCreate(mintStr).spl += amount;
+ }
} catch {
- // Failed to get SOL balance
+ // No SPL accounts
}
- // Get regular SPL token accounts
+ // 3. Token 2022 accounts
try {
- const tokenAccounts = await rpc.getTokenAccountsByOwner(owner, {
- programId: new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'),
+ const t22Accounts = await rpc.getTokenAccountsByOwner(owner, {
+ programId: TOKEN_2022_PROGRAM_ID,
});
-
- for (const { account, pubkey } of tokenAccounts.value) {
- const data = account.data;
- if (data instanceof Buffer || (typeof data === 'object' && 'length' in data)) {
- // Parse token account data
- const dataBuffer = Buffer.from(data as Uint8Array);
- if (dataBuffer.length >= 72) {
- const mint = new PublicKey(dataBuffer.subarray(0, 32));
- const amount = dataBuffer.readBigUInt64LE(64);
-
- // Get mint info for decimals
- try {
- const mintInfo = await rpc.getAccountInfo(mint);
- const decimals = mintInfo?.data ? (mintInfo.data as Buffer)[44] || 6 : 6;
-
- allBalances.push({
- mint: mint.toBase58(),
- amount: amount.toString(),
- decimals,
- isCompressed: false,
- isNative: false,
- });
- } catch {
- allBalances.push({
- mint: mint.toBase58(),
- amount: amount.toString(),
- decimals: 6,
- isCompressed: false,
- isNative: false,
- });
- }
- }
- }
+ for (const { account } of t22Accounts.value) {
+ const buf = toBuffer(account.data);
+ if (!buf || buf.length < 72) continue;
+ const mint = new PublicKey(buf.subarray(0, 32));
+ const amount = buf.readBigUInt64LE(64);
+ const mintStr = mint.toBase58();
+ getOrCreate(mintStr).t22 += amount;
}
} catch {
- // Failed to get token accounts
+ // No Token 2022 accounts
}
- // Get compressed token accounts
- try {
- const compressedAccounts = await rpc.getCompressedTokenAccountsByOwner(owner);
-
- if (compressedAccounts?.items) {
- const mintAmounts = new Map();
- const mintDecimals = new Map();
-
- for (const item of compressedAccounts.items) {
- if (item?.parsed?.mint && item?.parsed?.amount) {
- const mint = item.parsed.mint.toBase58();
- const amount = BigInt(item.parsed.amount.toString());
- const current = mintAmounts.get(mint) || 0n;
- mintAmounts.set(mint, current + amount);
-
- // Store decimals (assume 6 for now, could fetch from mint)
- if (!mintDecimals.has(mint)) {
- mintDecimals.set(mint, 6);
- }
- }
+ // 4. Hot balance from Light Token associated token account
+ const mintKeys = [...mintMap.keys()];
+ await Promise.allSettled(
+ mintKeys.map(async (mintStr) => {
+ try {
+ const mint = new PublicKey(mintStr);
+ const ata = getAssociatedTokenAddressInterface(mint, owner);
+ const { parsed } = await getAtaInterface(rpc, ata, owner, mint);
+ const entry = getOrCreate(mintStr);
+ entry.hot = BigInt(parsed.amount.toString());
+ } catch {
+ // Associated token account does not exist for this mint — hot stays 0n
}
+ }),
+ );
- for (const [mint, amount] of mintAmounts) {
- allBalances.push({
- mint,
- amount: amount.toString(),
- decimals: mintDecimals.get(mint) || 6,
- isCompressed: true,
- isNative: false,
- });
- }
+ // 5. Cold balance from compressed token accounts
+ try {
+ const compressed = await rpc.getCompressedTokenBalancesByOwnerV2(owner);
+ for (const item of compressed.value.items) {
+ const mintStr = item.mint.toBase58();
+ getOrCreate(mintStr).cold += BigInt(item.balance.toString());
}
} catch {
- // Failed to get compressed accounts
+ // No compressed accounts
}
- // Add fallback tokens with 0 balance if not present
- const hasMint = (mint: string) => allBalances.some(b => b.mint === mint);
-
- if (!hasMint(USDC_MINT)) {
- allBalances.push({
- mint: USDC_MINT,
- amount: '0',
- decimals: 6,
- isCompressed: false,
+ // 6. Assemble TokenBalance[]
+ const result: TokenBalance[] = [];
+
+ // SOL entry
+ result.push({
+ mint: 'So11111111111111111111111111111111111111112',
+ decimals: 9,
+ isNative: true,
+ hot: 0n,
+ cold: 0n,
+ spl: BigInt(solLamports),
+ t22: 0n,
+ unified: 0n,
+ });
+
+ // Token entries
+ for (const [mintStr, entry] of mintMap) {
+ result.push({
+ mint: mintStr,
+ decimals: entry.decimals,
isNative: false,
+ hot: entry.hot,
+ cold: entry.cold,
+ spl: entry.spl,
+ t22: entry.t22,
+ unified: entry.hot + entry.cold,
});
}
- if (!hasMint(TEST_MINT)) {
- allBalances.push({
- mint: TEST_MINT,
- amount: '0',
- decimals: 6,
- isCompressed: false,
- isNative: false,
- });
- }
-
- setBalances(allBalances);
+ setBalances(result);
} catch (error) {
console.error('Failed to fetch balances:', error);
setBalances([]);
@@ -171,4 +152,10 @@ export function useCompressedBalances() {
return { balances, isLoading, fetchBalances };
}
+
+function toBuffer(data: Buffer | Uint8Array | string | unknown): Buffer | null {
+ if (data instanceof Buffer) return data;
+ if (data instanceof Uint8Array) return Buffer.from(data);
+ return null;
+}
```
diff --git a/snippets/code-snippets/privy/compress/nodejs.mdx b/snippets/code-snippets/privy/compress/nodejs.mdx
deleted file mode 100644
index 41e41a3f..00000000
--- a/snippets/code-snippets/privy/compress/nodejs.mdx
+++ /dev/null
@@ -1,89 +0,0 @@
-```typescript
-import 'dotenv/config';
-import {PrivyClient} from '@privy-io/node';
-import {createRpc, bn, selectStateTreeInfo} from '@lightprotocol/stateless.js';
-import {PublicKey, Transaction, ComputeBudgetProgram} from '@solana/web3.js';
-import {getAssociatedTokenAddressSync, getAccount} from '@solana/spl-token';
-import {LightTokenProgram, getTokenPoolInfos, selectTokenPoolInfo} from '@lightprotocol/compressed-token';
-
-const compressTokens = async (
- fromAddress: string,
- toAddress: string,
- tokenMintAddress: string,
- amount: number,
- decimals: number = 6
-) => {
- const connection = createRpc(process.env.HELIUS_RPC_URL!);
-
- const privy = new PrivyClient({
- appId: process.env.PRIVY_APP_ID!,
- appSecret: process.env.PRIVY_APP_SECRET!,
- });
-
- // Create public key objects
- const fromPubkey = new PublicKey(fromAddress);
- const toPubkey = new PublicKey(toAddress);
- const mintPubkey = new PublicKey(tokenMintAddress);
- const tokenAmount = bn(amount * Math.pow(10, decimals));
-
- // Get source token account and verify balance
- const ownerAta = getAssociatedTokenAddressSync(mintPubkey, fromPubkey);
- const ataAccount = await getAccount(connection, ownerAta);
- if (ataAccount.amount < BigInt(tokenAmount.toString())) {
- throw new Error('Insufficient SPL balance');
- }
-
- // Get state tree to store compressed tokens
- // Get SPL interface info. SPL tokens are stored in the interface PDA when compressed.
- const stateTreeInfos = await connection.getStateTreeInfos();
- const selectedTreeInfo = selectStateTreeInfo(stateTreeInfos);
- const tokenPoolInfos = await getTokenPoolInfos(connection, mintPubkey);
- const tokenPoolInfo = selectTokenPoolInfo(tokenPoolInfos);
-
- // Create compress instruction
- const instruction = await LightTokenProgram.compress({
- payer: fromPubkey,
- owner: fromPubkey,
- source: ownerAta,
- toAddress: toPubkey,
- mint: mintPubkey,
- amount: tokenAmount,
- outputStateTreeInfo: selectedTreeInfo,
- tokenPoolInfo,
- });
-
- // Create transaction
- const transaction = new Transaction();
- transaction.add(ComputeBudgetProgram.setComputeUnitLimit({units: 300_000}));
- transaction.add(instruction);
-
- // Get recent blockhash
- const {blockhash} = await connection.getLatestBlockhash();
- transaction.recentBlockhash = blockhash;
- transaction.feePayer = fromPubkey;
-
- // Sign with Privy
- const signResult = await privy.wallets().solana().signTransaction(process.env.TREASURY_WALLET_ID!, {
- transaction: transaction.serialize({requireAllSignatures: false}),
- authorization_context: {
- authorization_private_keys: [process.env.TREASURY_AUTHORIZATION_KEY!]
- }
- });
- const signedTx = (signResult as any).signed_transaction || signResult.signedTransaction;
- if (!signedTx) {
- throw new Error('Privy returned invalid response: ' + JSON.stringify(signResult));
- }
- const signedTransaction = Buffer.from(signedTx, 'base64');
-
- // Send transaction
- const signature = await connection.sendRawTransaction(signedTransaction, {
- skipPreflight: false,
- preflightCommitment: 'confirmed'
- });
- await connection.confirmTransaction(signature, 'confirmed');
-
- return signature;
-};
-
-export default compressTokens;
-```
diff --git a/snippets/code-snippets/privy/compress/react.mdx b/snippets/code-snippets/privy/compress/react.mdx
deleted file mode 100644
index 5adfc1e4..00000000
--- a/snippets/code-snippets/privy/compress/react.mdx
+++ /dev/null
@@ -1,106 +0,0 @@
-```typescript
-import { useState } from 'react';
-import { PublicKey, Transaction, ComputeBudgetProgram } from '@solana/web3.js';
-import { getAssociatedTokenAddressSync, getAccount } from '@solana/spl-token';
-import { bn, createRpc, selectStateTreeInfo } from '@lightprotocol/stateless.js';
-import { LightTokenProgram, getTokenPoolInfos, selectTokenPoolInfo } from '@lightprotocol/compressed-token';
-import type { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
-import type { SignTransactionResult } from '@privy-io/react-auth/solana';
-
-export interface CompressParams {
- ownerPublicKey: string;
- toAddress: string;
- mint: string;
- amount: number;
- decimals?: number;
-}
-
-export interface CompressArgs {
- params: CompressParams;
- wallet: ConnectedStandardSolanaWallet;
- signTransaction: (args: {
- transaction: Buffer;
- wallet: ConnectedStandardSolanaWallet;
- chain: string;
- }) => Promise;
-}
-
-export function useCompress() {
- const [isLoading, setIsLoading] = useState(false);
-
- const compress = async (args: CompressArgs): Promise => {
- setIsLoading(true);
-
- try {
- const { params, wallet, signTransaction } = args;
- const { ownerPublicKey, toAddress, mint, amount, decimals = 6 } = params;
-
- // Create RPC connection
- const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
-
- // Create public key objects
- const ownerPubkey = new PublicKey(ownerPublicKey);
- const toPubkey = new PublicKey(toAddress);
- const mintPubkey = new PublicKey(mint);
- const tokenAmount = bn(amount * Math.pow(10, decimals));
-
- // Get source token account and verify balance
- const ownerAta = getAssociatedTokenAddressSync(mintPubkey, ownerPubkey);
- const ataAccount = await getAccount(rpc, ownerAta);
- if (ataAccount.amount < BigInt(tokenAmount.toString())) {
- throw new Error('Insufficient SPL balance');
- }
-
- // Get state tree to store compressed tokens
- // Get SPL interface info. SPL tokens are stored in the interface PDA when compressed.
- const stateTreeInfos = await rpc.getStateTreeInfos();
- const selectedTreeInfo = selectStateTreeInfo(stateTreeInfos);
- const tokenPoolInfos = await getTokenPoolInfos(rpc, mintPubkey);
- const tokenPoolInfo = selectTokenPoolInfo(tokenPoolInfos);
-
- // Create compress instruction
- const instruction = await LightTokenProgram.compress({
- payer: ownerPubkey,
- owner: ownerPubkey,
- source: ownerAta,
- toAddress: toPubkey,
- mint: mintPubkey,
- amount: tokenAmount,
- outputStateTreeInfo: selectedTreeInfo,
- tokenPoolInfo,
- });
-
- // Build transaction
- const { blockhash } = await rpc.getLatestBlockhash();
- const transaction = new Transaction();
- transaction.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }));
- transaction.add(instruction);
- transaction.recentBlockhash = blockhash;
- transaction.feePayer = ownerPubkey;
-
- // Serialize unsigned transaction
- const unsignedTxBuffer = transaction.serialize({ requireAllSignatures: false });
-
- // Sign with Privy
- const signedTx = await signTransaction({
- transaction: unsignedTxBuffer,
- wallet,
- chain: 'solana:devnet',
- });
-
- // Send transaction
- const signedTxBuffer = Buffer.from(signedTx.signedTransaction);
- const signature = await rpc.sendRawTransaction(signedTxBuffer, {
- skipPreflight: false,
- preflightCommitment: 'confirmed',
- });
-
- return signature;
- } finally {
- setIsLoading(false);
- }
- };
-
- return { compress, isLoading };
-}
-```
diff --git a/snippets/code-snippets/privy/decompress/nodejs.mdx b/snippets/code-snippets/privy/decompress/nodejs.mdx
deleted file mode 100644
index 6f722014..00000000
--- a/snippets/code-snippets/privy/decompress/nodejs.mdx
+++ /dev/null
@@ -1,81 +0,0 @@
-```typescript
-import 'dotenv/config';
-import {PrivyClient} from '@privy-io/node';
-import {createRpc} from '@lightprotocol/stateless.js';
-import {Keypair, PublicKey, Transaction} from '@solana/web3.js';
-import {getAssociatedTokenAddressSync, createAssociatedTokenAccount} from '@solana/spl-token';
-import {decompress} from '@lightprotocol/compressed-token';
-
-const decompressTokens = async (
- fromAddress: string,
- tokenMintAddress: string,
- amount: number,
- decimals: number = 6
-) => {
- const connection = createRpc(process.env.HELIUS_RPC_URL!);
-
- const privy = new PrivyClient({
- appId: process.env.PRIVY_APP_ID!,
- appSecret: process.env.PRIVY_APP_SECRET!,
- });
-
- const fromPubkey = new PublicKey(fromAddress);
- const mintPubkey = new PublicKey(tokenMintAddress);
- const rawAmount = amount * Math.pow(10, decimals);
-
- // Get destination ATA
- const ownerAta = getAssociatedTokenAddressSync(mintPubkey, fromPubkey);
-
- // Check ATA exists (decompress action will handle creation internally)
- // But we need to be aware ATA creation requires a separate signer
-
- // Create fake keypair for decompress action (only publicKey is used)
- const dummyPayer = {
- publicKey: fromPubkey,
- secretKey: new Uint8Array(64),
- } as any;
-
- // Intercept sendAndConfirmTransaction to use Privy signing
- const originalSendAndConfirm = (connection as any).sendAndConfirmTransaction;
- (connection as any).sendAndConfirmTransaction = async (tx: Transaction, signers: any[]) => {
- const signResult = await privy.wallets().solana().signTransaction(process.env.TREASURY_WALLET_ID!, {
- transaction: tx.serialize({requireAllSignatures: false}),
- authorization_context: {
- authorization_private_keys: [process.env.TREASURY_AUTHORIZATION_KEY!]
- }
- });
-
- const signedTx = (signResult as any).signed_transaction || signResult.signedTransaction;
- if (!signedTx) {
- throw new Error('Privy returned invalid response');
- }
-
- const signedTransaction = Buffer.from(signedTx, 'base64');
- const signature = await connection.sendRawTransaction(signedTransaction, {
- skipPreflight: false,
- preflightCommitment: 'confirmed'
- });
- await connection.confirmTransaction(signature, 'confirmed');
- return signature;
- };
-
- try {
- // Use high-level decompress action (handles account configuration correctly)
- const signature = await decompress(
- connection,
- dummyPayer,
- mintPubkey,
- rawAmount,
- dummyPayer,
- ownerAta
- );
-
- return signature;
- } finally {
- // Restore original function
- (connection as any).sendAndConfirmTransaction = originalSendAndConfirm;
- }
-};
-
-export default decompressTokens;
-```
diff --git a/snippets/code-snippets/privy/decompress/react.mdx b/snippets/code-snippets/privy/decompress/react.mdx
deleted file mode 100644
index 193761e8..00000000
--- a/snippets/code-snippets/privy/decompress/react.mdx
+++ /dev/null
@@ -1,124 +0,0 @@
-```typescript
-import { useState } from 'react';
-import { PublicKey, Transaction, ComputeBudgetProgram } from '@solana/web3.js';
-import { getAssociatedTokenAddressSync, createAssociatedTokenAccountInstruction, getAccount, TokenAccountNotFoundError } from '@solana/spl-token';
-import { LightTokenProgram, selectMinCompressedTokenAccountsForTransfer, getSplInterfaceInfos, selectSplInterfaceInfosForDecompression } from '@lightprotocol/compressed-token';
-import { bn, createRpc } from '@lightprotocol/stateless.js';
-import type { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
-import type { SignTransactionResult } from '@privy-io/react-auth/solana';
-
-export interface DecompressParams {
- ownerPublicKey: string;
- mint: string;
- amount: number;
- decimals?: number;
-}
-
-export interface DecompressArgs {
- params: DecompressParams;
- wallet: ConnectedStandardSolanaWallet;
- signTransaction: (args: {
- transaction: Buffer;
- wallet: ConnectedStandardSolanaWallet;
- chain: string;
- }) => Promise;
-}
-
-export function useDecompress() {
- const [isLoading, setIsLoading] = useState(false);
-
- const decompress = async (args: DecompressArgs): Promise => {
- setIsLoading(true);
-
- try {
- const { params, wallet, signTransaction } = args;
- const { ownerPublicKey, mint, amount, decimals = 6 } = params;
-
- // Create RPC connection
- const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
-
- const owner = new PublicKey(ownerPublicKey);
- const mintPubkey = new PublicKey(mint);
- const tokenAmount = bn(Math.floor(amount * Math.pow(10, decimals)));
-
- // Get destination ATA
- const destinationAta = getAssociatedTokenAddressSync(mintPubkey, owner);
-
- // Get compressed token accounts
- const accounts = await rpc.getCompressedTokenAccountsByOwner(owner, { mint: mintPubkey });
- if (!accounts.items || accounts.items.length === 0) {
- throw new Error('No compressed token accounts found');
- }
-
- // Select minimum accounts needed
- const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(accounts.items, tokenAmount);
- if (inputAccounts.length === 0) {
- throw new Error('Insufficient compressed balance');
- }
-
- // Get validity proof and SPL interface info
- const proof = await rpc.getValidityProof(
- inputAccounts.map((account) => bn(account.compressedAccount.hash))
- );
- const splInterfaceInfos = await getSplInterfaceInfos(rpc, mintPubkey);
- const tokenPoolInfos = selectSplInterfaceInfosForDecompression(splInterfaceInfos, tokenAmount);
-
- // Build transaction
- const { blockhash } = await rpc.getLatestBlockhash();
- const transaction = new Transaction();
- transaction.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 }));
-
- // Create ATA if needed
- try {
- await getAccount(rpc, destinationAta);
- } catch (e) {
- if (e instanceof TokenAccountNotFoundError) {
- transaction.add(
- createAssociatedTokenAccountInstruction(owner, destinationAta, owner, mintPubkey)
- );
- } else {
- throw e;
- }
- }
-
- // Build decompress instruction
- const decompressIx = await LightTokenProgram.decompress({
- payer: owner,
- inputCompressedTokenAccounts: inputAccounts,
- toAddress: destinationAta,
- amount: tokenAmount,
- recentInputStateRootIndices: proof.rootIndices,
- recentValidityProof: proof.compressedProof,
- tokenPoolInfos,
- });
-
- transaction.add(decompressIx);
- transaction.recentBlockhash = blockhash;
- transaction.feePayer = owner;
-
- // Serialize unsigned transaction
- const unsignedTxBuffer = transaction.serialize({ requireAllSignatures: false });
-
- // Sign with Privy
- const signedTx = await signTransaction({
- transaction: unsignedTxBuffer,
- wallet,
- chain: 'solana:devnet',
- });
-
- // Send transaction
- const signedTxBuffer = Buffer.from(signedTx.signedTransaction);
- const signature = await rpc.sendRawTransaction(signedTxBuffer, {
- skipPreflight: false,
- preflightCommitment: 'confirmed',
- });
-
- return signature;
- } finally {
- setIsLoading(false);
- }
- };
-
- return { decompress, isLoading };
-}
-```
diff --git a/snippets/code-snippets/privy/helpers/sign-and-send-batches.mdx b/snippets/code-snippets/privy/helpers/sign-and-send-batches.mdx
new file mode 100644
index 00000000..082607d7
--- /dev/null
+++ b/snippets/code-snippets/privy/helpers/sign-and-send-batches.mdx
@@ -0,0 +1,46 @@
+```typescript
+import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js';
+import type { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
+import { useSignTransaction } from '@privy-io/react-auth/solana';
+
+type SignTransactionFn = ReturnType['signTransaction'];
+
+interface SignAndSendOptions {
+ rpc: any;
+ feePayer: PublicKey;
+ wallet: ConnectedStandardSolanaWallet;
+ signTransaction: SignTransactionFn;
+}
+
+export async function signAndSendBatches(
+ instructionBatches: TransactionInstruction[][],
+ options: SignAndSendOptions,
+): Promise {
+ const { rpc, feePayer, wallet, signTransaction } = options;
+ const signatures: string[] = [];
+
+ for (const ixs of instructionBatches) {
+ const tx = new Transaction().add(...ixs);
+ const { blockhash } = await rpc.getLatestBlockhash();
+ tx.recentBlockhash = blockhash;
+ tx.feePayer = feePayer;
+
+ const unsignedTxBuffer = tx.serialize({ requireAllSignatures: false });
+ const signedTx = await signTransaction({
+ transaction: unsignedTxBuffer,
+ wallet,
+ chain: 'solana:devnet',
+ });
+
+ const signedTxBuffer = Buffer.from(signedTx.signedTransaction);
+ const sig = await rpc.sendRawTransaction(signedTxBuffer, {
+ skipPreflight: false,
+ preflightCommitment: 'confirmed',
+ });
+ await rpc.confirmTransaction(sig, 'confirmed');
+ signatures.push(sig);
+ }
+
+ return signatures.length > 0 ? signatures[signatures.length - 1] : null;
+}
+```
diff --git a/snippets/code-snippets/privy/transaction-history/nodejs.mdx b/snippets/code-snippets/privy/transaction-history/nodejs.mdx
index 9d58855f..00fce8c1 100644
--- a/snippets/code-snippets/privy/transaction-history/nodejs.mdx
+++ b/snippets/code-snippets/privy/transaction-history/nodejs.mdx
@@ -6,63 +6,36 @@ import {PublicKey} from '@solana/web3.js';
const getTransactionHistory = async (
ownerAddress: string,
limit: number = 10,
- includeDetails: boolean = false
) => {
const connection = createRpc(process.env.HELIUS_RPC_URL!);
const owner = new PublicKey(ownerAddress);
- // Get compression signatures for token owner
- const signatures = await connection.getCompressionSignaturesForTokenOwner(owner);
+ // Get Light Token interface signatures
+ const result = await connection.getSignaturesForOwnerInterface(owner);
- if (signatures.items.length === 0) {
+ if (!result.signatures || result.signatures.length === 0) {
return {
count: 0,
transactions: [],
};
}
- // Limit results
- const limitedSignatures = signatures.items.slice(0, limit);
+ const limitedSignatures = result.signatures.slice(0, limit);
- // Get detailed info if requested
- if (includeDetails && limitedSignatures.length > 0) {
- const transactions = await Promise.all(
- limitedSignatures.map(async (sig) => {
- const txInfo = await connection.getTransactionWithCompressionInfo(sig.signature);
-
- return {
- signature: sig.signature,
- slot: sig.slot,
- blockTime: sig.blockTime,
- timestamp: new Date(sig.blockTime * 1000).toISOString(),
- compressionInfo: txInfo?.compressionInfo ? {
- closedAccounts: txInfo.compressionInfo.closedAccounts.length,
- openedAccounts: txInfo.compressionInfo.openedAccounts.length,
- } : null,
- };
- })
- );
-
- return {
- count: signatures.items.length,
- transactions,
- };
- }
-
- // Return basic signature info
const transactions = limitedSignatures.map((sig) => ({
signature: sig.signature,
slot: sig.slot,
- blockTime: sig.blockTime,
- timestamp: new Date(sig.blockTime * 1000).toISOString(),
+ blockTime: sig.blockTime ?? 0,
+ timestamp: sig.blockTime ? new Date(sig.blockTime * 1000).toISOString() : '',
}));
return {
- count: signatures.items.length,
+ count: result.signatures.length,
transactions,
};
};
export default getTransactionHistory;
+
```
diff --git a/snippets/code-snippets/privy/transaction-history/react.mdx b/snippets/code-snippets/privy/transaction-history/react.mdx
index b7fe5611..1c98218e 100644
--- a/snippets/code-snippets/privy/transaction-history/react.mdx
+++ b/snippets/code-snippets/privy/transaction-history/react.mdx
@@ -3,17 +3,11 @@ import { useState, useCallback } from 'react';
import { PublicKey } from '@solana/web3.js';
import { createRpc } from '@lightprotocol/stateless.js';
-export interface TransactionCompressionInfo {
- closedAccounts: number;
- openedAccounts: number;
-}
-
export interface Transaction {
signature: string;
slot: number;
blockTime: number;
timestamp: string;
- compressionInfo?: TransactionCompressionInfo | null;
}
export function useTransactionHistory() {
@@ -25,7 +19,6 @@ export function useTransactionHistory() {
async (
ownerAddress: string,
limit: number = 10,
- includeDetails: boolean = false
) => {
if (!ownerAddress) {
setTransactions([]);
@@ -39,44 +32,20 @@ export function useTransactionHistory() {
const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
const owner = new PublicKey(ownerAddress);
- const signatures = await rpc.getCompressionSignaturesForTokenOwner(owner);
+ const result = await rpc.getSignaturesForOwnerInterface(owner);
- if (signatures.items.length === 0) {
+ if (!result.signatures || result.signatures.length === 0) {
setTransactions([]);
return;
}
- const limitedSignatures = signatures.items.slice(0, limit);
-
- if (includeDetails && limitedSignatures.length > 0) {
- const transactionsWithDetails = await Promise.all(
- limitedSignatures.map(async (sig) => {
- const txInfo = await rpc.getTransactionWithCompressionInfo(sig.signature);
-
- return {
- signature: sig.signature,
- slot: sig.slot,
- blockTime: sig.blockTime,
- timestamp: new Date(sig.blockTime * 1000).toISOString(),
- compressionInfo: txInfo?.compressionInfo
- ? {
- closedAccounts: txInfo.compressionInfo.closedAccounts.length,
- openedAccounts: txInfo.compressionInfo.openedAccounts.length,
- }
- : null,
- };
- })
- );
-
- setTransactions(transactionsWithDetails);
- return;
- }
+ const limitedSignatures = result.signatures.slice(0, limit);
const basicTransactions = limitedSignatures.map((sig) => ({
signature: sig.signature,
slot: sig.slot,
- blockTime: sig.blockTime,
- timestamp: new Date(sig.blockTime * 1000).toISOString(),
+ blockTime: sig.blockTime ?? 0,
+ timestamp: sig.blockTime ? new Date(sig.blockTime * 1000).toISOString() : '',
}));
setTransactions(basicTransactions);
diff --git a/snippets/code-snippets/privy/transfer/nodejs.mdx b/snippets/code-snippets/privy/transfer/nodejs.mdx
index 0d4134b8..4a0844e4 100644
--- a/snippets/code-snippets/privy/transfer/nodejs.mdx
+++ b/snippets/code-snippets/privy/transfer/nodejs.mdx
@@ -1,16 +1,18 @@
```typescript
import 'dotenv/config';
import {PrivyClient} from '@privy-io/node';
-import {createRpc, bn} from '@lightprotocol/stateless.js';
-import {PublicKey, Transaction, ComputeBudgetProgram} from '@solana/web3.js';
-import {LightTokenProgram, selectMinCompressedTokenAccountsForTransfer} from '@lightprotocol/compressed-token';
+import {createRpc} from '@lightprotocol/stateless.js';
+import {PublicKey, Transaction} from '@solana/web3.js';
+import {
+ createTransferInterfaceInstructions,
+} from '@lightprotocol/compressed-token/unified';
-const transferCompressedTokens = async (
+const transferLightTokens = async (
fromAddress: string,
toAddress: string,
tokenMintAddress: string,
amount: number,
- decimals: number = 6
+ decimals: number = 9,
) => {
const connection = createRpc(process.env.HELIUS_RPC_URL!);
@@ -19,69 +21,46 @@ const transferCompressedTokens = async (
appSecret: process.env.PRIVY_APP_SECRET!,
});
- // Create public key objects
const fromPubkey = new PublicKey(fromAddress);
const toPubkey = new PublicKey(toAddress);
const mintPubkey = new PublicKey(tokenMintAddress);
- const tokenAmount = bn(amount * Math.pow(10, decimals));
+ const tokenAmount = Math.floor(amount * Math.pow(10, decimals));
- // Get compressed token accounts (filter out null items from indexer)
- const accounts = await connection.getCompressedTokenAccountsByOwner(fromPubkey, {mint: mintPubkey});
- const validItems = (accounts.items || []).filter((item): item is NonNullable => item !== null);
- if (validItems.length === 0) {
- throw new Error('No compressed token accounts found');
- }
-
- // Select minimum accounts needed for transfer
- const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(validItems, tokenAmount);
- if (inputAccounts.length === 0) {
- throw new Error('Insufficient balance');
- }
+ // Loads cold (compressed), SPL, and Token 2022 balances into the Light Token associated token account before transfer.
+ // Returns TransactionInstruction[][] — send [0..n-2] in parallel, then [n-1] last.
+ const instructions = await createTransferInterfaceInstructions(
+ connection, fromPubkey, mintPubkey, tokenAmount, fromPubkey, toPubkey,
+ );
- // Get validity proof to prove compressed token accounts exist in state tree.
- const proof = await connection.getValidityProof(inputAccounts.map(account => bn(account.compressedAccount.hash)));
-
- // Create transfer instruction
- const instruction = await LightTokenProgram.transfer({
- payer: fromPubkey,
- inputCompressedTokenAccounts: inputAccounts,
- toAddress: toPubkey,
- amount: tokenAmount,
- recentInputStateRootIndices: proof.rootIndices,
- recentValidityProof: proof.compressedProof,
- });
+ // Sign and send each batch via Privy
+ const walletId = process.env.TREASURY_WALLET_ID!;
+ const authorizationKey = process.env.TREASURY_AUTHORIZATION_KEY!;
+ const signatures: string[] = [];
- // Create transaction
- const transaction = new Transaction();
- transaction.add(ComputeBudgetProgram.setComputeUnitLimit({units: 300_000}));
- transaction.add(instruction);
+ for (const ixs of instructions) {
+ const tx = new Transaction().add(...ixs);
+ const {blockhash} = await connection.getLatestBlockhash();
+ tx.recentBlockhash = blockhash;
+ tx.feePayer = fromPubkey;
- // Get recent blockhash
- const {blockhash} = await connection.getLatestBlockhash();
- transaction.recentBlockhash = blockhash;
- transaction.feePayer = fromPubkey;
+ const {signed_transaction} = await privy.wallets().solana().signTransaction(
+ walletId, {
+ transaction: tx.serialize({requireAllSignatures: false}),
+ authorization_context: {authorization_private_keys: [authorizationKey]},
+ },
+ ) as any;
- // Sign with Privy
- const signResult = await privy.wallets().solana().signTransaction(process.env.TREASURY_WALLET_ID!, {
- transaction: transaction.serialize({requireAllSignatures: false}),
- authorization_context: {
- authorization_private_keys: [process.env.TREASURY_AUTHORIZATION_KEY!]
- }
- });
- const signedTx = (signResult as any).signed_transaction || signResult.signedTransaction;
- if (!signedTx) {
- throw new Error('Privy returned invalid response: ' + JSON.stringify(signResult));
+ const sig = await connection.sendRawTransaction(
+ Buffer.from(signed_transaction, 'base64'),
+ {skipPreflight: false, preflightCommitment: 'confirmed'},
+ );
+ await connection.confirmTransaction(sig, 'confirmed');
+ signatures.push(sig);
}
- const signedTransaction = Buffer.from(signedTx, 'base64');
-
- // Send transaction
- const signature = await connection.sendRawTransaction(signedTransaction, {
- skipPreflight: false,
- preflightCommitment: 'confirmed'
- });
- await connection.confirmTransaction(signature, 'confirmed');
- return signature;
+ return signatures[signatures.length - 1];
};
-export default transferCompressedTokens;```
+export default transferLightTokens;
+
+```
diff --git a/snippets/code-snippets/privy/transfer/react.mdx b/snippets/code-snippets/privy/transfer/react.mdx
index c532013b..e5a3e715 100644
--- a/snippets/code-snippets/privy/transfer/react.mdx
+++ b/snippets/code-snippets/privy/transfer/react.mdx
@@ -1,10 +1,15 @@
```typescript
import { useState } from 'react';
-import { PublicKey, Transaction, ComputeBudgetProgram } from '@solana/web3.js';
-import { LightTokenProgram, selectMinCompressedTokenAccountsForTransfer } from '@lightprotocol/compressed-token';
-import { bn, createRpc } from '@lightprotocol/stateless.js';
+import { PublicKey } from '@solana/web3.js';
+import {
+ createTransferInterfaceInstructions,
+} from '@lightprotocol/compressed-token/unified';
+import { createRpc } from '@lightprotocol/stateless.js';
import type { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
-import type { SignTransactionResult } from '@privy-io/react-auth/solana';
+import { useSignTransaction } from '@privy-io/react-auth/solana';
+import { signAndSendBatches } from './signAndSendBatches';
+
+type SignTransactionFn = ReturnType['signTransaction'];
export interface TransferParams {
ownerPublicKey: string;
@@ -17,11 +22,7 @@ export interface TransferParams {
export interface TransferArgs {
params: TransferParams;
wallet: ConnectedStandardSolanaWallet;
- signTransaction: (args: {
- transaction: Buffer;
- wallet: ConnectedStandardSolanaWallet;
- chain: string;
- }) => Promise;
+ signTransaction: SignTransactionFn;
}
export function useTransfer() {
@@ -32,67 +33,32 @@ export function useTransfer() {
try {
const { params, wallet, signTransaction } = args;
- const { ownerPublicKey, mint, toAddress, amount, decimals = 6 } = params;
+ const { ownerPublicKey, mint, toAddress, amount, decimals = 9 } = params;
- // Create RPC connection
const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
const owner = new PublicKey(ownerPublicKey);
const mintPubkey = new PublicKey(mint);
const recipient = new PublicKey(toAddress);
- const tokenAmount = bn(Math.floor(amount * Math.pow(10, decimals)));
-
- // Get compressed token accounts
- const accounts = await rpc.getCompressedTokenAccountsByOwner(owner, { mint: mintPubkey });
- if (!accounts.items || accounts.items.length === 0) {
- throw new Error('No compressed token accounts found');
- }
+ const tokenAmount = Math.floor(amount * Math.pow(10, decimals));
- // Select minimum accounts needed
- const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(accounts.items, tokenAmount);
- if (inputAccounts.length === 0) {
- throw new Error('Insufficient balance');
- }
-
- // Get validity proof
- const proof = await rpc.getValidityProof(
- inputAccounts.map((account) => bn(account.compressedAccount.hash))
+ // Returns TransactionInstruction[][].
+ // Each inner array is one transaction.
+ // Almost always returns just one.
+ const instructions = await createTransferInterfaceInstructions(
+ rpc, owner, mintPubkey, tokenAmount, owner, recipient,
);
- // Build transfer instruction
- const transferIx = await LightTokenProgram.transfer({
- payer: owner,
- inputCompressedTokenAccounts: inputAccounts,
- toAddress: recipient,
- amount: tokenAmount,
- recentInputStateRootIndices: proof.rootIndices,
- recentValidityProof: proof.compressedProof,
- });
-
- // Build transaction
- const { blockhash } = await rpc.getLatestBlockhash();
- const transaction = new Transaction();
- transaction.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }));
- transaction.add(transferIx);
- transaction.recentBlockhash = blockhash;
- transaction.feePayer = owner;
-
- // Serialize unsigned transaction
- const unsignedTxBuffer = transaction.serialize({ requireAllSignatures: false });
-
- // Sign with Privy
- const signedTx = await signTransaction({
- transaction: unsignedTxBuffer,
+ const signature = await signAndSendBatches(instructions, {
+ rpc,
+ feePayer: owner,
wallet,
- chain: 'solana:devnet',
+ signTransaction,
});
- // Send transaction
- const signedTxBuffer = Buffer.from(signedTx.signedTransaction);
- const signature = await rpc.sendRawTransaction(signedTxBuffer, {
- skipPreflight: false,
- preflightCommitment: 'confirmed',
- });
+ if (!signature) {
+ throw new Error('Transfer returned no instructions');
+ }
return signature;
} finally {
diff --git a/snippets/code-snippets/privy/unwrap/nodejs.mdx b/snippets/code-snippets/privy/unwrap/nodejs.mdx
new file mode 100644
index 00000000..1bc631e2
--- /dev/null
+++ b/snippets/code-snippets/privy/unwrap/nodejs.mdx
@@ -0,0 +1,74 @@
+```typescript
+import 'dotenv/config';
+import {PrivyClient} from '@privy-io/node';
+import {createRpc} from '@lightprotocol/stateless.js';
+import {PublicKey, Transaction} from '@solana/web3.js';
+import {getAssociatedTokenAddressSync} from '@solana/spl-token';
+import {
+ createUnwrapInstructions,
+} from '@lightprotocol/compressed-token/unified';
+
+const unwrapTokens = async (
+ fromAddress: string,
+ tokenMintAddress: string,
+ amount: number,
+ decimals: number = 9,
+) => {
+ const connection = createRpc(process.env.HELIUS_RPC_URL!);
+
+ const privy = new PrivyClient({
+ appId: process.env.PRIVY_APP_ID!,
+ appSecret: process.env.PRIVY_APP_SECRET!,
+ });
+
+ const fromPubkey = new PublicKey(fromAddress);
+ const mintPubkey = new PublicKey(tokenMintAddress);
+ const tokenAmount = BigInt(Math.floor(amount * Math.pow(10, decimals)));
+
+ // Auto-detect token program (SPL vs Token 2022) from mint account owner
+ const mintAccountInfo = await connection.getAccountInfo(mintPubkey);
+ if (!mintAccountInfo) throw new Error(`Mint account ${tokenMintAddress} not found`);
+ const tokenProgramId = mintAccountInfo.owner;
+
+ // Destination: SPL/T22 associated token account
+ const splAta = getAssociatedTokenAddressSync(mintPubkey, fromPubkey, false, tokenProgramId);
+
+ // Returns TransactionInstruction[][].
+ // Each inner array is one transaction.
+ // Handles loading + unwrapping together.
+ const instructions = await createUnwrapInstructions(
+ connection, splAta, fromPubkey, mintPubkey, tokenAmount, fromPubkey,
+ );
+
+ // Sign and send each batch via Privy
+ const walletId = process.env.TREASURY_WALLET_ID!;
+ const authorizationKey = process.env.TREASURY_AUTHORIZATION_KEY!;
+ const signatures: string[] = [];
+
+ for (const ixs of instructions) {
+ const tx = new Transaction().add(...ixs);
+ const {blockhash} = await connection.getLatestBlockhash();
+ tx.recentBlockhash = blockhash;
+ tx.feePayer = fromPubkey;
+
+ const {signed_transaction} = await privy.wallets().solana().signTransaction(
+ walletId, {
+ transaction: tx.serialize({requireAllSignatures: false}),
+ authorization_context: {authorization_private_keys: [authorizationKey]},
+ },
+ ) as any;
+
+ const sig = await connection.sendRawTransaction(
+ Buffer.from(signed_transaction, 'base64'),
+ {skipPreflight: false, preflightCommitment: 'confirmed'},
+ );
+ await connection.confirmTransaction(sig, 'confirmed');
+ signatures.push(sig);
+ }
+
+ return signatures[signatures.length - 1];
+};
+
+export default unwrapTokens;
+
+```
diff --git a/snippets/code-snippets/privy/unwrap/react.mdx b/snippets/code-snippets/privy/unwrap/react.mdx
new file mode 100644
index 00000000..cf5def70
--- /dev/null
+++ b/snippets/code-snippets/privy/unwrap/react.mdx
@@ -0,0 +1,78 @@
+```typescript
+import { useState } from 'react';
+import { PublicKey } from '@solana/web3.js';
+import { getAssociatedTokenAddressSync } from '@solana/spl-token';
+import {
+ createUnwrapInstructions,
+} from '@lightprotocol/compressed-token/unified';
+import { createRpc } from '@lightprotocol/stateless.js';
+import type { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
+import { useSignTransaction } from '@privy-io/react-auth/solana';
+import { signAndSendBatches } from './signAndSendBatches';
+
+type SignTransactionFn = ReturnType['signTransaction'];
+
+export interface UnwrapParams {
+ ownerPublicKey: string;
+ mint: string;
+ amount: number;
+ decimals?: number;
+}
+
+export interface UnwrapArgs {
+ params: UnwrapParams;
+ wallet: ConnectedStandardSolanaWallet;
+ signTransaction: SignTransactionFn;
+}
+
+export function useUnwrap() {
+ const [isLoading, setIsLoading] = useState(false);
+
+ const unwrap = async (args: UnwrapArgs): Promise => {
+ setIsLoading(true);
+
+ try {
+ const { params, wallet, signTransaction } = args;
+ const { ownerPublicKey, mint, amount, decimals = 9 } = params;
+
+ const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
+
+ const owner = new PublicKey(ownerPublicKey);
+ const mintPubkey = new PublicKey(mint);
+ const tokenAmount = BigInt(Math.floor(amount * Math.pow(10, decimals)));
+
+ // Auto-detect token program (SPL vs T22) from mint account owner
+ const mintAccountInfo = await rpc.getAccountInfo(mintPubkey);
+ if (!mintAccountInfo) throw new Error(`Mint account ${mint} not found`);
+ const tokenProgramId = mintAccountInfo.owner;
+
+ // Destination: SPL/T22 associated token account
+ const splAta = getAssociatedTokenAddressSync(mintPubkey, owner, false, tokenProgramId);
+
+ // Returns TransactionInstruction[][].
+ // Each inner array is one transaction.
+ // Handles loading + unwrapping together.
+ const instructions = await createUnwrapInstructions(
+ rpc, splAta, owner, mintPubkey, tokenAmount, owner,
+ );
+
+ const signature = await signAndSendBatches(instructions, {
+ rpc,
+ feePayer: owner,
+ wallet,
+ signTransaction,
+ });
+
+ if (!signature) {
+ throw new Error('Unwrap returned no instructions');
+ }
+
+ return signature;
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ return { unwrap, isLoading };
+}
+```
diff --git a/snippets/code-snippets/privy/wrap/nodejs.mdx b/snippets/code-snippets/privy/wrap/nodejs.mdx
new file mode 100644
index 00000000..bf34ca1c
--- /dev/null
+++ b/snippets/code-snippets/privy/wrap/nodejs.mdx
@@ -0,0 +1,87 @@
+```typescript
+import 'dotenv/config';
+import {PrivyClient} from '@privy-io/node';
+import {createRpc, CTOKEN_PROGRAM_ID} from '@lightprotocol/stateless.js';
+import {PublicKey, Transaction, ComputeBudgetProgram} from '@solana/web3.js';
+import {getAssociatedTokenAddressSync, getAccount} from '@solana/spl-token';
+import {getSplInterfaceInfos} from '@lightprotocol/compressed-token';
+import {
+ createWrapInstruction,
+ getAssociatedTokenAddressInterface,
+ createAssociatedTokenAccountInterfaceIdempotentInstruction,
+} from '@lightprotocol/compressed-token/unified';
+
+const wrapTokens = async (
+ fromAddress: string,
+ tokenMintAddress: string,
+ amount: number,
+ decimals: number = 9,
+) => {
+ const connection = createRpc(process.env.HELIUS_RPC_URL!);
+
+ const privy = new PrivyClient({
+ appId: process.env.PRIVY_APP_ID!,
+ appSecret: process.env.PRIVY_APP_SECRET!,
+ });
+
+ const fromPubkey = new PublicKey(fromAddress);
+ const mintPubkey = new PublicKey(tokenMintAddress);
+ const tokenAmount = BigInt(Math.floor(amount * Math.pow(10, decimals)));
+
+ // Get SPL interface info — determines whether mint uses SPL or Token 2022
+ const splInterfaceInfos = await getSplInterfaceInfos(connection, mintPubkey);
+ const splInterfaceInfo = splInterfaceInfos.find(
+ (info) => info.isInitialized,
+ );
+ if (!splInterfaceInfo) throw new Error('No SPL interface found for this mint');
+
+ // Derive source associated token account using the mint's token program (SPL or Token 2022)
+ const {tokenProgram} = splInterfaceInfo;
+ const splAta = getAssociatedTokenAddressSync(mintPubkey, fromPubkey, false, tokenProgram);
+ const ataAccount = await getAccount(connection, splAta, undefined, tokenProgram);
+ if (ataAccount.amount < BigInt(tokenAmount)) {
+ throw new Error('Insufficient SPL balance');
+ }
+
+ // Derive Light Token associated token account
+ const lightTokenAta = getAssociatedTokenAddressInterface(mintPubkey, fromPubkey);
+
+ // Build instructions
+ const tx = new Transaction().add(
+ ComputeBudgetProgram.setComputeUnitLimit({units: 200_000}),
+ createAssociatedTokenAccountInterfaceIdempotentInstruction(
+ fromPubkey, lightTokenAta, fromPubkey, mintPubkey, CTOKEN_PROGRAM_ID,
+ ),
+ createWrapInstruction(
+ splAta, lightTokenAta, fromPubkey, mintPubkey,
+ tokenAmount, splInterfaceInfo, decimals, fromPubkey,
+ ),
+ );
+
+ // Sign and send via Privy
+ const {blockhash} = await connection.getLatestBlockhash();
+ tx.recentBlockhash = blockhash;
+ tx.feePayer = fromPubkey;
+
+ const walletId = process.env.TREASURY_WALLET_ID!;
+ const authorizationKey = process.env.TREASURY_AUTHORIZATION_KEY!;
+
+ const {signed_transaction} = await privy.wallets().solana().signTransaction(
+ walletId, {
+ transaction: tx.serialize({requireAllSignatures: false}),
+ authorization_context: {authorization_private_keys: [authorizationKey]},
+ },
+ ) as any;
+
+ const signature = await connection.sendRawTransaction(
+ Buffer.from(signed_transaction, 'base64'),
+ {skipPreflight: false, preflightCommitment: 'confirmed'},
+ );
+ await connection.confirmTransaction(signature, 'confirmed');
+
+ return signature;
+};
+
+export default wrapTokens;
+
+```
diff --git a/snippets/code-snippets/privy/wrap/react.mdx b/snippets/code-snippets/privy/wrap/react.mdx
new file mode 100644
index 00000000..4cefafd5
--- /dev/null
+++ b/snippets/code-snippets/privy/wrap/react.mdx
@@ -0,0 +1,99 @@
+```typescript
+import { useState } from 'react';
+import { PublicKey, Transaction, ComputeBudgetProgram } from '@solana/web3.js';
+import { getAssociatedTokenAddressSync, getAccount } from '@solana/spl-token';
+import { getSplInterfaceInfos } from '@lightprotocol/compressed-token';
+import {
+ createWrapInstruction,
+ getAssociatedTokenAddressInterface,
+ createAssociatedTokenAccountInterfaceIdempotentInstruction,
+} from '@lightprotocol/compressed-token/unified';
+import { createRpc, CTOKEN_PROGRAM_ID } from '@lightprotocol/stateless.js';
+import type { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
+import { useSignTransaction } from '@privy-io/react-auth/solana';
+
+type SignTransactionFn = ReturnType['signTransaction'];
+
+export interface WrapParams {
+ ownerPublicKey: string;
+ mint: string;
+ amount: number;
+ decimals?: number;
+}
+
+export interface WrapArgs {
+ params: WrapParams;
+ wallet: ConnectedStandardSolanaWallet;
+ signTransaction: SignTransactionFn;
+}
+
+export function useWrap() {
+ const [isLoading, setIsLoading] = useState(false);
+
+ const wrap = async (args: WrapArgs): Promise => {
+ setIsLoading(true);
+
+ try {
+ const { params, wallet, signTransaction } = args;
+ const { ownerPublicKey, mint, amount, decimals = 9 } = params;
+
+ const rpc = createRpc(import.meta.env.VITE_HELIUS_RPC_URL);
+
+ const owner = new PublicKey(ownerPublicKey);
+ const mintPubkey = new PublicKey(mint);
+ const tokenAmount = BigInt(Math.floor(amount * Math.pow(10, decimals)));
+
+ // Get SPL interface info — determines whether mint uses SPL or T22
+ const splInterfaceInfos = await getSplInterfaceInfos(rpc, mintPubkey);
+ const splInterfaceInfo = splInterfaceInfos.find(
+ (info) => info.isInitialized,
+ );
+ if (!splInterfaceInfo) throw new Error('No SPL interface found for this mint');
+ const { tokenProgram } = splInterfaceInfo;
+
+ // Derive source associated token account using the mint's token program (SPL or T22)
+ const splAta = getAssociatedTokenAddressSync(mintPubkey, owner, false, tokenProgram);
+ const ataAccount = await getAccount(rpc, splAta, undefined, tokenProgram);
+ if (ataAccount.amount < BigInt(tokenAmount)) {
+ throw new Error('Insufficient SPL balance');
+ }
+
+ // Derive light-token associated token account
+ const lightTokenAta = getAssociatedTokenAddressInterface(mintPubkey, owner);
+
+ // Build transaction
+ const tx = new Transaction().add(
+ ComputeBudgetProgram.setComputeUnitLimit({ units: 200_000 }),
+ createAssociatedTokenAccountInterfaceIdempotentInstruction(
+ owner, lightTokenAta, owner, mintPubkey, CTOKEN_PROGRAM_ID,
+ ),
+ createWrapInstruction(
+ splAta, lightTokenAta, owner, mintPubkey,
+ tokenAmount, splInterfaceInfo, decimals, owner,
+ ),
+ );
+
+ const { blockhash } = await rpc.getLatestBlockhash();
+ tx.recentBlockhash = blockhash;
+ tx.feePayer = owner;
+
+ const unsignedTxBuffer = tx.serialize({ requireAllSignatures: false });
+ const signedTx = await signTransaction({
+ transaction: unsignedTxBuffer,
+ wallet,
+ chain: 'solana:devnet',
+ });
+
+ const signedTxBuffer = Buffer.from(signedTx.signedTransaction);
+ return rpc.sendRawTransaction(signedTxBuffer, {
+ skipPreflight: false,
+ preflightCommitment: 'confirmed',
+ });
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ return { wrap, isLoading };
+}
+```
diff --git a/snippets/compressible-rent-explained.mdx b/snippets/compressible-rent-explained.mdx
index 0ca2820a..eebb043c 100644
--- a/snippets/compressible-rent-explained.mdx
+++ b/snippets/compressible-rent-explained.mdx
@@ -1,4 +1,4 @@
-1. The Light Token Program pays the rent-exemption cost for the account.
+1. A rent sponsor PDA by Light Protocol pays the rent-exemption cost for the account.
2. Transaction fee payers bump a virtual rent balance when writing to the account, which keeps the account "hot".
3. "Cold" accounts virtual rent balance below threshold (eg 24h without write bump) get auto-compressed.
4. The cold account's state is cryptographically preserved on the Solana ledger.
diff --git a/snippets/jsx/liquid-glass-pill.jsx b/snippets/jsx/liquid-glass-pill.jsx
index 05670a24..2e721839 100644
--- a/snippets/jsx/liquid-glass-pill.jsx
+++ b/snippets/jsx/liquid-glass-pill.jsx
@@ -1,6 +1,6 @@
// Styles in style.css - uses .glass-pill classes
-export const LiquidGlassPill = ({ title }) => {
+export const LiquidGlassPill = ({ title, children }) => {
return (
+ );
+};
diff --git a/snippets/light-token-guides/close-intro.mdx b/snippets/light-token-guides/close-intro.mdx
index 2f11e21a..c799d6e0 100644
--- a/snippets/light-token-guides/close-intro.mdx
+++ b/snippets/light-token-guides/close-intro.mdx
@@ -2,4 +2,4 @@
2. light-token accounts can be closed
* by the account owner at any time.
* by the `compression_authority`
- when the account becomes compressible. The account is compressed and closed - it can be reinstated with the same state (decompressed).
+ when the account becomes compressible. The account is compressed and closed - it can be loaded with the same state (decompressed).
diff --git a/snippets/overview-tables/compressed-pdas-guides-table.mdx b/snippets/overview-tables/compressed-pdas-guides-table.mdx
index b72a52b2..63763552 100644
--- a/snippets/overview-tables/compressed-pdas-guides-table.mdx
+++ b/snippets/overview-tables/compressed-pdas-guides-table.mdx
@@ -1,7 +1,50 @@
-| Guide | Description |
-| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
-| [Create Compressed Accounts](/compressed-pdas/guides/how-to-create-compressed-accounts) | Create compressed accounts with address |
-| [Update Compressed Accounts](/compressed-pdas/guides/how-to-update-compressed-accounts) | Update compressed accounts |
-| [Close Compressed Accounts](/compressed-pdas/guides/how-to-close-compressed-accounts) | Close compressed accounts, retain the address |
-| [Reinitialize Compressed Accounts](/compressed-pdas/guides/how-to-reinitialize-compressed-accounts) | Reinitialize closed compressed accounts with the same address and new values |
-| [Burn Compressed Accounts](/compressed-pdas/guides/how-to-burn-compressed-accounts) | Burn compressed accounts and their address permanently |
+
diff --git a/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx b/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx
index ac09b01c..88ccd3dc 100644
--- a/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx
+++ b/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx
@@ -1,7 +1,4 @@
| Guide | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
-| [Create an Airdrop without Claim](/compressed-tokens/advanced-guides/airdrop) | ZK Compression is the most efficient way to distribute SPL tokens. Distribute via Webapp or customize with claim. |
-| [Combine Instructions in One Transaction](/compressed-tokens/advanced-guides/how-to-combine-operations-in-one-transaction) | Execute multiple token instructions within a single transaction |
-| [For Wallet Applications](/compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens) | Add compressed token support in your wallet application |
-| [Use Token-2022 with Compression](/compressed-tokens/advanced-guides/use-token-2022-with-compression) | Create compressed Token-2022 mints with metadata and other extensions |
-| [Privy Guide](/compressed-tokens/for-privy) | Integrate compressed tokens with Privy embedded wallets for rent-free token accounts |
+| [Create an Airdrop without Claim](/compressed-tokens/airdrop) | ZK Compression is the most efficient way to distribute SPL tokens. Distribute via Webapp or customize with claim. |
+| [Privy Guide](/light-token/toolkits/for-privy) | Integrate light-tokens with Privy embedded wallets for rent-free token accounts |
diff --git a/snippets/overview-tables/compressed-tokens-guides-table.mdx b/snippets/overview-tables/compressed-tokens-guides-table.mdx
index 4e5d2458..b6b4e758 100644
--- a/snippets/overview-tables/compressed-tokens-guides-table.mdx
+++ b/snippets/overview-tables/compressed-tokens-guides-table.mdx
@@ -1,11 +1,11 @@
| Guide | Description |
| :---------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------- |
-| [Create Compressed Token Accounts](/compressed-tokens/guides/create-compressed-token-accounts) | Create compressed and learn difference to regular token accounts |
-| [Mint Compressed Tokens](/compressed-tokens/guides/mint-compressed-tokens) | Create new compressed tokens to existing mint |
-| [Transfer Compressed Tokens](/compressed-tokens/guides/transfer-compressed-tokens) | Move compressed tokens between compressed accounts |
-| [Decompress and Compress Tokens](/compressed-tokens/guides/compress-decompress) | Convert SPL tokens between regular and compressed format |
-| [Compress Complete SPL Token Accounts](/compressed-tokens/guides/compress-spl-token-account) | Compress complete SPL token accounts and reclaim rent afterwards |
-| [Create a mint with SPL interface](/compressed-tokens/guides/create-mint-with-token-pool) | Create new SPL mint with SPL Interface PDA for compression |
-| [Create SPL interface for existing mints](/compressed-tokens/guides/add-token-pools-to-mint-accounts) | Create SPL Interface PDA (omnibus account) for existing SPL mints |
-| [Merge Compressed Accounts](/compressed-tokens/guides/merge-compressed-token-accounts) | Consolidate multiple compressed accounts of the same mint into one |
-| [Approve and Revoke Delegate Authority](/compressed-tokens/guides/delegate) | Approve or revoke delegates for compressed token accounts |
+| [Create Compressed Token Accounts](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Create compressed and learn difference to regular token accounts |
+| [Mint Compressed Tokens](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Create new compressed tokens to existing mint |
+| [Transfer Compressed Tokens](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Move compressed tokens between compressed accounts |
+| [Decompress and Compress Tokens](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Convert SPL tokens between regular and compressed format |
+| [Compress Complete SPL Token Accounts](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Compress complete SPL token accounts and reclaim rent afterwards |
+| [Create a Mint with Interface PDA](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Create new SPL mint with SPL Interface PDA for compression |
+| [Create SPL Interface for Existing Mints](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Create SPL Interface PDA for existing SPL mints |
+| [Merge Compressed Accounts](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Consolidate multiple compressed accounts of the same mint into one |
+| [Approve and Revoke Delegate Authority](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook) | Approve or revoke delegates for compressed token accounts |
\ No newline at end of file
diff --git a/snippets/overview-tables/examples-guides-table.mdx b/snippets/overview-tables/examples-guides-table.mdx
new file mode 100644
index 00000000..d0d9dbb3
--- /dev/null
+++ b/snippets/overview-tables/examples-guides-table.mdx
@@ -0,0 +1,26 @@
+