Purpose: This document provides a high-level introduction to Light Protocol, its architecture, and the organization of this codebase. It explains what ZK Compression is, how the system components work together, and where to find detailed information about each subsystem.
Scope: This page covers the entire Light Protocol system at a conceptual level. For detailed information about specific components, see:
Light Protocol is a ZK Compression layer for Solana that enables developers to compress on-chain state using zero-knowledge proofs and Merkle trees. The protocol allows creation of compressed accounts and tokens that are nearly rent-free while maintaining Solana's performance, security, and composability guarantees.
Traditional Solana accounts require rent payments proportional to the data size they store. Light Protocol compresses this state into Merkle tree leaves, storing only a small Merkle root on-chain. The full account data is reconstructed when needed using proofs verified by zero-knowledge cryptography.
Key Benefits:
Production Deployment: All core programs are deployed on Solana mainnet:
Lighton6oQpVkeewmo2mcPTQQp7kYHr4fWpAgJyEmDXcompr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVqSySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3mSources: README.md1-15 README.md47-63
Light Protocol is a distributed system with four primary layers working together:
Layer Responsibilities:
| Layer | Components | Primary Function |
|---|---|---|
| Application | Developer code | Business logic, user interactions |
| SDK | light-sdk, light-client, stateless.js, compressed-token | Abstract protocol complexity, provide high-level APIs |
| Off-Chain Services | light-prover, photon, forester | Proof generation, state indexing, tree maintenance |
| On-Chain | Four Solana programs | State compression, proof verification, token operations |
| Cryptographic | Merkle trees, hashers, verifier | Core compression primitives |
Sources: Cargo.toml1-81 README.md1-15
A compressed account is an account whose data is stored as a leaf in an on-chain Merkle tree rather than as a traditional Solana account. The on-chain storage contains only:
The actual account data is reconstructed using:
This compression reduces storage costs by 1000x or more for many use cases.
Modifying compressed state follows this pattern:
Key Steps:
Sources: sdk-libs/client/Cargo.toml1-81 README.md1-206
Light Protocol consists of four core Solana programs:
| Program | Program ID | Purpose |
|---|---|---|
| Light Registry | Lighton6oQpVkeewmo2mcPTQQp7kYHr4fWpAgJyEmDX | Protocol governance, forester registration, program configuration |
| Account Compression | compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq | Merkle tree operations, nullifier management, address trees |
| Light System Program | SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7 | ZK proof verification, compressed account lifecycle (Create/Read/Update) |
| Compressed Token | cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m | SPL token compression, transfer/mint/burn operations, Token-2022 support |
All programs share common cryptographic libraries:
program-libs/light-hasher) supporting Poseidon, Keccak, SHA256light-verifier)For detailed program architecture, see On-Chain Programs.
Sources: Cargo.toml225-243 README.md47-63
Maintained by: Helius Labs
Repository: https://github.com/helius-labs/photon
Purpose: Indexes all compressed state by parsing Solana transactions
The indexer provides:
Client integration via photon-api crate which provides type-safe bindings.
Language: Go
Location: prover/ directory
Purpose: ZK proof generation as a service
The prover service:
Language: Rust
Location: forester/ directory
Purpose: Automated tree maintenance and rollover
The forester:
For detailed service architecture, see Off-Chain Infrastructure.
Sources: README.md17 prover/client/Cargo.toml1-44 Cargo.toml78-79
Light Protocol provides SDKs in two languages:
Primary Crates:
light-client: RPC client with retry logic and connection poolinglight-sdk: High-level API for compressed accounts and transactionslight-token: Token-specific operationslight-program-test: Fast local testing using litesvmUsage Pattern (Anchor programs):
Primary Packages:
@lightprotocol/stateless.js: Core compression functionality@lightprotocol/compressed-token: Token operations client@lightprotocol/zk-compression-cli: Development CLIInstallation:
Both SDKs handle:
For detailed SDK usage, see Client Libraries and SDKs.
Sources: sdk-libs/client/Cargo.toml1-81 sdk-libs/sdk/Cargo.toml1-87 pnpm-lock.yaml1-50
Light Protocol uses a self-contained development environment:
The devenv.sh script sets up:
Alternative: Development Containers are fully supported via .devcontainer/ configuration.
Key Testing Features:
light-program-test provides fast local validation without a full test validatorlitesvm for rapid program testingprogram-tests/utilsFor testing details, see Testing Framework.
Sources: README.md76-205 sdk-libs/program-test/Cargo.toml1-72
The repository is organized as a Cargo workspace with multiple sub-workspaces:
The root Cargo.toml defines 81 workspace members organized by function:
| Category | Members | Description |
|---|---|---|
| program-libs | 19 crates | Shared libraries used by on-chain programs (Merkle trees, hashers, verifier, etc.) |
| programs | 4 crates | Core Solana programs (account-compression, system, compressed-token, registry) |
| sdk-libs | 13 crates | Client libraries for interacting with Light Protocol |
| program-tests | 13 crates | Test suites for on-chain programs |
| sdk-tests | 18 crates | Integration tests for SDK functionality |
| anchor-programs | 1 crate | Anchor framework integration |
| forester | 2 crates | Tree maintenance service and utilities |
| other | 11 crates | Sparse Merkle tree, xtask, misc utilities |
TypeScript Workspace: The pnpm-workspace.yaml (not shown in files) organizes TypeScript packages:
js/stateless.js: Core compression SDKjs/compressed-token: Token client librarycli/: CLI toolsdk-tests/: TypeScript integration testsFor detailed workspace structure, see Repository Structure.
Sources: Cargo.toml1-296 pnpm-lock.yaml1-50
The repository uses Cargo's workspace resolver v2 with shared dependencies defined in [workspace.dependencies]:
Key Shared Dependencies:
Profile Configuration:
dev: Optimized for fast compilation (opt-level = 0)release: Overflow checks enabled for safetyGitHub Actions workflows in .github/workflows/:
rust.yml: Rust compilation and testingjs-tests-v*.yml: JavaScript/TypeScript testinglight-system-programs-tests.yml: On-chain program validationprover-test.yml: Prover service testingverifiable-build.yml: Reproducible builds using solana-verifyVerifiable Builds: All programs are built deterministically using Docker:
For detailed build and CI/CD information, see Build System and CI/CD.
Sources: Cargo.toml83-296 README.md32-44
Light Protocol has undergone multiple professional security audits:
| Auditor | Focus | Report |
|---|---|---|
| OtterSec | Programs audit #1 | audits/ottersec_v1_audit.pdf |
| Neodyme | Programs audit #2 | audits/neodyme_v1_audit.pdf |
| Zellic | Programs audit #3 | audits/zellic_v1_audit.pdf |
| Reilabs | Circuits formal verification | audits/reilabs_circuits_formal_verification_report.pdf |
Bug Bounty Program: Active program on Immunefi for vulnerability disclosure.
Note: SDK libraries (light-sdk, light-client) and tooling are in active development and not yet audited.
For security details, see Access Control and Security.
Sources: README.md65-74 SECURITY.md1-14
For developers getting started with Light Protocol:
For questions and support:
Sources: README.md15-206
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.