Skip to main content

Overview

The sections below describe compressed account tradeoffs: larger tx size, higher CU when reading/writing state trees, and per-transaction state cost. These apply when your transaction reads or writes compressed state (e.g. Compressed Tokens, Compressed PDAs, or loading cold Light Token / Light PDA accounts). Light Token and Light PDA have different tradeoffs on the hot path: Light Token is more CU efficient than SPL (e.g. ~312 CU transfer vs ~4,645 SPL); Light PDA hot path adds no extra CU versus a regular PDA. Cold path (loading from compressed) uses the same mechanics as below.
PrimitiveTx size / CU / State costMore
Compressed Token / Compressed PDAThe limits below apply to every operation.Legacy Compressed Tokens, Compressed PDAs
Light TokenHot path: smaller tx, fewer CU than SPL. Cold path: same as compressed. Rent calculator for creation cost.Light Token Standard
Light PDAHot path: same tx size and CU as regular PDA. Cold path: same as compressed.Light PDA

Limitations of compressed account operations

When your transaction reads or writes compressed state, consider:
  • Larger Transaction Size
  • High Compute Unit Usage
  • Per-Transaction State Cost

General Recommendation

Consider which accounts in your application benefit from ZK Compression and which don’t.
  • You can use both types for different parts of your application.
  • You can decompress and compress accounts at will.
It may be preferred for an account not to be permanently compressed if:
  • The account gets updated very frequently within a single block (e.g., shared liquidity pools in a DeFi protocol).
  • You expect the lifetime number of writes to the same account to be very large (>>1000x).
  • The account stores large amounts of data, and you need to access a large part of it (>1kb) inside one on-chain transaction.

Larger Transaction Size

Solana’s transaction size limit is 1232 Bytes. When your transaction reads or writes compressed state, size increases in two ways:
  • 128 bytes must be reserved for the validity proof, which is a constant size per transaction, assuming the transaction reads from at least one compressed account.
  • For V2: The real byte overhead is 1 or 129 bytes, depending on how cold the account is. For V1: it’s always 128 bytes.
  • You must send the account data you want to read/write on-chain.

High Compute Unit Usage

System CU usage when reading/writing compressed state:
  • ~100,000 CU for validity proof verification (constant per transaction that touches compressed state)
  • ~100,000 CU system use (state tree Poseidon hashing et al.)
  • ~6,000 CU per compressed account read/write
Example: a typical compressed token transfer uses around 292,000 CU.This does not apply to Light Token or Light PDA hot path: Light Token transfers use far fewer CU than SPL; Light PDA hot path adds no extra CU. See Light Token Standard and Light PDA.
Higher CU usage can:
  • Lead to usage limits: The total CU limit per transaction is 1,400,000 CU, and the per-block write lock limit per State tree is 12,000,000 CU.
  • Require your users to increase their priority fee during congestion: Whenever Solana’s global per-block CU limit (48,000,000 CU) is reached, validator clients may prioritize transactions with higher per-CU priority fees.

State Cost per Transaction

Writing compressed account state costs a network fee per state tree plus rollover per new leaf. New addresses cost a one-time fee. All amounts are in addition to Solana’s base fee.
WhatLamportsWhen
Solana base fee5,000 per signatureEvery transaction
State tree (V2)5,000 per treeOnce per tree per instruction, whether you read, write, or both.
State tree (V1)5,000 per treeCharged separately for trees you read from (nullify) and trees you write to (create). So 1 read + 1 write on same tree = 10,000.
New leaf (rollover)~300 per leafEach new state leaf (any tree; default depth 26).
New address10,000 per addressOne-time when creating an address (v2 address tree).
In practice: A transfer that updates one leaf on one tree is 5,000 + 300 lamports (V2) or 10,000 + 300 (V1). Creating 10 new outputs on one tree is 5,000 + 3,000 (same for both).

Next Steps

You’re ready to take the next step and start building!

Light Token Standard

Rent calculator and CU comparison vs SPL.

Light PDA

Compressed Tokens

Compressed PDAs