npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lightprotocol/nullifier-program

v0.1.3

Published

SDK to interact with the rent-free nullifier program on Solana

Downloads

463

Readme

Nullifier Program

Creates a rent-free PDA derived from id. If the id has been used before, the PDA already exists, causing the instruction to fail.

Prerequisites

  • Rust 1.79+
  • Solana CLI 2.2+
  • Anchor CLI 0.31.1
  • Node.js 18+

Build

anchor build
npm run build

Test (Rust)

cargo test-sbf -p light-nullifier-program

Test (TypeScript)

Requires local validator.

npm install -g @lightprotocol/[email protected]
light test-validator
npm test

SDK

Example Usage with Rust and Typescript

Both examples load your Solana keypair at ~/.config/solana/id.json.

Devnet(default):

Set up the .env file with a Helius API key (get one here):

cp .env.example .env
# edit .env and add your API_KEY

Localnet: For localnet, install the CLI, start the test-validator with the program, and swap the RPC comments in the example files:

npm install -g @lightprotocol/[email protected]
light test-validator --sbf-program NFLx5WGPrTHHvdRNsidcrNcLxRruMC92E4yv7zhZBoT target/deploy/light_nullifier_program.so

Rust

Find and run example here: rust/src/main.rs.

cd examples/rust && cargo run

TypeScript

Find and run example here: action-create-nullifier.ts.

npm install
npm run ts:create-nullifier

Rust SDK Guide

Works with LightClient (production) or LightProgramTest (testing).

use light_nullifier_program::sdk::{create_nullifier_ix, PROGRAM_ID};
use light_client::{LightClient, LightClientConfig};

let rpc_url = "https://devnet.helius-rpc.com/?api-key=...".to_string();
let config = LightClientConfig::new(rpc_url, None, None);
let mut rpc = LightClient::new(config).await?;
let ix = create_nullifier_ix(&mut rpc, payer.pubkey(), id).await?;

Or step-by-step:

use light_nullifier_program::sdk::{fetch_proof, build_instruction};

let proof_result = fetch_proof(&mut rpc, &id).await?;
let ix = build_instruction(payer.pubkey(), id, proof_result);

TypeScript SDK Guide

Works with any Rpc from @lightprotocol/stateless.js.

import {
  createNullifierIx,
  PROGRAM_ID,
} from "@lightprotocol/nullifier-program";
import { createRpc } from "@lightprotocol/stateless.js";

const rpc = createRpc("https://devnet.helius-rpc.com/?api-key=...");
const ix = await createNullifierIx(rpc, payer.publicKey, id);

Or step-by-step:

import { fetchProof, buildInstruction } from "@lightprotocol/nullifier-program";

const proofResult = await fetchProof(rpc, id);
const ix = buildInstruction(payer.publicKey, id, proofResult);

Check if nullifier exists:

import { deriveNullifierAddress } from "@lightprotocol/nullifier-program";
import { bn } from "@lightprotocol/stateless.js";

const address = deriveNullifierAddress(id);
const account = await rpc.getCompressedAccount(bn(address.toBytes()));
const exists = account !== null;

How it works

  1. Derive a compressed account address from ["nullifier", id] seeds. E.g. hash payment inputs.
  2. Creates the empty rentfree PDA account, "spending the nullifier"
  3. If the address already exists, the instruction fails
  4. prepend or append this instruction to your regular transaction (eg. payment)

Documentation

Find more documentation here: https://www.zkcompression.com/compressed-pdas/guides/how-to-create-nullifier-pdas.


The nullifier program code is unaudited, use at your own risk.