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

# Program Examples

> Program example repository for compressed accounts with tests.

<Check>
  <div style={{display: "flex", alignItems: "center", padding: 0, margin: 0}}>
    <a href="https://deepwiki.com/Lightprotocol/program-examples" 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>
</Check>

## Basic Operations

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

<Info>
  Basic Operations include:

  * **create** - Initialize a new compressed account.
  * **update** - Modify data in an existing compressed account.
  * **close** - Clear account data and preserve its address.
  * **reinit** - Reinitialize a closed account with the same address.
  * **burn** - Permanently delete a compressed account.
</Info>

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

## Compare compressed vs uncompressed Program

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

## ZK-ID Program

* [**zk-id**](https://github.com/Lightprotocol/program-examples/tree/main/zk-id) - A minimal Solana program that uses zero-knowledge proofs for identity verification with compressed accounts.

## Build your own Program

<Card horizontal icon="circle-plus" title="Create a Program with Compressed PDAs" href="/compressed-pdas/create-a-program-with-compressed-pdas" />
