Skip to content

Repository files navigation

SunspotJS

Produce gnark proofs for Noir circuits on browser.

What's in the repo

Path Contents
src/ sunspot_wasm Rust crate — witness solving, Groth16 prover, BN254/Grumpkin glue, wasm-bindgen adapters.
js/ @reilabs/sunspot_js npm package
bench/ In-browser benchmark harness
tests/ Integration tests

Architecture

  • src/parsing/ — decoders for the gnark *.ccs constraint system and *.pk proving key wire formats, plus the Noir ACIR + witness-stack pair.
  • src/solver/ — witness solver. Computes the full gnark witness vector (public + private + internal) from the Noir witness, including BSB22 commitment hints.
  • src/prover/ — Groth16 prover for solved witnesses.

The lazy reduction and SIMD arithmetic is pluggable behind the local-curve Cargo feature: enable it to use the SIMD-optimised backend (the default); disable it to fall back on arkworks backend. The npm package ships both as simd-* / sisd-* builds — see js/README.md for the usage details.

Using it from JavaScript API

Install the published npm package:

npm install @reilabs/sunspot_js
# or
yarn add @reilabs/sunspot_js

See js/README.md for the full TypeScript API.

Building from source

Prerequisites:

Build everything (all four wasm variants + TypeScript):

cd js
yarn install
yarn build

Or just the Rust side:

cargo build --release                       # native rlib
# OR
CARGO_UNSTABLE_BUILD_STD=panic_abort,std \
  wasm-pack build --release --target web    # threaded wasm

License

Apache-2.0. See LICENSE.

About

Create solana proofs on browser using Sunspot toolchain

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages