Skip to content

Commit 5186da6

Browse files
tilo-14SwenSchaeferjohann
authored andcommitted
Reorganize docs: restructure navigation, add AI prompts, update examples tables, consolidate pages
- Restructure nav into Light Token, PDA Accounts, Compressed Tokens, and Resources sections - Add AI prompt snippets for all cookbook, DeFi, streaming, payments, wallet, and PDA guides - Add guide links to AI prompts page and example tables (client + program) - Create Light-PDA overview, FAQ, and Privy wallet integration pages - Move compressed PDAs under pda/, references under resources/ - Add code compare accordions and TypeScript/Rust Client tabs to welcome page - Add toolkits section (payments-and-wallets, sign-with-privy, spl-to-light) to client examples - Remove deprecated compressed token guides and consolidate content Implement the following plan: Entire-Checkpoint: ecc32cc49a8e Try it. but not all 6 I think the with metadata we can delete anyhow Entire-Checkpoint: 7984483ef01c Implement the following plan: Entire-Checkpoint: 48c7c2c4afb2 Put back into the accordions. but dont revert change, modify Entire-Checkpoint: 903125d869a0 Put anchor macro as 3rd Entire-Checkpoint: 31f041749176 And name it macro not macros Entire-Checkpoint: 48eb95ad51fd WELL NOT THOS Light-PDA Light-PDA program ​ Compressed PDA Client guide Entire-Checkpoint: 2621ea6ce02b refactor ai prompts refactor ai prompts unify temrinology tab names Implement the following plan: Entire-Checkpoint: 2c508460b42f Mv rent sponsorship mdx to introduction Entire-Checkpoint: ddd2aa1b7da6 Below faa Entire-Checkpoint: 0e9df9edb68b Index this file. and then we need to make the table left bound Entire-Checkpoint: 928e2adc6615 Ata -> associated token account Entire-Checkpoint: fa86a8bbdd5b The Light Token Program pays the rent-exemption cost for the account. Entire-Checkpoint: 6da4a3486223 <CompressibleRentExplained /> in this I mean Entire-Checkpoint: 480349eed063 A rent sponsor PDA by light protocl Entire-Checkpoint: f83455f0e53c All ata Entire-Checkpoint: d5e69ae331a3 Line 56 Entire-Checkpoint: 4ddbcab1ecc2 Completed 'Explore' agent: Explore examples-light-token repo (toolu_019MPo) Entire-Checkpoint: 906e9f4874a7 Ahh ok. then it's fine . let's add the instruction snippet we have -> up Entire-Checkpoint: 6f366218b59a And rm the other tabs Entire-Checkpoint: 57d159061a5e Add below like in the payments toolkit the one time setup Entire-Checkpoint: 55e6161e0f14 Do the setup in the accordion 1. add the dependencies etc 2. the setup Entire-Checkpoint: 7cd3c579b181 Other thing . wrap in this mdx into an accordion this section Entire-Checkpoint: ab65e28e8c8d Something breaks the page if we do it like this. where is a thing not fo Entire-Checkpoint: 5fe525bf6ed4 Move the rent sponsorship page to For Payments section Entire-Checkpoint: d8662f1d568b Move it to toolkits as well Entire-Checkpoint: c4c532562544 Rent-exemption: sponsored by a rent sponsor PDA. Every Solana account re Entire-Checkpoint: 6de9880c3b0f Make this into an accordion Entire-Checkpoint: 01cfc3d32b4e Move below wallets sign with privy Entire-Checkpoint: 17f5fe5ec4bf Base directory for this skill: /home/tilo/.claude/skills/workflow-auto Entire-Checkpoint: 1b2d4275746e Completed 'Explore' agent: Explore examples-light-token structure (toolu_012Rsi) Entire-Checkpoint: 9739899e3906 Completed 'Explore' agent: Find Rust API for sponsored transfer (toolu_01N6cq) Entire-Checkpoint: 7799c0863457 Or let's clone and leave the general snippet untouched? like in the exam Entire-Checkpoint: e2903867721d IMPORTANT - Autonomous Execution Mode This plan must execute without use Entire-Checkpoint: 2a47402fc1fa Put the setup to a separate file then, so it is labeled as setup Entire-Checkpoint: d36e4cd6200f Good start. now, let's rm all long dashes - let's ata -> associated to Entire-Checkpoint: b80d149bfea3 1 to 1 align Entire-Checkpoint: d5b37e91d642 Add in line 24 at theend Entire-Checkpoint: 369928d7ebb7 Wait. not fee sponsorship. we are sponsoring rent-top ips here Entire-Checkpoint: c5f43b2babbb Rename rent-sponsorship -> sponsor-top ups and fix all associated links Entire-Checkpoint: d283b4597dbd Sponsor rent top-ups to abstract away holding SOL and provide a rent-fre Entire-Checkpoint: 3b97aedd5d20 add lightaccount Add migration reference page mapping Light Token to SPL/Solana Side-by-side comparison of every Light Token instruction against its SPL/Solana equivalent. Covers RPC connection setup, TypeScript client, Rust client, program CPI, and Anchor macros with reusable MDX snippets. Rename to SPL to Light Reference, restructure RPC and transfer sections Move page from api-reference/ to resources/, add get balance and tx history to RPC section, wrap load/wrap/unwrap in accordions, add "Unify fragmented token balances" accordion with sliceLast pattern. Add instruction API return-type table to SPL-to-Light reference Quick-reference showing which TypeScript instruction builders return single TransactionInstruction vs batched TransactionInstruction[][], with the canonical loop pattern for handling batches. rm logos Implement the following plan: Entire-Checkpoint: 133fb8a9a8d9 update Implement the following plan: Entire-Checkpoint: 0ab67f06fa2e Implement the following plan: Entire-Checkpoint: 47841b18723c Can we do still in each column as H4 "Light" "SPL" . so we know its a di Entire-Checkpoint: e1ea03b19c61 Completed 'general-purpose' agent: Remove div/H4 from remaining sections (toolu_01AzoT) Entire-Checkpoint: e680e710b515 Add code block titles and CodeGroup to SPL-to-Light reference Replace H4 column headers with code block title attributes (title="Light", title="SPL", title="Anchor") for a lighter visual. Convert Action/Instruction inner Tabs to CodeGroup across all comparison sections. Wrap Get balance and Transaction history in Accordions. Completed 'Explore' agent: Audit SPL-to-Light reference file (toolu_01Er9U) Entire-Checkpoint: f3ee5d97777d Completed 'Explore' agent: Audit all snippet files for titles (toolu_01L7yz) Entire-Checkpoint: f6bceb83c3de Implement the following plan: Entire-Checkpoint: c4d7b93040c2 Completed 'Explore' agent: Explore AI prompt snippets (toolu_01Q1Hz) Entire-Checkpoint: 22d744511222 Implement the following plan: Entire-Checkpoint: 8ff3697de615 2. Entire-Checkpoint: d8928557a3ea Update anchor resource path in docs.json Rename anchor-constraints.mdx to anchor.mdx Yes Entire-Checkpoint: b6c6fd32214a Fix broken link to renamed anchor constraints page Also remove .entire directory and add it to .mintlifyignore. Sync snippets from examples-light-token, add sponsor-rent-top-ups rebase, resolve mcs, add fixes fix home upd footer fix words fix broken link
1 parent 8a7dee5 commit 5186da6

