Skip to main content

Basic Operations

Basic Operations include:
  • create - Initialize a new compressed account
  • update - Modify data of an existing compressed account
  • close - Close a compressed account (it can be initialized again).
  • reinit - Reinitialize a closed account
  • burn - Permanently delete a compressed account (it cannot be initialized again).

Counter Program

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

Create-and-update Program

  • 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 - Create a new compressed account and read it on-chain.

Compare Programs with Solana and Compressed Accounts

Nullifier Program

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

Token Claim Reference Implementations

  • Basic: simple-claim - Distributes compressed tokens that get decompressed to SPL on claim.
  • Advanced: merkle-distributor - Distributes SPL tokens, uses compressed PDAs to track claims with linear vesting, partial claims, clawback and admin controls.
For simple client side distribution visit this example.

ZK-ID Program

  • zk-id - A minimal Solana program that uses zero-knowledge proofs for identity verification with compressed accounts.

Next Steps

Follow our guides to these program examples.