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

@quantabit/zkp-identity-proof-sdk

v1.2.0

Published

QuantaBit ZKP Identity Proof SDK - Local Zero-Knowledge Proof generation for Verifiable Credential selective disclosure

Readme

@quantabit/zkp-identity-proof-sdk

QuantaBit 客户端 ZKP 身份证明 SDK:从 W3C Verifiable Credential 提取属性,并生成本地选择性披露证明(范围 / 成员 / 相等)。

状态说明

| Mode | 含义 | |------|------| | stub(默认) | 本地校验约束后生成占位 Groth16 结构 + SHA-256 commitment。适合联调 UI / API,不可用于生产隐私证明或链上验证。返回值含 isMock: true。 | | snarkjs | 注入 snarkjs + 电路工件(或 artifactBase)后走真实 groth16.fullProve;可选本地 verify。 |

验证侧请配合 @quantabit/zkp-verifier-sdk;提交 stub 证明前请确认服务端是否接受 mode: 'stub'

电路工件约定见 docs/CIRCUIT_ARTIFACTS.md

Features

  • VC 属性展平与域元素映射(字符串经 SHA-256 映射到 BN254 标量域)
  • Range / Membership / Equality 三种证明入口
  • loadCircuitArtifacts 按 URL 拉取并缓存 wasm / zkey / vkey
  • verifyGroth16 本地校验
  • 默认可离线运行;stub 模式不发起网络请求

Installation

npm install @quantabit/zkp-identity-proof-sdk
# snarkjs 模式(可选 peer)
npm install snarkjs

Quick Start

import { ZkpIdentityProofGenerator, extractCredentialSubject } from '@quantabit/zkp-identity-proof-sdk';

const myVC = {
  credentialSubject: {
    age: 25,
    nationality: 'CN'
  }
};

const generator = new ZkpIdentityProofGenerator(); // mode: stub
const ageProof = await generator.generateRangeProof(myVC, 'age', { min: 18, max: 120 });
console.log(ageProof.isMock); // true

切换到真实 snarkjs

import * as snarkjs from 'snarkjs';
import { ZkpIdentityProofGenerator } from '@quantabit/zkp-identity-proof-sdk';

// 方式 A:注入工件
const generator = new ZkpIdentityProofGenerator({
  mode: 'snarkjs',
  snarkjs,
  provingKeys: {
    range: { wasm: rangeWasm, zkey: rangeZkey, vkey: rangeVkey }
  }
});

// 方式 B:从 CDN / 静态目录自动加载
const remote = new ZkpIdentityProofGenerator({
  mode: 'snarkjs',
  snarkjs,
  artifactBase: 'https://cdn.example.com/zkp-circuits'
});

License

MIT