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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@waku/zerokit-rln-wasm-parallel

v1.0.0

Published

[![npm version](https://badge.fury.io/js/@waku%2Fzerokit-rln-wasm.svg)](https://badge.fury.io/js/@waku%2Fzerokit-rln-wasm) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![License: Apache 2.0](ht

Readme

RLN for WASM

npm version License: MIT License: Apache 2.0

The Zerokit RLN WASM Module provides WebAssembly bindings for working with Rate-Limiting Nullifier RLN zkSNARK proofs and primitives. This module is used by waku-org/js-rln to enable RLN functionality in JavaScript/TypeScript applications.

Install Dependencies

[!NOTE] This project requires the following tools:

  • wasm-pack (v0.13.1) - for compiling Rust to WebAssembly
  • cargo-make - for running build commands
  • nvm - to install and manage Node.js (v22.14.0+)

Quick Install

make installdeps

Manual Installation

# Install wasm-pack
cargo install wasm-pack --version=0.13.1

# Install cargo-make
cargo install cargo-make

# Install Node.js via nvm
nvm install 22.14.0
nvm use 22.14.0
nvm alias default 22.14.0

Building the Library

Navigate to the rln-wasm directory:

cd rln-wasm

Build commands:

cargo make build          # Default → @waku/zerokit-rln-wasm
cargo make build_parallel # Parallel → @waku/zerokit-rln-wasm-parallel (requires nightly Rust)
cargo make build_utils    # Utils only → @waku/zerokit-rln-wasm-utils

All packages output to pkg/ directory.

Running Tests and Benchmarks

cargo make test           # Standard tests
cargo make test_browser   # Browser headless mode
cargo make test_utils     # Utils-only tests
cargo make test_parallel  # Parallel tests

Examples

See Node example and README for proof generation, verification, and slashing.

Parallel Computation

Enables multi-threaded browser execution using wasm-bindgen-rayon.

[!NOTE]

  • Parallel support is not enabled by default due to WebAssembly and browser limitations.
  • Requires nightly Rust: rustup install nightly
  • Browser-only (not compatible with Node.js)
  • Requires HTTP headers for SharedArrayBuffer:
    • Cross-Origin-Opener-Policy: same-origin
    • Cross-Origin-Embedder-Policy: require-corp

Usage

Direct usage (modern browsers with WebAssembly threads support):

import * as wasmPkg from '@waku/zerokit-rln-wasm-parallel';

await wasmPkg.default();
await wasmPkg.initThreadPool(navigator.hardwareConcurrency);
wasmPkg.nowCallAnyExportedFuncs();

Feature Detection for Older Browsers

If you're targeting older browser versions that didn't support WebAssembly threads yet, you'll want to use both builds - the parallel version for modern browsers and the default version as a fallback. Use feature detection to choose the appropriate build on the JavaScript side.

You can use the wasm-feature-detect library for this purpose:

import { threads } from 'wasm-feature-detect';

let wasmPkg;

if (await threads()) {
  wasmPkg = await import('@waku/zerokit-rln-wasm-parallel');
  await wasmPkg.default();
  await wasmPkg.initThreadPool(navigator.hardwareConcurrency);
} else {
  wasmPkg = await import('@waku/zerokit-rln-wasm');
  await wasmPkg.default();
}

wasmPkg.nowCallAnyExportedFuncs();