> ## Documentation Index
> Fetch the complete documentation index at: https://lightprotocol-migration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Concepts

> Overview to ZK Compression's Core Concepts. Get a high-level system overview and learn about the compressed account model, lifecycle of a transaction, and considerations.

<Info>
  <div style={{display: "flex", alignItems: "center", padding: 0, margin: 0}}>
    <a href="https://deepwiki.com/Lightprotocol/light-protocol" style={{padding: 0, margin: 0, display: "inline-block"}}>
      <img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" style={{padding:0, margin:0, verticalAlign: "middle"}} />
    </a>

    <span style={{margin: 0, padding: 0, marginLeft: "8px"}}>to query the program examples in natural language.</span>
  </div>
</Info>

ZK Compression is an account primitive on Solana that drastically reduces on-chain state costs while maintaining Solana's security, composability, and performance.

## High Level System Overview

This is how it works at a high level:

### Storage of Compressed State

Compressed accounts store state as call data in [Solana's ledger](#user-content-fn-1)\[^1], removing rent per account.

### Accessing Compressed State

Transactions specify state they access (read/write) and include it in the transaction payload.

### State Validation

Solana Programs <Tooltip tip="A Cross Program Invocation (CPI) refers to when one program invokes the instructions of another program. This allows for the composability of Solana programs. Learn more about CPIs" cta="here" href="https://solana.com/docs/core/cpi">invoke</Tooltip> the <Tooltip tip="The system program enforces the compressed account layout with ownership and sum checks and verifies the validity of your input state. It is also invoked to create/write to compressed accounts and PDAs. See the program address here.">Light System Program</Tooltip> to update compressed state

1. **The protocol validates the state** (validity of existing state, sum checks, ownership checks)
2. **The protocol enforces a schema:** Classic Accounts → Compressed Accounts.\
   Compressed accounts have a layout similar to classic accounts.

### State Updates

The new state is recorded as a log on the Solana ledger with each transaction.

### Photon RPC Nodes

<Tooltip tip="RPC nodes index the Light Protocol programs. This allows clients to read and build transactions to interact with compressed state.The canonical ZK Compression indexer is named Photon, built by Helius Labs. See the Github repo for more info." cta="repo" href="https://github.com/helius-labs/photon">Photon RPC nodes</Tooltip> index the state changes, making the compressed account state available to clients via the ZK Compression RPC API.

### Forester Nodes

Keeper nodes that interact with the <Tooltip tip="Updates state and address trees. It is used by the Light System program.">Account Compression Program</Tooltip> to empty queues and rollover state trees.

<Check>
  Clients and custom programs do not interact with Forester nodes or the Account Compression Program. This is all done under the hood.
</Check>

## Next Steps

In the following sections, we'll dive into the core concepts that make ZK Compression possible:

* **Compressed Account Model**: Understand how compressed accounts differ from regular Solana accounts (not much!) and how they enhance efficiency.
* **State Trees**: Learn about the Merkle tree structure used to store compressed accounts and how it minimizes on-chain storage.
* **Validity Proofs**: Explore how the protocol uses zero-knowledge proofs to verify data validity while keeping proof sizes small.
* **Lifecycle of a Transaction**: Follow the journey of a ZK-compressed transaction from creation to execution.
* **Considerations**: Discover the trade-offs and scenarios where ZK Compression may or may not be the best solution.

<Card title="Compressed Account Model" href="/learn/core-concepts/compressed-account-model" icon="circle-user" horizontal />
