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

credport

v0.1.2

Published

Reusable zero-knowledge identity credentials on Midnight. Verify name and age once, then prove them to any app, which learns only a verified result and never the underlying data.

Readme

credport

Reusable zero-knowledge identity credentials on Midnight.

A user verifies their real-world identity once with a trusted issuer, then holds the credential in private state on their own device. From then on they can prove facts about it to any app, and the app receives only a single result, verified, for an opaque session id. The name, the birthdate, and the document are never disclosed to the app or written to the chain.

npm license

npm install credport

What you can prove

  • proveIdentity : the holder's name matches a claimed name AND their age is at least a threshold, in one proof.
  • proveAgeOver : age is at least a threshold, at any value you choose.
  • proveUniqueHuman : one credentialed human, with a per-app scoped nullifier that is unlinkable across apps.

Every proof discloses only the boolean result. The underlying values stay on the holder's device.

For a verifying app

A verifier needs no wallet, no proof server, and no access to user data. It needs only an indexer connection and the contract address. It mints a session id, hands it to the user to prove against, then reads back the result.

import { Verifier } from 'credport';
import { setNetworkId } from '@midnight-ntwrk/midnight-js-network-id';

setNetworkId('preprod');

const CONTRACT = '1904b5a37fdcc8eeb62a479e9924de30b51d0e227bc43b045b21806254f994ba';
const verifier = Verifier.connect(CONTRACT);

// 1. Issue a session id and hand it to the user's wallet flow.
const sessionId = verifier.newSessionId();

// 2. The user proves on their own device (see "For a proving app").

// 3. Read the result. You learn only whether it holds.
const { verified, threshold } = await verifier.verifyIdentity(sessionId, 18);
if (verified) grantAccess();

verifyAgeOver(sessionId, minThreshold) and verifyUniqueHuman(sessionId) work the same way.

For a proving app

The holder side needs a connected Midnight wallet (Lace or 1AM) with its providers. PassportAPI wraps deploy, join, and the role facades.

import { PassportAPI, Issuer, Holder } from 'credport';

// providers: Midnight.js providers built around the connected wallet
const api = await PassportAPI.join(providers, CONTRACT);

// enroll once; the secret key never leaves the device
const holder = new Holder(api);
const enrollment = await holder.enroll();

// the issuer attests after an off-chain check, writing only a commitment
const issuer = new Issuer(api);
const credential = await issuer.issueCredential(
  { name: 'Erika Mustermann', birthDate: '2000-05-14', country: 276 },
  enrollment,
);
await holder.store(credential);

// later, prove name and age together against a verifier's session id
await holder.proveIdentity('Erika Mustermann', 18, { sessionId });

Building the wallet providers is app specific. See the reference wiring in the repository (verifier-ui/src/midnight).

React

For a React app, credport-react gives you a drop-in gate:

import { ProveAgeGate } from 'credport-react';

<ProveAgeGate contractAddress={CONTRACT} connect={connectWallet} threshold={18}>
  <MembersOnly />
</ProveAgeGate>;

Why it must be on Midnight

Privacy is load bearing, not decorative. Midnight keeps attributes on the holder's device as first-class protocol citizens (witnesses), and the Compact language forces every value that reaches the ledger to be disclosed explicitly, so nothing leaks by accident. Membership is proven against a Merkle root, so a proof never reveals which credential it used, and it cannot be linked back to issuance.

Try it live

A full working demo runs on Midnight preprod at credport.vercel.app. Connect a wallet, verify a document, issue a credential, and prove your name and age with a single verified result. It runs against the single canonical deployment, contract 1904b5a37fdcc8eeb62a479e9924de30b51d0e227bc43b045b21806254f994ba. See the repository for the end-to-end guide.

Apache-2.0.