Skip to main content
This guide takes you from zero to a working integration: install the SDK, create an OpaqueClient from a connected wallet, register your meta-address, and run a stealth send.

Prerequisites

  • Node.js 20.17+
  • An Ethereum wallet (Sepolia testnet ETH for writes)
  • Optional: a Solana (devnet) or Starknet (Sepolia) wallet for multichain flows
  • For scan/sweep/prove: host or load the cryptography WASM module

1. Install

2. Create the client from a wallet

OpaqueClient.fromWallet does the whole session setup in one call: it prompts the wallet once for a signature over the canonical SETUP_MESSAGE, derives the viewing and spending keys from it (your private key is never touched), and wires the wallet as the chain’s transaction signer.
Solana wallets use the same shape with wallet-adapter fields:
The signature is HKDF entropy only and is never sent on-chain. Cache it (the walletSignature from requestSetupSignature) and pass it back to fromWallet to rebuild the client without prompting again. PSR schema/attestation admin does not require WASM; scanning, sweeping, and proof generation do.
If you prefer to manage the signature yourself, sign SETUP_MESSAGE manually and use OpaqueClient.create.

3. Share your meta-address

Register on-chain so others can resolve your normal address:

4. Send a stealth payment

sendStealthPayment resolves the recipient, derives a one-time stealth destination, transfers the native asset, and publishes the discovery announcement:
The recipient can be an EVM address, a meta-address, a Solana pubkey, an ipfs:// DID document, or a *.eth name with a com.opaque.meta record. To resolve without sending (for example to show a confirmation screen):
For full control (custom gas, batching, your own wallet UI), use the low-level pair:

5. Receive: scan and sweep

scan and getBalancesForOutputs span every chain the client is configured for. To include Starknet (Sepolia, testnet preview), pass starknet: {} to fromWallet, then scan with chains: ["ethereum", "solana", "starknet"]. Sending and sweeping on Starknet use the dedicated buildStarknetStealthSend and buildStarknetSweep builders — see Starknet.
Building a React app? @opaquecash/react packages the read side as hooks; see React hooks.

Runnable examples

The SDK repo ships a runnable example per flow in sdk/examples/: from-wallet, scan, send (including a delayed announcement), psr-prove, and uab-readonly.

Next steps

Issue an attestation

Full issuer flow: schema, attest, announce.

Generate a reputation proof

Discover traits and submit a Groth16 proof on-chain.

Cross-chain inbox

UAB announcements over Wormhole.

API reference

Every OpaqueClient method documented with examples.