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

# Program Examples

> Program example repository for compressed accounts with tests.

## Airdrop claim reference implementations

* **Basic**: [**simple-claim**](https://github.com/Lightprotocol/program-examples/tree/main/airdrop-implementations/simple-claim) - Distributes compressed tokens that get decompressed to SPL on claim with cliff.
* **Advanced**: [**merkle-distributor**](https://github.com/Lightprotocol/program-examples/tree/main/airdrop-implementations/distributor) - Distributes SPL tokens, uses compressed PDAs to track claims with linear vesting, partial claims and clawback. Based on Jito Merkle distributor and optimized with rent-free PDAs.

<Info>
  For simple client-side distribution visit [this example](https://github.com/Lightprotocol/example-token-distribution).
</Info>

## Basic operations

* **create** - Initialize a new compressed account
  * [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/create) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/create)
* **update** - Modify data in an existing compressed account
  * [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/update) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/update)
* **close** - Clear account data and preserve its address
  * [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/close) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/close)
* **reinit** - Reinitialize a closed account with the same address
  * [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/reinit) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/reinit)
* **burn** - Permanently delete a compressed account
  * [Anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor/burn) | [Native](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native/programs/burn)

## Nullifier program

[**nullifier-program**](https://github.com/Lightprotocol/nullifier-program) - For some use cases, such as sending payments, you might want to prevent your onchain instruction from being executed more than once. Creates a rent-free PDA derived from an id. If the id has been used before, the PDA already exists, causing the instruction to fail.

SDK: [`light-nullifier-program`](https://docs.rs/light-nullifier-program) | [Example client usage](https://github.com/Lightprotocol/examples-light-token/blob/main/rust-client/actions/create_nullifier.rs)

## Counter program

Full compressed account lifecycle (create, increment, decrement, reset, close):

* [**counter/anchor**](https://github.com/Lightprotocol/program-examples/tree/main/counter/anchor) - Anchor program with Rust and TypeScript tests
* [**counter/native**](https://github.com/Lightprotocol/program-examples/tree/main/counter/native) - Native Solana program with `light-sdk` and Rust tests
* [**counter/pinocchio**](https://github.com/Lightprotocol/program-examples/tree/main/counter/pinocchio) - Pinocchio program with `light-sdk-pinocchio` and Rust tests

## Create-and-update program

[**create-and-update**](https://github.com/Lightprotocol/program-examples/tree/main/create-and-update) - Create a new compressed account and update an existing compressed account with a single validity proof in one instruction.

## Create-and-read program

[**read-only**](https://github.com/Lightprotocol/program-examples/tree/main/read-only) - Create a new compressed account and read it onchain.

## Compare program with Solana vs compressed accounts

[**account-comparison**](https://github.com/Lightprotocol/program-examples/tree/main/account-comparison) - Compare compressed vs regular Solana accounts.

## ZK programs

* [**zk-id**](https://github.com/Lightprotocol/program-examples/tree/main/zk/zk-id) - Identity verification using Groth16 proofs. Issuers create credentials; users prove ownership without revealing the credential.
* [**nullifier**](https://github.com/Lightprotocol/program-examples/tree/main/zk/nullifier) - Simple program to create nullifiers for ZK programs.

## Next steps

<Card title="Follow our guides to these program examples" icon="chevron-right" color="#0066ff" href="/pda/compressed-pdas/guides" horizontal />
