Scaling the Design Space for On-chain Applications with ZK Compression
Light Protocol Team Abstract This paper proposes Light Protocol, a set of smart contracts for Solana that introduces ZK Compression. Solana application developers can opt-in to compress their application’s on-chain state via the Light Protocol smart contracts. This reduces state cost by orders of magnitude while preserving the Solana L1’s security, performance, and composability. For the Solana validator network, widespread adoption of ZK Compression could help solve the state growth problem by limiting the state held in active memory by validators relative to the total state produced. Finally, Light Protocol opens up a new design space for zero-knowledge-based protocols and applications on Solana; because ZK Compression stores data in zero-knowledge-friendly data structures, applications can efficiently prove custom off-chain computations over ZK-compressed state.1 The Problem: Expensive On-chain State
For developers to scale their on-chain applications to large user bases, the marginal cost of data storage must be near zero. Solana has emerged as a leading Layer 1 blockchain, attracting application developers who aim to scale to large numbers of end users. However, storing data on the Solana L1 has become increasingly expensive for the network, and the cost trickles down to the application developer, limiting the design space for on-chain applications with low Lifetime Value (LTV) / Customer Acquisition Cost (CAC) ratios.2 ZK Compression
When a Solana account gets compressed, its data is hashed and stored as a leaf in a sparse binary Merkle tree structure. The tree’s state root (i.e., a small fingerprint of all compressed accounts in the tree) is stored on the blockchain. The underlying compressed account data is stored off-chain, e.g., as call data in the cheaper Solana ledger space. To read or write compressed state, transactions provide the compressed off-chain data and a succinct zero-knowledge proof (validity proof). Light Protocol verifies the validity proof against the respective on-chain state root to ensure that the provided data was previously emitted via the protocol smart contracts. The succinctness property of the zero-knowledge proof (a Groth16 SNARK [1]) ensures that the integrity of many compressed accounts can be verified on-chain with a constant proof size of 128 bytes, which is ideal for Solana’s highly constrained 1232-byte transaction size limit.3 Light Protocol System Architecture
The transaction flow in Light Protocol consists of the following key components:- Off-chain state storage: State is stored off-chain, e.g., as calldata in the Solana ledger.
- New Transactions specify state: Transactions include the compressed data they read or write, the state tree accounts, a pointer to a recent on-chain state root, and a corresponding validity proof, all included in the transaction payload.
- Applications must invoke the Light Protocol system program to write compressed state.
- The system program validates the state (verifies the validity proof, performing sum checks and ownership checks)
- It enforces an account schema resembling the layout of classic Solana accounts.
- The old compressed state is nullified (inserted into the nullifier queue).
- The new compressed state is appended to the state Merkle Tree and recorded as call data on the Solana ledger.
- Any newly created addresses are inserted into the address queue.
- Photon Indexer nodes index and store events to make compressed account state available to clients. A new node can always sync with the latest compressed state by sequentially processing all historical transactions from Genesis.

- In principle, new compressed account hashes (output state) get appended to specified state trees with each state transition.
- Old compressed account hashes (input state) get invalidated via insertion into a nullifier queue.
- Compressed state transitions are atomic and instantly final.

- Each compressed account can be identified by its hash.
- Each write to a compressed account changes its hash.
- An address can optionally be set as a permanent unique ID of the compressed account.
- All compressed accounts are stored in sparse Merkle trees. Only the trees’ sparse state structure and roots (small fingerprints of all compressed accounts) are stored in the on-chain account space.



A small binary Merkle tree with depth 2.

Compressed Account Hash Structure
- Larger Transaction Size: The transaction payload must include the compressed state to be read on-chain and a constant-size 128-byte validity proof.
- High Compute Unit Usage: The protocol uses ZK primitives and on-chain hashing, which incur a relatively high base CU cost. If blocks are full, this can impact the inclusion rate of transactions. Future approaches to reducing CU cost can include optimizing the Merkle tree updates and hardware acceleration of cryptographic primitives and Syscalls used by the protocol.
- Per-transaction cost: operating a Forester node incurs additional hardware and transaction costs. The mechanism for efficiently nullifying multiple leaves in one Solana transaction can be improved significantly over time.
4 A World with Light Protocol
4.1 Light Helps Developers Scale Their Applications The set of applications and protocols that benefit from ZK Compression is quite broad, including:- Token-based applications and marketplaces, including applications for large-scale token distribution.
- Applications that issue large numbers of digital assets, PDA accounts, and unique identifiers, such as decentralized social applications, name-service programs, and staking protocols.
- Applications serving a user base with a low LTV/CAC ratio.
- Payments infrastructure and applications.
- Identity Protocols,
- ZK Coprocessors,
- Based ZK Rollups
5 Summary
- Light Protocol enables Solana developers to reduce their application state by orders of magnitude by introducing the ZK Compression primitive, which allows secure on-chain composability with off-chain state.
- ZK Compression can contribute to solving Solana’s state growth problem.
- Light seeks to enable a future with a thriving ZK ecosystem on Solana where new applications, marketplaces and computation designs can all interoperate, compose, and innovate permissionlessly over shared zk-compressed state.