290 files changed

Lines changed: 13973 additions & 5041 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.context/program-examples

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sync Examples Light Token
2+
3+
on:
4+
repository_dispatch:
5+
types: [sync-examples-light-token]
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout docs repo
13+
uses: actions/checkout@v4
14+
15+
- name: Checkout examples repo
16+
uses: actions/checkout@v4
17+
with:
18+
repository: Lightprotocol/examples-light-token
19+
path: examples-light-token
20+
ref: ${{ github.event.client_payload.commit || 'main' }}
21+
22+
- name: Run snippet sync scripts
23+
env:
24+
EXAMPLES_LIGHT_TOKEN: ${{ github.workspace }}/examples-light-token
25+
run: |
26+
chmod +x ./scripts/copy-light-token-snippets.sh
27+
chmod +x ./scripts/copy-rust-snippets.sh
28+
chmod +x ./scripts/copy-program-snippets.sh
29+
chmod +x ./scripts/copy-sponsor-top-ups-snippets.sh
30+
31+
./scripts/copy-light-token-snippets.sh
32+
./scripts/copy-rust-snippets.sh
33+
./scripts/copy-program-snippets.sh
34+
./scripts/copy-sponsor-top-ups-snippets.sh
35+
36+
- name: Create Pull Request
37+
uses: peter-evans/create-pull-request@v7
38+
with:
39+
branch: auto-sync/examples-light-token
40+
delete-branch: true
41+
title: "chore: sync code snippets from examples-light-token"
42+
commit-message: "chore: sync snippets from examples-light-token@${{ github.event.client_payload.commit || 'manual' }}"
43+
body: |
44+
Auto-generated by [sync workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
45+
46+
Source commit: Lightprotocol/examples-light-token@${{ github.event.client_payload.commit || 'manual dispatch' }}

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ mintlify-docs/
33
/CLAUDE.md
44
.windsurf.context/
55
.claude/
6+
.entire/
67

78
# Dependencies
89
node_modules/
910

1011
stash
12+
.reapply-stash/
1113
docs-audit.md
12-
docs-audit.txt
14+
docs-audit.txt
15+
docs-anchor.json
16+
product-docs.json
17+
tabs-docs.json

.mintlifyignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2+
.entire/
23
ai-tools/skills/
34
ai-tools/prompts/
45
ai-tools/.claude-plugin/

ai-tools/guide.mdx

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,51 @@
22
title: "AI Tools Guide"
33
description: "Guidance to AI tools when working with ZK Compression. Includes Agent Skill, MCP server, DeepWiki, and AI Search guides."
44
---
5+
import InstallAgentSkills from "/snippets/setup/install-agent-skills.mdx";
56

67
# For Docs
78

89
- **Docs AI Search** - Search documentation with AI in the search bar.
910
- **Markdown Export** - Append `.md` to any page URL for raw markdown.
11+
* **View [`/llms.txt`](https://zkcompression.com/llms.txt)** for an index of the docs - It lists key pages with descriptions
12+
so agents can navigate to answers quickly.
1013

1114
# For Development
1215

13-
## AI agents
14-
15-
### `skill.md`
16+
## Agent Skills
1617

17-
`skill.md` is a structured capability file that tells agents what they can do
18-
with Light Protocol and ZK Compression. If you're
19-
building with agents, start here.
18+
View or install [`/skill.md`](https://zkcompression.com/skill.md), a structured capability file that tells agents what they can do
19+
with Light Protocol and ZK Compression. If you're building with agents, start here.
2020

21-
* View: [`/skill.md`](https://zkcompression.com/skill.md)
21+
Install or view dedicated agent skills:
2222

23-
### `llms.txt`
23+
| Use case | Skill |
24+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
25+
| 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) |
26+
| 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) |
27+
| Stream account state via Laserstream gRPC | [data-streaming](https://github.com/Lightprotocol/skills/tree/main/skills/data-streaming) |
28+
| 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) |
29+
| Airdrops, DePIN, token distribution | [token-distribution](https://github.com/Lightprotocol/skills/tree/main/skills/token-distribution) |
30+
| Anti-double-spend nullifiers for Privacy-preserving ZK programs | [zk-nullifier](https://github.com/Lightprotocol/skills/tree/main/skills/zk-nullifier) |
31+
| Testing programs and clients on localnet, devnet, mainnet | [testing](https://github.com/Lightprotocol/skills/tree/main/skills/testing) |
32+
| 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) |
33+
| Help with Debugging and Questions via DeepWiki MCP | [ask-mcp](https://github.com/Lightprotocol/skills/tree/main/skills/ask-mcp) |
2434

25-
`llms.txt` is an index of the docs. It lists key pages with descriptions
26-
so agents can navigate to answers quickly.
35+
> View all skills here: https://github.com/Lightprotocol/skills.
2736
28-
* View: [`/llms.txt`](https://zkcompression.com/llms.txt)
37+
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.
2938

30-
### `llms-full.txt`
39+
<InstallAgentSkills />
3140

32-
`llms-full.txt` is the full, expanded index for agents that want complete coverage of the documentation.
41+
## AI Prompts
3342

34-
* View: [`/llms-full.txt`](https://zkcompression.com/llms-full.txt)
43+
<Card
44+
title="Find ready-to-use AI prompts for your agent here and all guides. "
45+
icon="chevron-right"
46+
color="#0066ff"
47+
href="/ai-tools/prompts"
48+
horizontal
49+
/>
3550

3651
## MCP
3752

@@ -175,14 +190,9 @@ mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "your question")
175190
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).
176191
</Tip>
177192

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

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

187197
<Frame>
188198
<iframe
@@ -196,3 +206,6 @@ If you don't have the MCP installed we recommend to use AskDevin in your browser
196206
allowfullscreen
197207
></iframe>
198208
</Frame>
209+
210+
</Accordion>
211+

ai-tools/prompts.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "AI Prompts"
3+
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."
4+
---
5+
6+
import AllPrompts from "/snippets/ai-prompts/all-prompts.mdx";
7+
8+
<AllPrompts />

api-reference/anchor.mdx

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
---
2+
title: "Anchor Constraints LightAccount"
3+
description: "Syntax reference for #[light_account] constraints with sponsored rent-exemption."
4+
---
5+
6+
- [`#[light_account(init)]`](#light_accountinit) creates a PDA
7+
- [`#[light_account(init, token::...)]`](#light_accountinit-token) creates a token account via CPI
8+
- [`#[light_account(init, associated_token::...)]`](#light_accountinit-associated_token) creates an ATA via CPI
9+
- [`#[light_account(init, mint::...)]`](#light_accountinit-mint) creates a mint via CPI
10+
- [Required accounts](#required-accounts) per account type
11+
12+
Place `#[light_account]` below standard Anchor `#[account]` on the same field.
13+
Anchor handles seeds, space, and payer; LightAccount handles rent-free creation.
14+
15+
---
16+
17+
### `#[light_account(init)]`
18+
19+
Creates a rent-free PDA. No additional parameters — uses Anchor `#[account]` seeds and space.
20+
21+
**attribute**
22+
23+
```
24+
#[light_account(init)]
25+
```
26+
27+
```rust
28+
#[account( // ← Anchor: seeds, space, payer
29+
init,
30+
payer = fee_payer,
31+
space = 8 + <Counter as anchor_lang::Space>::INIT_SPACE,
32+
seeds = [COUNTER_SEED, owner.key().as_ref()],
33+
bump,
34+
)]
35+
#[light_account(init)] // ← Light: register for rent-free creation
36+
pub counter: Account<'info, Counter>,
37+
```
38+
39+
Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter)
40+
41+
---
42+
43+
### `#[light_account(init, token::...)]`
44+
45+
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.
46+
47+
**attribute**
48+
49+
```
50+
#[light_account(init,
51+
token::authority = <seeds>,
52+
token::mint = <account>,
53+
token::owner = <account>,
54+
token::bump = <expr>
55+
)]
56+
```
57+
58+
```rust
59+
#[account(
60+
mut,
61+
seeds = [VAULT_SEED, mint.key().as_ref()],
62+
bump,
63+
)]
64+
#[light_account(init,
65+
token::authority = [VAULT_SEED, self.mint.key()],
66+
token::mint = mint,
67+
token::owner = vault_authority,
68+
token::bump = params.vault_bump
69+
)]
70+
pub vault: UncheckedAccount<'info>,
71+
```
72+
73+
Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-token-account)
74+
75+
---
76+
77+
### `#[light_account(init, associated_token::...)]`
78+
79+
Creates a rent-free associated token account via CPI.
80+
81+
**attribute**
82+
83+
```
84+
#[light_account(init,
85+
associated_token::authority = <account>,
86+
associated_token::mint = <account>,
87+
associated_token::bump = <expr>
88+
)]
89+
```
90+
91+
```rust
92+
#[account(mut)]
93+
#[light_account(init,
94+
associated_token::authority = associated_token_account_owner,
95+
associated_token::mint = associated_token_account_mint,
96+
associated_token::bump = params.associated_token_account_bump
97+
)]
98+
pub associated_token_account: UncheckedAccount<'info>,
99+
```
100+
101+
Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-associated-token-account)
102+
103+
---
104+
105+
### `#[light_account(init, mint::...)]`
106+
107+
Creates a rent-free mint via CPI.
108+
109+
**attribute (required)**
110+
111+
```
112+
#[light_account(init, mint,
113+
mint::signer = <account>,
114+
mint::authority = <account>,
115+
mint::decimals = <expr>,
116+
mint::seeds = <seeds>,
117+
)]
118+
```
119+
120+
**attribute (optional)**
121+
122+
```
123+
mint::bump = <expr>
124+
mint::freeze_authority = <ident>
125+
mint::authority_seeds = <seeds>
126+
mint::name = <expr> // requires symbol + uri
127+
mint::symbol = <expr> // requires name + uri
128+
mint::uri = <expr> // requires name + symbol
129+
mint::update_authority = <ident> // requires name, symbol, uri
130+
mint::additional_metadata = <expr> // requires name, symbol, uri
131+
```
132+
133+
```rust
134+
#[account(mut)]
135+
#[light_account(init, mint,
136+
mint::signer = mint_signer,
137+
mint::authority = fee_payer,
138+
mint::decimals = 9,
139+
mint::seeds = &[MINT_SIGNER_SEED, self.authority.to_account_info().key.as_ref()],
140+
)]
141+
pub mint: UncheckedAccount<'info>,
142+
```
143+
144+
<Accordion title="Mint with metadata">
145+
146+
```rust
147+
#[account(mut)]
148+
#[light_account(init, mint,
149+
mint::signer = mint_signer,
150+
mint::authority = fee_payer,
151+
mint::decimals = 9,
152+
mint::seeds = &[MINT_SIGNER_SEED, self.authority.to_account_info().key.as_ref()],
153+
mint::bump = params.mint_signer_bump,
154+
mint::name = params.name.clone(),
155+
mint::symbol = params.symbol.clone(),
156+
mint::uri = params.uri.clone(),
157+
mint::update_authority = authority,
158+
mint::additional_metadata = params.additional_metadata.clone()
159+
)]
160+
pub mint: UncheckedAccount<'info>,
161+
```
162+
163+
</Accordion>
164+
165+
Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-mint)
166+
167+
---
168+
169+
## Required accounts
170+
171+
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.
172+
173+
<Tabs>
174+
<Tab title="PDA">
175+
176+
| Account | Description |
177+
|:-|:-|
178+
| `compression_config` | Per-program PDA. Stores rent sponsor address and compression settings. Initialize once via `InitializeRentFreeConfig`. |
179+
| `pda_rent_sponsor` | Per-program PDA. Receives rent-exemption lamports when accounts compress. Must be mutable. |
180+
| `system_program` | Solana System Program. Transfers lamports for rent-exemption. |
181+
182+
</Tab>
183+
<Tab title="Token / ATA / Mint">
184+
185+
| Account | Description |
186+
|:-|:-|
187+
| `light_token_compressible_config` | Protocol PDA. Stores rent-config for Light Token accounts. |
188+
| `light_token_rent_sponsor` | Protocol PDA. Holds the lamport pool that sponsors rent-exemption. Reclaims lamports when accounts compress. |
189+
| `light_token_program` | Light Token program. CPI target for token, ATA, and mint creation. |
190+
| `light_token_cpi_authority` | Signer PDA. Authorizes CPI calls from your program to the Light Token program. |
191+
| `system_program` | Solana System Program. Transfers lamports for rent-exemption. |
192+
193+
</Tab>
194+
</Tabs>

0 commit comments

Comments
 (0)