Skip to content

Lightprotocol/examples-zk-compression

Repository files navigation

Examples-zk-compression

Client Examples

Node.js Client

  • Commonjs script that executes basic compression/decompression/transfer instructions.

Web Client

Token Distribution


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

Basic Operations

  • create-nullifier - Basic Anchor example to create nullifiers for payments.
  • 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

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

Compare Program with Solana vs Compressed Accounts

zk-id Program

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

About

For Token Distribution, rent-free PDAs and ZK.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published