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

quanta-wasm

v0.3.0

Published

WASM bindings for QuantaChain PQC wallet operations

Readme

quanta-wasm

npm crates.io License: Apache-2.0

WebAssembly bindings for QuantaChain post-quantum cryptography — compiled from Rust using wasm-pack.

Provides Falcon-512 key generation, signing, and verification directly in the browser or Node.js at near-native speed. No server round-trips for cryptographic operations.


When to Use This Package

| Use case | Package | |----------|---------| | Build wallets, explorers, or integrations | Use quanta-sdk (bundles this internally) | | Need raw Falcon-512 WASM operations | Use quanta-wasm directly |

Most developers should install quanta-sdk instead.


Installation

npm install quanta-wasm

Or with Cargo (Rust):

[dependencies]
quanta-wasm = "0.1"

Browser Usage

import init, {
  generate_keypair,
  sign_message,
  verify_signature,
  generate_mnemonic,
  keypair_from_mnemonic
} from 'quanta-wasm';

// Must call init() before any other function in browser environments
await init();

// Generate a Falcon-512 keypair
const keypair = generate_keypair();
console.log('Public key length:', keypair.public_key.length);   // 897 bytes
console.log('Address:', keypair.address);                        // "0x..."

// Sign a message
const message = new TextEncoder().encode("hello quanta");
const signature = sign_message(keypair.secret_key, message);

// Verify
const valid = verify_signature(keypair.public_key, message, signature);
console.log('Valid:', valid);   // true

Node.js Usage

In Node.js environments, initialization is automatic:

const { generate_keypair, generate_mnemonic } = require('quanta-wasm');

// No await needed in Node.js
const keypair = generate_keypair();
console.log('Address:', keypair.address);

const mnemonic = generate_mnemonic();
console.log('Mnemonic:', mnemonic);   // 24 BIP39 words

API Reference

generate_keypair() → Keypair

Generates a fresh Falcon-512 keypair.

const keypair = generate_keypair();
// keypair.public_key  — Uint8Array (897 bytes)
// keypair.secret_key  — Uint8Array (~1,281 bytes) — never share or send
// keypair.address     — string "0x" + hex(SHA3-256(pubkey)[0:20])

generate_mnemonic() → string

Generates a cryptographically secure 24-word BIP39 mnemonic.

const mnemonic = generate_mnemonic();
// "word1 word2 word3 ... word24"

keypair_from_mnemonic(mnemonic: string) → Keypair

Derives a deterministic Falcon-512 keypair from a 24-word BIP39 mnemonic.

const keypair = keypair_from_mnemonic("word1 word2 ... word24");
// Same mnemonic always produces the same keypair and address

sign_message(secret_key: Uint8Array, message: Uint8Array) → Uint8Array

Signs a message with a Falcon-512 secret key. Returns the signed-message blob (33–698 bytes).

const signature = sign_message(keypair.secret_key, messageBytes);

In the Quanta protocol, the message is always the canonical signing hash:

SHA3-256("QUANTA_TX_V1:" || signing_bytes)

The quanta-sdk handles this automatically — use TransactionBuilder.sign() instead of calling this directly for transactions.


verify_signature(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array) → boolean

Verifies a Falcon-512 signature.

const valid = verify_signature(pubkey, message, signature);

Returns false (does not throw) for any invalid input.


Cryptographic Details

  • Algorithm: Falcon-512 (NTRU lattice-based, NIST Level 1)
  • Public key: exactly 897 bytes (consensus-enforced in the Quanta protocol)
  • Secret key: ~1,281 bytes
  • Signature: variable 33–698 bytes
  • Security: 128-bit classical, 64-bit post-quantum (Grover's)
  • No known quantum attack: Falcon relies on NTRU lattice problems — not affected by Shor's algorithm

Build Flags

The Rust source is compiled with:

  • target-feature=+strict-float — enforces IEEE 754 compliance for consensus determinism across x86_64 and ARM64
  • opt-level = "z" — minimize WASM binary size
  • codegen-units = 1 — reproducible builds

Ecosystem

| Package | Description | |---------|-------------| | quanta-sdk | Full JS/TS SDK — wallets, transactions, node client | | quanta-wasm | This package — raw Falcon-512 WASM bindings | | Quanta Node | Rust node source — runs the blockchain |


License

Apache-2.0 — see LICENSE