Skip to main content
CreationSolanaCompressed
Token Account~2,000,000 lamports5,000 lamports
  1. Compressed token accounts store token balance, owner, and other information of tokens like SPL and light-tokens.
  2. Compressed token accounts are rent-free.
  3. Any light-token or SPL token can be compressed/decompressed at will.
Wallets like Phantom and Backpack support compressed tokens. The UI does not distinguish between SPL and compressed tokens.

Token Distribution

  • Distribute tokens without paying up front rent per recipient.

Create an Airdrop

Storage of Inactive Token Accounts

  • Most (associated) token accounts are not frequently written to.
  • Store token accounts rent-free when inactive
  • Light-tokens are automatically compressed/decompressed, when active/inactive and include sponsored rent-exemption.

Learn about Light-Token

Get Started

1

Install dependencies

npm install @lightprotocol/stateless.js@0.22.1-alpha.1
npm install @lightprotocol/compressed-token
2

Set up your developer environment

By default, all guides use Localnet.
npm install -g @lightprotocol/zk-compression-cli@0.27.1-alpha.2
# Start a local test validator
light test-validator

## ensure you have the Solana CLI accessible in your system PATH
// createRpc() defaults to local test validator endpoints
import {
  Rpc,
  createRpc,
} from "@lightprotocol/stateless.js";

const connection: Rpc = createRpc();

async function main() {
  let slot = await connection.getSlot();
  console.log(slot);

  let health = await connection.getIndexerHealth(slot);
  console.log(health);
  // "Ok"
}

main();
1

Basic Guides

GuideDescription
Create Compressed Token AccountsCreate compressed and learn difference to regular token accounts
Mint Compressed TokensCreate new compressed tokens to existing mint
Transfer Compressed TokensMove compressed tokens between compressed accounts
Decompress and Compress TokensConvert SPL tokens between regular and compressed format
Compress Complete SPL Token AccountsCompress complete SPL token accounts and reclaim rent afterwards
Create a Mint with Token Pool for CompressionCreate new SPL mint with token pool for compression
Create Token Pools for Mint AccountsCreate token pool for compression for existing SPL mints
Merge Compressed AccountsConsolidate multiple compressed accounts of the same mint into one
Approve and Revoke Delegate AuthorityApprove or revoke delegates for compressed token accounts
2

Advanced Guides

GuideDescription
Combine Instructions in One TransactionExecute multiple token instructions within a single transaction
Create an Airdrop without ClaimCreate an airdrop that appears directly in recipients’ wallets (with or without code)
Example Airdrop with ClaimDemo for time-locked airdrop with compressed tokens
Add Wallet Support for Compressed TokensAdd compressed token support in your wallet application
Use Token-2022 with CompressionCreate compressed Token-2022 mints with metadata and other extensions
Example Web ClientDemonstrates how to use @lightprotocol/stateless.js in a browser environment to interact with ZK Compression
Example Node.js ClientScript to execute basic compression/decompression/transfers