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

halo2-anon-auth

v1.1.0

Published

Halo 2 Anonymous Authentication - Standalone ZK proof library for web integration

Downloads

215

Readme

Halo 2 Anonymous Authentication

npm version

Prove you are authorized without revealing who you are. ZK-powered anonymous auth for web apps.

Quick Start

import { Identity, Verifier } from 'halo2-anon-auth';

// CLIENT — create an identity and prove authorization
const identity = await Identity.create();
const proof = await identity.authorize('my-dao');
// Send proof.toJSON() to your server

// SERVER — verify the proof
const verifier = await Verifier.create(['my-dao']);
const result = await verifier.check(proof, 'my-dao');

console.log(result.authorized); // true — user is anonymous but authorized

That's it. No keypairs, no elliptic curves, no crypto. Just string IDs and opaque objects.

How It Works

  1. Identity.create() generates a secret key and creates an anonymous identity
  2. identity.authorize('my-dao') produces a zero-knowledge proof that the identity holds a valid authorization under that authority
  3. verifier.check(proof, 'my-dao') verifies the proof cryptographically
  4. The verifier learns only "this user is authorized" — nothing else

Under the hood this uses Halo 2 PLONK proofs, Poseidon hashes, and DarkFi's ZKVM. But you don't need to know that.

Client API

Create and manage identities

// Create a new anonymous identity
const identity = await Identity.create();

// Save to localStorage
localStorage.setItem('identity', identity.save());

// Restore later
const identity = Identity.load(localStorage.getItem('identity'));

Prove authorization

const proof = await identity.authorize('my-dao');
// → Authorization object (call proof.toJSON() to serialize)

// Send to server as JSON
await fetch('/api/auth', {
  body: JSON.stringify(proof.toJSON()),
});

Server API

Verify proofs

const verifier = await Verifier.create(['my-dao', 'admin-portal']);

// Add a new authority later
verifier.addAuthority('new-authority');

// Check a proof
const result = await verifier.check(proof, 'my-dao');
// → { authorized: true, level: 'basic' }
// → { authorized: false, reason: '...' }

// Revoke a proof (prevent reuse)
verifier.revoke(proof);

Restore proofs on the server

const json = JSON.parse(requestBody);
const proof = Authorization.fromJSON(json);
const result = await verifier.check(proof, 'my-dao');

Installation

npm install halo2-anon-auth

Building from Source

  • Node.js 18+
  • Rust (latest stable)
  • wasm-pack
git clone https://codeberg.org/PatrickM123/halo2-anon-auth.git
cd halo2-anon-auth
npm install
npm run build

Low-Level API

Need full crypto access? The low-level AnonAuth API is still available:

import { createAnonAuth, AnonAccount, AuthLevel } from 'halo2-anon-auth';

const auth = createAnonAuth();
await auth.init();
// ... full control over keys, witnesses, circuit, etc.

See TECHNICAL.md for the complete low-level API reference.

Security

This is a security-critical cryptography project. The proof guarantees knowledge soundness, nullifier correctness, and freshness via unique nonces. Review TECHNICAL.md for cryptographic design, threat model, and deployment checklist.

Browser Support

  • Chrome/Edge 90+
  • Firefox 90+
  • Safari 15+

License

GNU Affero General Public License v3.0