Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0cc1042
Reorganize docs: restructure navigation, add AI prompts, update examp…
Feb 20, 2026
7a3189d
Implement the following plan:
Feb 20, 2026
b055d4c
Try it. but not all 6 I think the with metadata we can delete anyhow
Feb 20, 2026
c9e1416
Implement the following plan:
Feb 20, 2026
4925474
Put back into the accordions. but dont revert change, modify
Feb 20, 2026
ec68f19
Put anchor macro as 3rd
Feb 20, 2026
5ab8aa3
And name it macro not macros
Feb 20, 2026
969dab2
WELL NOT THOS Light-PDA
Feb 20, 2026
953ac45
refactor ai prompts
Feb 20, 2026
5ccfd36
refactor ai prompts
Feb 20, 2026
d06f4f4
unify temrinology
Feb 23, 2026
d2527f2
tab names
SwenSchaeferjohann Feb 23, 2026
bb4edaf
Implement the following plan:
Feb 23, 2026
d3cd43b
Mv rent sponsorship mdx to introduction
Feb 23, 2026
4195739
Below faa
Feb 23, 2026
36dba71
Index this file. and then we need to make the table left bound
Feb 23, 2026
1ccba51
Ata -> associated token account
Feb 23, 2026
c7ee616
The Light Token Program pays the rent-exemption cost for the account.
Feb 23, 2026
c047b6e
<CompressibleRentExplained />
Feb 23, 2026
bebfbcb
A rent sponsor PDA by light protocl
Feb 23, 2026
ed2468d
All ata
Feb 23, 2026
ed06bf8
Line 56
Feb 23, 2026
c3d4489
Completed 'Explore' agent: Explore examples-light-token repo (toolu_0…
Feb 23, 2026
33ae407
Ahh ok. then it's fine . let's add the instruction snippet we have -> up
Feb 23, 2026
e376e24
And rm the other tabs
Feb 23, 2026
9d54323
Add below like in the payments toolkit the one time setup
Feb 23, 2026
6598d69
Do the setup in the accordion
Feb 23, 2026
abb2fcf
Other thing . wrap in this mdx into an accordion this section
Feb 23, 2026
a3b7219
Something breaks the page if we do it like this. where is a thing not fo
Feb 23, 2026
adbc9a1
Move the rent sponsorship page to For Payments section
Feb 23, 2026
fe086e4
Move it to toolkits as well
Feb 23, 2026
313bc08
Rent-exemption: sponsored by a rent sponsor PDA.
Feb 23, 2026
e8c78eb
Make this into an accordion
Feb 23, 2026
f2330dc
Move below wallets sign with privy
Feb 23, 2026
d192397
Base directory for this skill: /home/tilo/.claude/skills/workflow-auto
Feb 23, 2026
f0975de
Completed 'Explore' agent: Explore examples-light-token structure (to…
Feb 23, 2026
463cb10
Completed 'Explore' agent: Find Rust API for sponsored transfer (tool…
Feb 23, 2026
53e226a
Or let's clone and leave the general snippet untouched? like in the exam
Feb 23, 2026
d2897fd
IMPORTANT - Autonomous Execution Mode
Feb 23, 2026
9be1a0e
Put the setup to a separate file then, so it is labeled as setup
Feb 23, 2026
2d39cf2
Good start. now, let's rm all long dashes -
Feb 23, 2026
0496c5f
1 to 1 align
Feb 23, 2026
01c1a42
Add in line 24 at theend
Feb 23, 2026
7e5653b
Wait. not fee sponsorship. we are sponsoring rent-top ips here
Feb 23, 2026
fe1dbb6
Rename rent-sponsorship -> sponsor-top ups and fix all associated links
Feb 23, 2026
ff2d97b
Sponsor rent top-ups to abstract away holding SOL and provide a rent-fre
Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .context/program-examples
Submodule program-examples deleted from bf2705
4 changes: 4 additions & 0 deletions .entire/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tmp/
settings.local.json
metadata/
logs/
5 changes: 5 additions & 0 deletions .entire/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"strategy": "auto-commit",
"enabled": true,
"telemetry": false
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ node_modules/

stash
docs-audit.md
docs-audit.txt
docs-audit.txt
docs-anchor.json
product-docs.json
tabs-docs.json
55 changes: 34 additions & 21 deletions ai-tools/guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<InstallAgentSkills />

`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)
<Card
title="Find ready-to-use AI prompts for your agent here and all guides. "
icon="chevron-right"
color="#0066ff"
href="/ai-tools/prompts"
horizontal
/>

## MCP

Expand Down Expand Up @@ -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).
</Tip>

<div style={{ display: 'flex', alignItems: 'center', gap: '0.5em' }}>
<h3 style={{ margin: 0 }}>Alternative: DeepWiki Web</h3>
<a href="https://deepwiki.com/Lightprotocol/light-protocol" style={{ margin: 0 }}>
<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" style={{ marginTop: 0, marginBottom: 0, verticalAlign: 'middle' }} />
</a>
</div>
<Accordion title="Alternative: DeepWiki Web">

If you don't have the MCP installed we recommend to use AskDevin in your browser.
If you don't have the MCP installed we recommend to use [AskDevin](https://deepwiki.com/Lightprotocol/light-protocol) in your browser.

<Frame>
<iframe
Expand All @@ -196,3 +206,6 @@ If you don't have the MCP installed we recommend to use AskDevin in your browser
allowfullscreen
></iframe>
</Frame>

</Accordion>

8 changes: 8 additions & 0 deletions ai-tools/prompts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "AI Prompts"
description: "Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project."
---

import AllPrompts from "/snippets/ai-prompts/all-prompts.mdx";

<AllPrompts />
194 changes: 194 additions & 0 deletions api-reference/anchor-constraints.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
---
title: "Anchor Constraints LightAccount"
description: "Syntax reference for #[light_account] constraints with sponsored rent-exemption."
---

- [`#[light_account(init)]`](#light_accountinit) creates a PDA
- [`#[light_account(init, token::...)]`](#light_accountinit-token) creates a token account via CPI
- [`#[light_account(init, associated_token::...)]`](#light_accountinit-associated_token) creates an ATA via CPI
- [`#[light_account(init, mint::...)]`](#light_accountinit-mint) creates a mint via CPI
- [Required accounts](#required-accounts) per account type

Place `#[light_account]` below standard Anchor `#[account]` on the same field.
Anchor handles seeds, space, and payer; LightAccount handles rent-free creation.

---

### `#[light_account(init)]`

Creates a rent-free PDA. No additional parameters — uses Anchor `#[account]` seeds and space.

**attribute**

```
#[light_account(init)]
```

```rust
#[account( // ← Anchor: seeds, space, payer
init,
payer = fee_payer,
space = 8 + <Counter as anchor_lang::Space>::INIT_SPACE,
seeds = [COUNTER_SEED, owner.key().as_ref()],
bump,
)]
#[light_account(init)] // ← Light: register for rent-free creation
pub counter: Account<'info, Counter>,
```

Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Capitalize "GitHub" correctly (applies to lines 39, 73, 101, 165).

The official spelling uses a capital "H". This appears four times in the file.

-Examples: [Github](https://github.com/...
+Examples: [GitHub](https://github.com/...
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter)
Examples: [GitHub](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter)
🧰 Tools
🪛 LanguageTool

[uncategorized] ~39-~39: The official name of this software platform is spelled with a capital “H”.
Context: ...ccount<'info, Counter>, ``` Examples: [Github](https://github.com/Lightprotocol/examp...

(GITHUB)

🤖 Prompt for AI Agents
In `@resources/anchor-constraints.mdx` at line 39, Replace the incorrect "Github"
spelling with the official "GitHub" in this document; locate the visible link
text "Github" in the Examples link (the anchor text for
https://github.com/Lightprotocol/examples-light-token/…) and update it, and also
search the file for the other occurrences of "Github" (the other two instances
referenced in the review) and change them to "GitHub" so all four usages use the
correct capitalization.


---

### `#[light_account(init, token::...)]`

Creates a rent-free token account via CPI to the Light Token program. The account type is `UncheckedAccount` because Light Token program initializes it via CPI.

**attribute**

```
#[light_account(init,
token::authority = <seeds>,
token::mint = <account>,
token::owner = <account>,
token::bump = <expr>
)]
```

```rust
#[account(
mut,
seeds = [VAULT_SEED, mint.key().as_ref()],
bump,
)]
#[light_account(init,
token::authority = [VAULT_SEED, self.mint.key()],
token::mint = mint,
token::owner = vault_authority,
token::bump = params.vault_bump
)]
pub vault: UncheckedAccount<'info>,
```

Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-token-account)

---

### `#[light_account(init, associated_token::...)]`

Creates a rent-free associated token account via CPI.

**attribute**

```
#[light_account(init,
associated_token::authority = <account>,
associated_token::mint = <account>,
associated_token::bump = <expr>
)]
```

```rust
#[account(mut)]
#[light_account(init,
associated_token::authority = associated_token_account_owner,
associated_token::mint = associated_token_account_mint,
associated_token::bump = params.associated_token_account_bump
)]
pub associated_token_account: UncheckedAccount<'info>,
```

Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-associated-token-account)

---

### `#[light_account(init, mint::...)]`

Creates a rent-free mint via CPI.

**attribute (required)**

```
#[light_account(init, mint,
mint::signer = <account>,
mint::authority = <account>,
mint::decimals = <expr>,
mint::seeds = <seeds>,
)]
```

**attribute (optional)**

```
mint::bump = <expr>
mint::freeze_authority = <ident>
mint::authority_seeds = <seeds>
mint::name = <expr> // requires symbol + uri
mint::symbol = <expr> // requires name + uri
mint::uri = <expr> // requires name + symbol
mint::update_authority = <ident> // requires name, symbol, uri
mint::additional_metadata = <expr> // requires name, symbol, uri
```

```rust
#[account(mut)]
#[light_account(init, mint,
mint::signer = mint_signer,
mint::authority = fee_payer,
mint::decimals = 9,
mint::seeds = &[MINT_SIGNER_SEED, self.authority.to_account_info().key.as_ref()],
)]
pub mint: UncheckedAccount<'info>,
```

<Accordion title="Mint with metadata">

```rust
#[account(mut)]
#[light_account(init, mint,
mint::signer = mint_signer,
mint::authority = fee_payer,
mint::decimals = 9,
mint::seeds = &[MINT_SIGNER_SEED, self.authority.to_account_info().key.as_ref()],
mint::bump = params.mint_signer_bump,
mint::name = params.name.clone(),
mint::symbol = params.symbol.clone(),
mint::uri = params.uri.clone(),
mint::update_authority = authority,
mint::additional_metadata = params.additional_metadata.clone()
)]
pub mint: UncheckedAccount<'info>,
```

</Accordion>

Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-mint)

---

## Required accounts

Add these to your `init` struct alongside the fields above. The `LightAccounts` derive macro appends additional protocol accounts to the instruction at runtime — you don't add those manually.

<Tabs>
<Tab title="PDA">

| Account | Description |
|:-|:-|
| `compression_config` | Per-program PDA. Stores rent sponsor address and compression settings. Initialize once via `InitializeRentFreeConfig`. |
| `pda_rent_sponsor` | Per-program PDA. Receives rent-exemption lamports when accounts compress. Must be mutable. |
| `system_program` | Solana System Program. Transfers lamports for rent-exemption. |

</Tab>
<Tab title="Token / ATA / Mint">

| Account | Description |
|:-|:-|
| `light_token_compressible_config` | Protocol PDA. Stores rent-config for Light Token accounts. |
| `light_token_rent_sponsor` | Protocol PDA. Holds the lamport pool that sponsors rent-exemption. Reclaims lamports when accounts compress. |
| `light_token_program` | Light Token program. CPI target for token, ATA, and mint creation. |
| `light_token_cpi_authority` | Signer PDA. Authorizes CPI calls from your program to the Light Token program. |
| `system_program` | Solana System Program. Transfers lamports for rent-exemption. |

</Tab>
</Tabs>
Loading