Stealth-address (DKSAP) scanner for Opaque Cash — the shared, chain-neutral cryptography core used by the Ethereum and Solana clients. Compiles to native Rust and WebAssembly, so the same code scans in a browser with no server.
It implements the EIP-5564 Dual-Key Stealth Address Protocol over secp256k1, plus the Opaque Programmable Stealth Reputation (PSR V2) attestation layer. See the protocol spec CSAP.md.
- Stealth address derivation —
P_stealth = P_spend + keccak256(ECDH(p_view, R))·G. - View-tag pre-filter — one byte lets a scanner skip ~99.6% of announcements before any elliptic-curve work.
- One-time key recovery — reconstructs the spendable private key for a matched stealth address.
- PSR attestations — V2 schema-bound, issuer-verified traits
(
scan_for_attestations_v2). ZK witness building is the TypeScript SDK's job (@opaquecash/psr-prover), not this crate's. - Universal cross-chain scanner —
EthereumAdapter+SolanaAdapter+ origin-deduped scan loop behind thenativecargo feature (decoders are always compiled; JSON-RPC transports stay out of the WASM build).
cargo add opaque-scanneruse opaque_scanner::scanner::{derive_stealth_address, check_announcement};
// derive_stealth_address(&view_privkey, &spend_pubkey, &ephemeral_pubkey)
// -> (stealth_address, view_tag)The crate also re-exports the shared core under opaque_scanner::dksap and defines
dksap::ChainAdapter / dksap::Announcement for multi-chain scan loops.
wasm-pack build --target web --release # emits cryptography_bg.wasm + cryptography.jsThe #[wasm_bindgen] exports (derive_stealth_address_wasm, check_announcement_wasm,
scan_for_attestations, scan_for_attestations_v2, …) are what the Opaque web clients
load directly in the browser.
DKSAP outputs are cross-validated byte-for-byte against an independent Python reference
and the @noble TypeScript path; the pinned vectors live in
opaquecash/circuits (test/test_vectors.json)
and are asserted by scanner::tests::matches_csap_test_vectors.
- Spec: https://github.com/opaquecash/spec
- Source: https://github.com/opaquecash/scanner
- App: https://opaque.cash
Apache-2.0.