Light Token and ZK Compression allows you to build scalable Solana applications with rent-free token and mint accounts and PDA's.
| Metric |
Light |
Standard Solana |
| Mint Account |
~0.000091 SOL |
~0.0015 SOL |
| Token Account |
~0.000017 SOL |
~0.0029 SOL |
| PDA (100-byte) |
~0.000012 SOL |
~0.0016 SOL |
- All light mint and token accounts are on-chain accounts like SPL, but the light token program sponsors the rent-exemption cost for you.
- Light-token accounts can hold balances from any light, SPL, or Token-2022 mint.
- Light-mint accounts represent a unique mint and optionally can store token-metadata. Functionally equivalent to SPL mints.
- 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.
How to Use this Repository
Browse contents below, or use AI (
).
- Open deepwiki.com/Lightprotocol/examples-light-token
- Describe your use case and additional context in the chat bar to "AskDevin"
- Get relevant resources, code examples, and integration guidance
You can use DeepWiki to index any public GitHub repository.
Toolkits
|
Description |
| Payments |
All you need for wallet integrations and payment flows. Minimal API differences to SPL. |
| Streaming Tokens |
Stream mint events using Laserstream |
| Sign with Privy |
Light-token operations signed with Privy wallets (Node.js + React) |
| Sign with Wallet Adapter |
Sign light-token transactions with Wallet Adapter (React) |
| Gasless Transactions |
Abstract SOL fees so users never hold SOL. Set your application as the fee payer. Sponsor rent top-ups and transaction fees. |
| spl-to-light-transfer |
|
| Token 2022 Extensions |
Create mints with Token 2022 extensions and register them for Light Token |
Client Examples
TypeScript
|
|
|
Description |
| create-mint |
Action |
Instruction |
Create a light-token mint with metadata |
| create-spl-mint |
Action |
Instruction |
Create an SPL mint with SPL interface PDA |
| create-t22-mint |
Action |
Instruction |
Create a Token 2022 mint with SPL interface PDA |
| create-spl-interface |
Action |
Instruction |
Register SPL interface PDA for an existing mint |
| create-ata |
Action |
Instruction |
Create an associated light-token account |
| create-ata-explicit-rent-sponsor |
Action |
|
Create an ATA with explicit rent sponsor |
| load-ata |
Action |
Instruction |
Load token accounts from light-token, compressed tokens, SPL/T22 to one unified balance |
| mint-to |
Action |
Instruction |
Mint tokens to a light-account |
| transfer-interface |
Action |
Instruction |
Transfer between light-token, T22, and SPL accounts |
| wrap |
Action |
Instruction |
Wrap SPL/T22 to light-token |
| unwrap |
Action |
Instruction |
Unwrap light-token to SPL/T22 |
| approve |
Action |
|
Approve delegate |
| revoke |
Action |
|
Revoke delegate |
| delegate-transfer |
Action |
|
Delegate transfers tokens on behalf of owner |
Rust
Program Examples
Examples
|
Description |
| escrow |
Peer-to-peer light-token swap with offer/accept flow |
| fundraiser |
Token fundraiser with target, deadline, and refunds |
| light-token-minter |
Create light-mints with metadata, mint tokens |
| token-swap |
AMM with liquidity pools and swaps (Anchor) |
| cp-swap-reference |
Fork of Raydium AMM that creates markets without paying rent-exemption |
| pinocchio-swap |
AMM with liquidity pools and swaps (Pinocchio) |
| create-and-transfer |
Create account via macro and transfer via CPI |
Macros
Instructions
The instructions use pure CPI calls which you can combine with existing and / or light macros.
For existing programs, you can replace spl_token with light_token instructions as you need. The API is a superset of SPL-token so switching is straightforward.
Documentation