Skip to main content

Install

Peer dependencies you typically also need:

WASM module

Scanning, sweeping, trait discovery, key reconstruction, and Groth16 witness generation run in a Rust→WASM module (opaque-scanner). Pass the JS glue URL as wasmModuleSpecifier:
Build from the scanner crate:
Serve pkg/cryptography.js and pkg/cryptography_bg.wasm from your app’s public/ directory. The glue file loads the .wasm sibling automatically.
Do not hotlink https://www.opaque.cash/pkg/cryptography.js in production. Self-host the artifact so deploys are not blocked by CORS or third-party availability.

PSR admin without WASM

Schema and attestation management uses pure-JS DKSAP. You can omit wasmModuleSpecifier for issuer backends:
Calling scan, sweep, or generateReputationProof without WASM throws a clear error.

Signer matrix

Starknet writes don’t go through the generic facade. sendStealthPayment and registerMetaAddress accept only ethereum and solana. On Starknet, buildStarknetStealthSend, buildStarknetSweep, and SNIP-12 on-behalf registration (via @opaquecash/stealth-chain-starknet) return unsigned calls your app’s Starknet wallet broadcasts — sweeps go out through a starknet.js EthSigner (v10+) and the stealth account self-funds its deploy fee. PSR schema/attestation issuance stays on Ethereum and Solana; Starknet does proof verification and gating only. Addresses come from getStarknetDeployment("sepolia") (packages @opaquecash/stealth-chain-starknet and @opaquecash/psr-chain-starknet). Starknet is at testnet-preview maturity — see the Starknet flow.

Backend issuer (Ethereum)

Backend issuer (Solana)

Monorepo / workspace

Link the local package during development:
Build the SDK first: cd sdk && npm install && npm run build.

Runnable examples

sdk/examples/ ships one runnable script per flow: