-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathllms.txt
More file actions
158 lines (136 loc) · 16.8 KB
/
Copy pathllms.txt
File metadata and controls
158 lines (136 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# ZK Compression by Light Protocol and Helius Labs
> ZK Compression is a framework on Solana for token distribution, stablecoin payments, consumer apps, per-user state, and more.
> The Light SDK and APIs let you create token and PDA accounts without rent-exemption, with a familiar Solana developer experience.
This documentation provides guides, references and tutorials for developers building on Solana.
## Table of contents
- [Primitives](#primitives)
- [AI Agent Resources](#ai-agent-resources)
- [Getting Started](#getting-started)
- [SDK Reference](#sdk-reference)
- [Compressed Tokens](#compressed-tokens)
- [Compressed PDA](#compressed-pda)
- [Custom ZK Applications](#custom-zk-applications)
- [Learn](#learn)
- [Resources](#resources)
- [JSON RPC Methods](#json-rpc-methods)
- [Support](#support)
- [Examples](#examples)
- [OpenAPI Specs](#openapi-specs)
## Primitives
| Primitive | Use case | Constraints |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Compressed Token | Token use cases such as token distribution, stablecoin payments, and storing balances rent-free. Always compressed and rent-free. Works with SPL and Token-2022. Supported by Phantom and Backpack. | The SPL mint and interface PDA pay rent; individual token accounts do not. |
| Compressed PDA | Per-user and app state, nullifiers (payments and ZK applications), DePIN nodes, and stake accounts. Similar to program-derived addresses without a rent-exempt balance. | Programs invoke the Light System Program (not the System Program) with a validity proof. |
View the SDK reference: [https://www.zkcompression.com/api-reference/sdk](https://www.zkcompression.com/api-reference/sdk).
Comparing creation cost:
| Creation | Solana | Compressed |
| :---------------- | :------------------ | :----------------- |
| **Token Account** | ~2,000,000 lamports | **5,000** lamports |
## AI Agent Resources
Install orchestrator agent skill or view [skill.md](https://www.zkcompression.com/skill.md):
```bash
npx skills add https://zkcompression.com
```
Install or view [dedicated agent skills](/ai-tools/overview#agent-skills).
```
npx skills add Lightprotocol/skills
```
- [Agent skills](https://www.zkcompression.com/ai-tools/agent-skills.md): Install structured agent skill files for Token APIs and PDA accounts. Skills tell AI coding agents what they can do with ZK Compression.
- [MCP](https://www.zkcompression.com/ai-tools/mcp.md): Connect AI apps to Light Protocol data sources and tools via the Model Context Protocol (MCP). Includes installation for Claude Code, Codex, Cursor, and more.
- [AI Prompts](https://www.zkcompression.com/ai-tools/prompts.md): 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.
- [Orchestration Skill](https://www.zkcompression.com/skill.md): Full agent skill for AI coding agents.
- **Agent Skills:** [compressed-token](https://github.com/Lightprotocol/skills/tree/main/skills/compressed-token): For token use cases on Solana, such as token distribution, stablecoin payments and more. Works with Token-2022, Privy, Wallet Adapter similarly to SPL.
- **Agent Skills:** [compressed-pda](https://github.com/Lightprotocol/skills/tree/main/skills/compressed-pda): For program development on Solana with infrequently accessed state, such as per-user state, DePIN registrations, nullifiers, or custom compressed accounts.
- **Agent Skills:** [zk](https://github.com/Lightprotocol/skills/tree/main/skills/zk): For custom ZK Solana programs and privacy-preserving applications to prevent double spending.
- **Agent Skills:** [testing](https://github.com/Lightprotocol/skills/tree/main/skills/testing): For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.
- **Agent Skills:** [ask-mcp](https://github.com/Lightprotocol/skills/tree/main/skills/ask-mcp): For questions about compressed accounts, Light SDK, Solana development, Claude Code features, or agent skills.
## Getting Started
- [Welcome to ZK Compression](https://www.zkcompression.com/home.md)
## SDK Reference
- [SDK Reference](https://www.zkcompression.com/api-reference/sdk.md): Client and program SDKs for Compressed Tokens and ZK Compression.
## Compressed Tokens
- [Overview](https://www.zkcompression.com/compressed-tokens/overview.md): Overview to compressed tokens and guides with full code examples. Use for distributing tokens (eg rewards, airdrops) or creating associated token accounts for users.
### Cookbook
- [Create Compressed Token Accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts.md): Short guide to compressed token account creation with ZK Compression on Solana and difference to regular token accounts.
- [Mint Compressed Tokens](https://www.zkcompression.com/compressed-tokens/guides/mint-compressed-tokens.md): "Mint tokens to compressed token accounts for recipients and increases a mint's token supply. Only the mint authority can perform this operation.
- [Transfer Compressed Tokens](https://www.zkcompression.com/compressed-tokens/guides/transfer-compressed-tokens.md): Transfer compressed tokens between accounts. Transfers consume input accounts and create new output accounts with updated balances.
- [Compress and Decompress SPL Tokens](https://www.zkcompression.com/compressed-tokens/guides/compress-decompress.md): Convert SPL tokens between compressed and regular format with compress() and decompress().
- [Compress Complete SPL Token Accounts](https://www.zkcompression.com/compressed-tokens/guides/compress-spl-token-account.md): Compress the entire balance of an SPL token account to reclaim rent. Optionally leave some tokens in SPL format.
- [Create a Mint Account with Interface PDA for Compression](https://www.zkcompression.com/compressed-tokens/guides/create-mint-with-token-pool.md): Create an SPL token mint with an interface PDA for compression. The interface PDA locks tokens while compressed and releases them when decompressed.
- [Create Interface PDAs for Compression to Existing Mints](https://www.zkcompression.com/compressed-tokens/guides/add-token-pools-to-mint-accounts.md): Create an interface PDA for an existing SPL mint. Requires only fee_payer with no mint authority constraint.
- [Merge Compressed Token Accounts](https://www.zkcompression.com/compressed-tokens/guides/merge-compressed-token-accounts.md): Consolidate multiple compressed token accounts of the same mint into a single account to reduce fragmentation.
- [Approve and Revoke Delegate Authority](https://www.zkcompression.com/compressed-tokens/guides/delegate.md): Grant and remove delegate spending authority for compressed tokens with approve() and revoke(). Only the token owner can perform these operations.
- [Combine Instructions in One Transaction](https://www.zkcompression.com/compressed-tokens/combine-instructions.md): Guide to combine multiple instructions in a single transaction. Full code example for interface PDA creation and for first-time compression of existing SPL tokens.
### Integration Guides
- [Rent-Free SPL Accounts with Privy](https://www.zkcompression.com/compressed-tokens/privy.md): Integrate compressed tokens with Privy embedded wallets for rent-free SPL token accounts and transfers.
- [Token Distribution Guide](https://www.zkcompression.com/compressed-tokens/token-distribution.md): Complete client and program guides to create an airdrop – with or without code. ZK compression is the most efficient way to distribute SPL tokens.
- [Add Wallet Support for Compressed Tokens](https://www.zkcompression.com/compressed-tokens/wallet-integration.md): Guide to add Compressed Token Support to Your Wallet Application
- [Use Token-2022 with Compression](https://www.zkcompression.com/compressed-tokens/token-2022.md): Complete guide to mint, compress and transfer tokens with Token-2022 Metadata with ZK Compression.
## Compressed PDA
- [Overview & Program Template](https://www.zkcompression.com/compressed-pdas/overview.md): Compressed PDAs provide full composability and functionality of accounts at PDAs, without rent-exemption cost per account. Suited for accounts where each user or entity gets their own PDA and state is infrequently accessed.
- [Client Guide](https://www.zkcompression.com/compressed-pdas/guides/client-guide.md): Rust and Typescript client guides with step-by-step implementation and full code examples.
- [Program Examples](https://www.zkcompression.com/compressed-pdas/program-examples.md): Program example repository for compressed accounts with tests.
- [Create Nullifier PDAs](https://www.zkcompression.com/compressed-pdas/nullifier-pda.md): For some use cases, such as sending payments, you might want to prevent your on chain instruction from being executed more than once.
- [Solana Attestation Service (Devnet)](https://www.zkcompression.com/compressed-pdas/solana-attestation-service.md): Credential system for KYC verification, professional badges, and compliance credentials in minutes. Currently undergoing audit. On mainnet today, you can integrate compressed PDAs to achieve similar functionality.
### Program Guides
- [Overview](https://www.zkcompression.com/compressed-pdas/guides.md): Overview to guides for Solana programs to create, update, close, reinitialize, and burn permanently compressed accounts.
- [Create Compressed Accounts](https://www.zkcompression.com/compressed-pdas/guides/how-to-create-compressed-accounts.md): Guide to create compressed accounts in Solana programs with full code examples.
- [Update Compressed Accounts](https://www.zkcompression.com/compressed-pdas/guides/how-to-update-compressed-accounts.md): Guide to update compressed accounts in Solana programs with full code examples.
- [Close Compressed Accounts](https://www.zkcompression.com/compressed-pdas/guides/how-to-close-compressed-accounts.md): Guide to close compressed accounts in Solana programs with full code examples.
- [Reinitialize Compressed Accounts](https://www.zkcompression.com/compressed-pdas/guides/how-to-reinitialize-compressed-accounts.md): Guide to reinitialize compressed accounts in Solana programs with full code examples.
- [Burn Compressed Accounts](https://www.zkcompression.com/compressed-pdas/guides/how-to-burn-compressed-accounts.md): Guide to burn compressed accounts in Solana programs with full code examples.
## Custom ZK Applications
- [Primitives for ZK on Solana](https://www.zkcompression.com/zk/overview.md): Overview how to build a ZK program on Solana.
- [Examples](https://www.zkcompression.com/zk/examples.md): Example projects for building ZK programs on Solana.
## Learn
### Core Concepts
- [High-level System Overview](https://www.zkcompression.com/learn/overview.md): Overview to ZK Compression's Core Concepts. Get a high-level system overview and learn about the compressed account model, lifecycle of a transaction, and considerations.
- [Compressed Account Model](https://www.zkcompression.com/learn/compressed-account-model.md): Overview to compressed accounts and comparison to Solana accounts.
- [Merkle trees and Validity Proofs](https://www.zkcompression.com/learn/merkle-trees-validity-proofs.md): Learn the core concepts of state trees, address trees, and validity proofs for compressed accounts.
- [Lifecycle of a Transaction](https://www.zkcompression.com/learn/transaction-lifecycle.md): Overview to the lifecycle of a transaction that interacts with compressed accounts.
- [Considerations](https://www.zkcompression.com/learn/considerations.md): Overview to considerations of ZK Compression, namely larger transaction size, higher compute unit usage, and per-transaction state cost.
## Resources
- [Guide to Migrate from v1 to v2 Merkle trees](https://www.zkcompression.com/resources/migration-v1-to-v2.md): V2 reduces CU consumption by up to 70%. V1 remains supported for existing deployments.
- [Addresses and URLs](https://www.zkcompression.com/resources/addresses-and-urls.md): Overview to all of ZK Compression's RPC URLs, Program IDs & Accounts and Lookup Tables.
- [Security](https://www.zkcompression.com/resources/security.md): Overview to Light Protocol's bug bounty program, third party security audits, and formal verification of circuits.
### Error Cheatsheet
- [Error Cheatsheet](https://www.zkcompression.com/resources/error-cheatsheet.md): Complete error code reference for ZK Compression. Search error codes with hex values and messages.
- [Debug ProofVerificationFailed (0x179b)](https://www.zkcompression.com/resources/error-cheatsheet/debug-0x179b-6043-proofverificationfailed.md): Common cause and debug steps for ProofVerificationFailed (0x179B / 6043)
## JSON RPC Methods
- [JSON RPC Methods](https://www.zkcompression.com/api-reference/json-rpc-methods/overview.md): Photon indexer methods for querying compressed state on Solana.
## Support
- [Support](https://www.zkcompression.com/support.md): Get expert help with Compressed Tokens and ZK Compression. Discord community, Telegram, and Email support available.
## Examples
- [compressed-token-cookbook](https://github.com/Lightprotocol/examples-zk-compression/tree/main/compressed-token-cookbook): Action-level and instruction-level examples for every compressed token operation, plus wallet integration.
- [example-token-distribution](https://github.com/Lightprotocol/examples-zk-compression/tree/main/example-token-distribution): Simple and optimized batched airdrop flows, with a decompress-on-claim pattern.
- [program-examples](https://github.com/Lightprotocol/program-examples): Compressed PDA programs (counter, basic operations, create-and-update, nullifier, zk-id) in Anchor, native, and Pinocchio.
## OpenAPI Specs
- [api](https://www.zkcompression.com/openapi/api.yaml)
- [getColdMint](https://www.zkcompression.com/openapi/getColdMint.yaml)
- [getColdMintsByAuthority](https://www.zkcompression.com/openapi/getColdMintsByAuthority.yaml)
- [getCompressedAccount](https://www.zkcompression.com/openapi/getCompressedAccount.yaml)
- [getCompressedAccountBalance](https://www.zkcompression.com/openapi/getCompressedAccountBalance.yaml)
- [getCompressedAccountProof](https://www.zkcompression.com/openapi/getCompressedAccountProof.yaml)
- [getCompressedAccountsByOwner](https://www.zkcompression.com/openapi/getCompressedAccountsByOwner.yaml)
- [getCompressedBalanceByOwner](https://www.zkcompression.com/openapi/getCompressedBalanceByOwner.yaml)
- [getCompressedMintTokenHolders](https://www.zkcompression.com/openapi/getCompressedMintTokenHolders.yaml)
- [getCompressedTokenAccountBalance](https://www.zkcompression.com/openapi/getCompressedTokenAccountBalance.yaml)
- [getCompressedTokenAccountsByDelegate](https://www.zkcompression.com/openapi/getCompressedTokenAccountsByDelegate.yaml)
- [getCompressedTokenAccountsByOwner](https://www.zkcompression.com/openapi/getCompressedTokenAccountsByOwner.yaml)
- [getCompressedTokenBalancesByOwner](https://www.zkcompression.com/openapi/getCompressedTokenBalancesByOwner.yaml)
- [getCompressedTokenBalancesByOwnerV2](https://www.zkcompression.com/openapi/getCompressedTokenBalancesByOwnerV2.yaml)
- [getCompressionSignaturesForAccount](https://www.zkcompression.com/openapi/getCompressionSignaturesForAccount.yaml)
- [getCompressionSignaturesForAddress](https://www.zkcompression.com/openapi/getCompressionSignaturesForAddress.yaml)
- [getCompressionSignaturesForOwner](https://www.zkcompression.com/openapi/getCompressionSignaturesForOwner.yaml)
- [getCompressionSignaturesForTokenOwner](https://www.zkcompression.com/openapi/getCompressionSignaturesForTokenOwner.yaml)
- [getIndexerHealth](https://www.zkcompression.com/openapi/getIndexerHealth.yaml)
- [getIndexerSlot](https://www.zkcompression.com/openapi/getIndexerSlot.yaml)
- [getLatestCompressionSignatures](https://www.zkcompression.com/openapi/getLatestCompressionSignatures.yaml)
- [getLatestNonVotingSignatures](https://www.zkcompression.com/openapi/getLatestNonVotingSignatures.yaml)
- [getMultipleCompressedAccountProofs](https://www.zkcompression.com/openapi/getMultipleCompressedAccountProofs.yaml)
- [getMultipleCompressedAccounts](https://www.zkcompression.com/openapi/getMultipleCompressedAccounts.yaml)
- [getMultipleNewAddressProofs](https://www.zkcompression.com/openapi/getMultipleNewAddressProofs.yaml)
- [getMultipleNewAddressProofsV2](https://www.zkcompression.com/openapi/getMultipleNewAddressProofsV2.yaml)
- [getQueueElements](https://www.zkcompression.com/openapi/getQueueElements.yaml)
- [getTransactionWithCompressionInfo](https://www.zkcompression.com/openapi/getTransactionWithCompressionInfo.yaml)
- [getValidityProof](https://www.zkcompression.com/openapi/getValidityProof.yaml)