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

@helios-lang/groth16

v0.1.0

Published

Standalone proof engine for Helios circuit artifacts

Readme

groth16

Standalone Groth16 proof engine for Helios circuit artifacts.

The package is standalone and does not import other @helios-lang/* packages. It exposes the same TypeScript API through native Node and browser WASM entrypoints:

  • @helios-lang/groth16/node
  • @helios-lang/groth16/web

The root entrypoint, @helios-lang/groth16, selects the Node implementation when it is running in Node and otherwise selects the browser WASM implementation.

Usage

Create a proof engine, run setup for a compiler-produced prover artifact, prove with named public and private inputs, then verify with the public inputs and the proof bytes:

import { createProofEngine } from "@helios-lang/groth16/node"

const engine = await createProofEngine()

const setup = await engine.setup(proverArtifact)

const proof = await engine.prove(setup.prover, {
  public: { n: 15n },
  private: { p: 3n, q: 5n }
})

const ok = await engine.verify(setup.prover, { n: 15n }, proof)

setup validates the artifact and returns a prover artifact that includes the material needed by prove and verify, plus the verification key separately. prove validates that every declared public and private input is present, that no unknown input names were supplied, and returns a Uint8Array proof. verify performs the same public input validation and returns a boolean.

Prover Artifact Format

The proof engine consumes a ProverArtifact object. Binary fields are Uint8Array values in TypeScript. When the artifact crosses the native/WASM binding boundary, these fields are encoded as base64 strings internally.

type ProverArtifact = {
  name: string
  format: "helios-groth16-bls12-381-v1"
  circuitId: string
  constraints: Uint8Array
  schema: {
    privateInputs: { name: string; type: string }[]
    publicInputs: { name: string; type: string }[]
    fieldModulus: string
    proof: { type: "ByteArray" }
  }
  provingKey?: {
    encoding: "arkworks-groth16-pk-v1"
    bytes?: Uint8Array
    hash: string
  }
  verificationKey?: {
    alphaG1: string | Uint8Array
    betaG2: string | Uint8Array
    gammaG2: string | Uint8Array
    deltaG2: string | Uint8Array
    publicInputsG1: readonly (string | Uint8Array)[]
  }
  proof: {
    encoding: "groth16-bls12-381-compact-v1"
    length: 192
    layout: "A:g1-compressed:48|B:g2-compressed:96|C:g1-compressed:48"
  }
}

Important fields:

  • format identifies the Helios Groth16 BLS12-381 artifact contract.
  • circuitId is the stable identifier for the circuit the artifact belongs to.
  • constraints contains the compiler-produced constraint payload.
  • schema.publicInputs and schema.privateInputs define the required witness object keys. Input values may be bigint, number, or decimal strings.
  • schema.fieldModulus records the field modulus used by the circuit.
  • provingKey is optional before setup. After setup, the returned prover artifact is expected to contain proving material for prove.
  • verificationKey is optional before setup. It is returned by setup and may also be embedded in the returned prover artifact.
  • proof declares the proof byte encoding. The current compact proof is 192 bytes: compressed A in G1, compressed B in G2, and compressed C in G1.

Witness objects are keyed by the names declared in the artifact schema:

type CircuitWitness = {
  public: Record<string, bigint | number | string>
  private: Record<string, bigint | number | string>
}

For the example above, the artifact must declare one public input named n and two private inputs named p and q.

Build

Build commands:

  • pnpm run build:ts
  • pnpm run build:native
  • pnpm run build:wasm requires wasm-pack

Current Constraint Support

Current compiler-v2 artifacts contain metadata-only constraints. The engine therefore rejects setup/prove calls with a clear unsupported-constraint error until compiler artifacts include a concrete constraint system.