> ## Documentation Index
> Fetch the complete documentation index at: https://www.zkcompression.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Considerations

> Overview to considerations of ZK Compression, namely larger transaction size, higher compute unit usage, and per-transaction state cost.

# 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.

| Primitive                             | Tx size / CU / State cost                                                                                  | More                                                                                                              |
| :------------------------------------ | :--------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
| **Compressed Token / Compressed PDA** | The limits below apply to every operation.                                                                 | [Legacy Compressed Tokens](/resources/legacy-compressed-tokens), [Compressed PDAs](/pda/compressed-pdas/overview) |
| **Light Token**                       | Hot path: smaller tx, fewer CU than SPL. Cold path: same as compressed. Rent calculator for creation cost. | [Light Token Standard](/learn/light-token-standard)                                                               |
| **Light PDA**                         | Hot path: same tx size and CU as regular PDA. Cold path: same as compressed.                               | [Light PDA](/pda/light-pda/overview)                                                                              |

# 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

<Note>
  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.
</Note>

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

<Info>
  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](https://eprint.iacr.org/2019/458.pdf) 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](/learn/light-token-standard) and [Light PDA](/pda/light-pda/overview).
</Info>

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**](https://solana.com/developers/guides/advanced/how-to-use-priority-fees) **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.

| What                | Lamports            | When                                                                                                                                     |
| :------------------ | :------------------ | :--------------------------------------------------------------------------------------------------------------------------------------- |
| Solana base fee     | 5,000 per signature | Every transaction                                                                                                                        |
| State tree (V2)     | 5,000 per tree      | Once per tree per instruction, whether you read, write, or both.                                                                         |
| State tree (V1)     | 5,000 per tree      | Charged 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 leaf      | Each new state leaf (any tree; default depth 26).                                                                                        |
| New address         | 10,000 per address  | One-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!

<CardGroup>
  <Card title="Light Token Standard" icon="chevron-right" color="#0066ff" href="/learn/light-token-standard" horizontal>
    Rent calculator and CU comparison vs SPL.
  </Card>

  <Card title="Light PDA" icon="chevron-right" color="#0066ff" href="/pda/light-pda/overview" horizontal />

  <Card title="Compressed Tokens" icon="chevron-right" color="#0066ff" href="/resources/legacy-compressed-tokens" horizontal />

  <Card title="Compressed PDAs" icon="chevron-right" color="#0066ff" href="/pda/compressed-pdas/overview" horizontal />
</CardGroup>
