Skip to content

opaquecash/scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opaque-scanner

CI

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.

What it does

  • Stealth address derivationP_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 scannerEthereumAdapter + SolanaAdapter + origin-deduped scan loop behind the native cargo feature (decoders are always compiled; JSON-RPC transports stay out of the WASM build).

Install

cargo add opaque-scanner

Rust usage

use 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.

WebAssembly

wasm-pack build --target web --release   # emits cryptography_bg.wasm + cryptography.js

The #[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.

Test vectors

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.

Links

License

Apache-2.0.

About

Rust DKSAP stealth-address scanner for Opaque — native + browser WASM, view-tag prefiltering, universal cross-chain scan. On crates.io as opaque-scanner.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages