Airdrop
Distribute compressed tokens to multiple recipients using TypeScript client.
Disclaimer: This guide demonstrates efficient token distribution on Solana using ZK compression. It does not constitute financial advice and does not endorse any specific token or project.
Workflow
- Clarify intent
- Recommend plan mode, if it's not activated
- Use
AskUserQuestion to resolve blind spots
- All questions must be resolved before execution
- Identify references and skills
- Write plan file (YAML task format)
- Use
AskUserQuestion for anything unclear — never guess or assume
- Identify blockers: permissions, dependencies, unknowns
- Plan must be complete before execution begins
- Execute
- Use
Task tool with subagents for parallel research
- Subagents load skills via
Skill tool
- Track progress with
TodoWrite
- When stuck: ask to spawn a read-only subagent with
Read, Glob, Grep, and DeepWiki MCP access, loading skills/ask-mcp. Scope reads to skill references, example repos, and docs.
Distribution via Client
| Scale |
Approach |
| <10,000 recipients |
Single transaction - see simple-airdrop.md |
| 10,000+ recipients |
Batched with retry - see batched-airdrop.md |
| No-code |
Airship by Helius (up to 200k) |
Cost Comparison
| Creation |
Solana |
Compressed |
| Token Account |
~2,000,000 lamports |
5,000 lamports |
Claim Program Reference Implementations
Customize token distribution and let users claim.
Simple Implementation: simple-claim - Distributes compressed tokens that get decompressed on claim.
Advanced Implementation: distributor - Distributes SPL tokens, uses compressed PDAs to track claims. Based on jito Merkle distributor.
|
distributor |
simple-claim |
| Vesting |
Linear Vesting |
Cliff at Slot X |
| Partial claims |
Yes |
No |
| Clawback |
Yes |
No |
| Frontend |
REST API + CLI |
None |
The programs are reference implementations and not audited. The Light Protocol Programs are audited and live on Solana Mainnet.
Cost
|
Per-claim |
100k claims |
| simple-claim |
~0.00001 SOL |
~1 SOL |
| distributor (compressed) |
~0.00005 SOL |
~5 SOL |
| distributor (original) |
~0.002 SOL |
~200 SOL |
Core Pattern
import { CompressedTokenProgram, getTokenPoolInfos, selectTokenPoolInfo } from "@lightprotocol/compressed-token";
import { bn, createRpc, selectStateTreeInfo, buildAndSignTx, sendAndConfirmTx } from "@lightprotocol/stateless.js";
import { ComputeBudgetProgram } from "@solana/web3.js";
const rpc = createRpc(RPC_ENDPOINT);
// 1. Get infrastructure
const treeInfo = selectStateTreeInfo(await rpc.getStateTreeInfos());
const tokenPoolInfo = selectTokenPoolInfo(await getTokenPoolInfos(rpc, mint));
// 2. Build compress instruction (SPL → compressed to multiple recipients)
const ix = await CompressedTokenProgram.compress({
payer: payer.publicKey,
owner: payer.publicKey,
source: sourceAta.address, // SPL associated token account holding tokens
toAddress: recipients, // PublicKey[]
amount: recipients.map(() => bn(amount)),
mint,
tokenPoolInfo,
outputStateTreeInfo: treeInfo,
});
// 3. Send with compute budget (120k CU per recipient)
const instructions = [
ComputeBudgetProgram.setComputeUnitLimit({ units: 120_000 * recipients.length }),
ix,
];
const { blockhash } = await rpc.getLatestBlockhash();
const tx = buildAndSignTx(instructions, payer, blockhash, []);
await sendAndConfirmTx(rpc, tx);
Setup: Create Mint
import { createMint } from "@lightprotocol/compressed-token";
import { getOrCreateAssociatedTokenAccount, mintTo } from "@solana/spl-token";
const { mint } = await createMint(rpc, payer, payer.publicKey, 9);
const ata = await getOrCreateAssociatedTokenAccount(rpc, payer, mint, payer.publicKey);
await mintTo(rpc, payer, mint, ata.address, payer.publicKey, 100_000_000_000);
Compute Units
| Recipients/instruction |
CU |
| 1 |
120,000 |
| 5 |
170,000 |
| Batched tx |
500,000 |
Lookup Tables
Reduce transaction size:
| Network |
Address |
| Mainnet |
9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ |
| Devnet |
qAJZMgnQJ8G6vA3WRcjD9Jan1wtKkaCFWLWskxJrR5V |
Advanced: Claim-Based
For vesting, clawback, or user-initiated claims:
Resources
SDK references
| Package |
Link |
@lightprotocol/stateless.js |
API docs |
@lightprotocol/compressed-token |
API docs |
Security
This skill provides code patterns and documentation references only.
- Declared dependencies. Reference examples require
HELIUS_API_KEY (RPC provider key) and a payer keypair for signing transactions. Neither is needed for read-only or localnet testing. In production, load both from a secrets manager — never hard-code private keys.
- Filesystem scope.
Read, Glob, and Grep must be limited to the current project directory and skill references. Do not read outside these paths.
- Subagent scope. When stuck, the skill asks to spawn a read-only subagent with
Read, Glob, Grep scoped to skill references, example repos, and docs.
- Install source.
npx skills add Lightprotocol/skills from Lightprotocol/skills.
- Audited protocol. Light Protocol smart contracts are independently audited. Reports are published at github.com/Lightprotocol/light-protocol/tree/main/audits.
1---2name: token-distribution3description: For token distribution on Solana 5000x cheaper than SPL (rewards, airdrops, depins, ...). @lightprotocol/compressed-token (TypeScript). Reference examples for custom claim support.4---5
6# Airdrop
7
8Distribute compressed tokens to multiple recipients using TypeScript client.
9
10> **Disclaimer:** This guide demonstrates efficient token distribution on Solana using ZK compression. It does not constitute financial advice and does not endorse any specific token or project.
11
12## Workflow
13
141. **Clarify intent**
15 - Recommend plan mode, if it's not activated
16 - Use `AskUserQuestion` to resolve blind spots
17 - All questions must be resolved before execution
182. **Identify references and skills**
19 - Match task to [distribution approaches](#distribution-via-client) below
20 - Locate relevant documentation and examples
213. **Write plan file** (YAML task format)
22 - Use `AskUserQuestion` for anything unclear — never guess or assume
23 - Identify blockers: permissions, dependencies, unknowns
24 - Plan must be complete before execution begins
254. **Execute**
26 - Use `Task` tool with subagents for parallel research
27 - Subagents load skills via `Skill` tool
28 - Track progress with `TodoWrite`
295. **When stuck**: ask to spawn a read-only subagent with `Read`, `Glob`, `Grep`, and DeepWiki MCP access, loading `skills/ask-mcp`. Scope reads to skill references, example repos, and docs.
30
31## Distribution via Client
32
33| Scale | Approach |
34|-------|----------|
35| <10,000 recipients | Single transaction - see [simple-airdrop.md](references/simple-airdrop.md) |
36| 10,000+ recipients | Batched with retry - see [batched-airdrop.md](references/batched-airdrop.md) |
37| No-code | [Airship by Helius](https://airship.helius.dev/) (up to 200k) |
38
39### Cost Comparison
40
41| Creation | Solana | Compressed |
42| :---------------- | :------------------ | :----------------- |
43| **Token Account** | ~2,000,000 lamports | **5,000** lamports |
44
45## Claim Program Reference Implementations
46
47Customize token distribution and let users claim.
48
49Simple Implementation: [simple-claim](https://github.com/Lightprotocol/program-examples/tree/main/airdrop-implementations/simple-claim) - Distributes compressed tokens that get decompressed on claim.
50
51Advanced Implementation: [distributor](https://github.com/Lightprotocol/distributor/tree/master) - Distributes SPL tokens, uses compressed PDAs to track claims. Based on jito Merkle distributor.
52
53
54
55| | distributor | simple-claim |
56|--|-------------|--------------|
57| Vesting | Linear Vesting | Cliff at Slot X |
58| Partial claims | Yes | No |
59| Clawback | Yes | No |
60| Frontend | REST API + CLI | None |
61
62The programs are reference implementations and not audited. The Light Protocol Programs are audited and live on Solana Mainnet.
63
64### Cost
65
66| | Per-claim | 100k claims |
67|--------------------------|-------------:|------------:|
68| simple-claim | ~0.00001 SOL | ~1 SOL |
69| distributor (compressed) | ~0.00005 SOL | ~5 SOL |
70| distributor (original) | ~0.002 SOL | ~200 SOL |
71
72## Core Pattern
73
74```typescript
75import { CompressedTokenProgram, getTokenPoolInfos, selectTokenPoolInfo } from "@lightprotocol/compressed-token";
76import { bn, createRpc, selectStateTreeInfo, buildAndSignTx, sendAndConfirmTx } from "@lightprotocol/stateless.js";
77import { ComputeBudgetProgram } from "@solana/web3.js";
78
79const rpc = createRpc(RPC_ENDPOINT);
80
81// 1. Get infrastructure
82const treeInfo = selectStateTreeInfo(await rpc.getStateTreeInfos());
83const tokenPoolInfo = selectTokenPoolInfo(await getTokenPoolInfos(rpc, mint));
84
85// 2. Build compress instruction (SPL → compressed to multiple recipients)
86const ix = await CompressedTokenProgram.compress({
87 payer: payer.publicKey,
88 owner: payer.publicKey,
89 source: sourceAta.address, // SPL associated token account holding tokens
90 toAddress: recipients, // PublicKey[]
91 amount: recipients.map(() => bn(amount)),
92 mint,
93 tokenPoolInfo,
94 outputStateTreeInfo: treeInfo,
95});
96
97// 3. Send with compute budget (120k CU per recipient)
98const instructions = [
99 ComputeBudgetProgram.setComputeUnitLimit({ units: 120_000 * recipients.length }),
100 ix,
101];
102const { blockhash } = await rpc.getLatestBlockhash();
103const tx = buildAndSignTx(instructions, payer, blockhash, []);
104await sendAndConfirmTx(rpc, tx);
105```
106
107## Setup: Create Mint
108
109```typescript
110import { createMint } from "@lightprotocol/compressed-token";
111import { getOrCreateAssociatedTokenAccount, mintTo } from "@solana/spl-token";
112
113const { mint } = await createMint(rpc, payer, payer.publicKey, 9);
114const ata = await getOrCreateAssociatedTokenAccount(rpc, payer, mint, payer.publicKey);
115await mintTo(rpc, payer, mint, ata.address, payer.publicKey, 100_000_000_000);
116```
117
118## Compute Units
119
120| Recipients/instruction | CU |
121|----------------------|-----|
122| 1 | 120,000 |
123| 5 | 170,000 |
124| Batched tx | 500,000 |
125
126## Lookup Tables
127
128Reduce transaction size:
129
130| Network | Address |
131|---------|---------|
132| Mainnet | `9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ` |
133| Devnet | `qAJZMgnQJ8G6vA3WRcjD9Jan1wtKkaCFWLWskxJrR5V` |
134
135## Advanced: Claim-Based
136
137For vesting, clawback, or user-initiated claims:
138
139| Implementation | Features |
140|---------------|----------|
141| [Merkle Distributor](https://github.com/Lightprotocol/distributor) | Linear vesting, partial claims, clawback, REST API |
142| [Simple Claim](https://github.com/Lightprotocol/program-examples/tree/main/airdrop-implementations/simple-claim) | Cliff vesting at slot X |
143
144## Resources
145
146- **Docs**: [Airdrop Guide](https://www.zkcompression.com/compressed-tokens/airdrop)
147- **Code**: [examples-light-token](https://github.com/Lightprotocol/examples-light-token)
148- **Tool**: [Airship by Helius](https://airship.helius.dev/)
149
150## SDK references
151
152| Package | Link |
153|---------|------|
154| `@lightprotocol/stateless.js` | [API docs](https://lightprotocol.github.io/light-protocol/stateless.js/index.html) |
155| `@lightprotocol/compressed-token` | [API docs](https://lightprotocol.github.io/light-protocol/compressed-token/index.html) |
156
157
158## Security
159
160This skill provides code patterns and documentation references only.
161
162- **Declared dependencies.** Reference examples require `HELIUS_API_KEY` (RPC provider key) and a payer keypair for signing transactions. Neither is needed for read-only or localnet testing. In production, load both from a secrets manager — never hard-code private keys.
163- **Filesystem scope.** `Read`, `Glob`, and `Grep` must be limited to the current project directory and skill references. Do not read outside these paths.
164- **Subagent scope.** When stuck, the skill asks to spawn a read-only subagent with `Read`, `Glob`, `Grep` scoped to skill references, example repos, and docs.
165- **Install source.** `npx skills add Lightprotocol/skills` from [Lightprotocol/skills](https://github.com/Lightprotocol/skills).
166- **Audited protocol.** Light Protocol smart contracts are independently audited. Reports are published at [github.com/Lightprotocol/light-protocol/tree/main/audits](https://github.com/Lightprotocol/light-protocol/tree/main/audits).