Skip to main content

Overview

zkCompression integrates Light Protocol to enable ZK Compression on Solana, allowing you to compress SPL tokens and reduce storage costs by up to 5000x.

How It Works

  1. Compress: Regular SPL tokens are converted to compressed tokens stored in a Merkle tree state.
  2. Store: Only the Merkle root is stored on-chain, dramatically reducing costs.
  3. Decompress: Compressed tokens can be decompressed back to regular SPL tokens at any time.

Cost Comparison

Compressed tokens are 5000x cheaper to create and 98% cheaper to transfer.

Terminal Commands

Show Help

Shows all available Light Protocol commands and cost savings info.

Compress SOL

Convert regular SOL to compressed SOL. Compressed SOL has NO rent costs. Example:

Decompress SOL

Convert compressed SOL back to regular SOL. Example:

Create Compressed Token

Create a new compressed SPL token mint (5000x cheaper than standard). Example:

Mint Compressed Tokens

Mint compressed tokens to a specified address.

Transfer Compressed Tokens

Transfer compressed tokens to another address.

Check Balance

Check compressed token balances for an address.

Account Info

Get detailed compressed account information including all token balances.

Airdrop

Mass token distribution to multiple recipients.

View Token Portfolio

Display unified portfolio view of all tokens (regular + compressed):

API Reference

Compress SOL

Response:

Decompress SOL

Response:

Create Compressed Token

Response:

Get Account Info

Response:

Technical Details

Light Protocol Integration

zkCompression uses the following Light Protocol packages:

Wallet Security

zkCompression implements wallet mutex locking and private key zeroization for security:
  1. Mutex locking prevents concurrent wallet access
  2. Private keys are zeroized from memory after use
  3. Automatic retry polling for RPC indexer sync
  4. Auto-create Associated Token Account during decompression

RPC Configuration

zkCompression uses Helius RPC with Light Protocol extensions:

Error Handling

Example: Full Compression Flow