zecscope-scanner
High-level Zcash shielded transaction scanner for viewing keys.
Scan Zcash compact blocks with Unified Full Viewing Keys (UFVKs) to discover incoming shielded transactions in both the Sapling and Orchard pools.
Features
- 🔑 Simple API — Just provide a UFVK and compact blocks, get transactions
- 🌿 Sapling support — Scan Sapling shielded pool transactions
- 🌸 Orchard support — Scan Orchard shielded pool transactions (NU5+)
- 🌐 WASM-compatible — Use in browsers via WebAssembly
- 📦 Serde support — All types serialize/deserialize for easy JSON interop
- 🔒 Privacy-first — Your viewing key stays local, only compact blocks needed
Installation
Add to your Cargo.toml:
[]
= "0.1"
Feature Flags
| Feature | Default | Description |
|---|---|---|
sapling |
✅ | Enable Sapling pool scanning |
orchard |
✅ | Enable Orchard pool scanning |
wasm |
❌ | Enable WASM compatibility |
Usage
Basic Example
use ;
// Create a scanner for mainnet
let scanner = mainnet;
// Your viewing key (from a wallet like Zashi or Ywallet)
let viewing_key = "uview1...";
// Compact blocks from lightwalletd
let blocks: = fetch_blocks_from_lightwalletd;
// Create scan request
let request = ScanRequest ;
// Scan!
let transactions = scanner.scan?;
for tx in &transactions
JSON API (for WASM/FFI)
use Scanner;
let scanner = mainnet;
// JSON request
let request_json = r#"{
"viewing_key": "uview1...",
"key_id": "my-wallet",
"compact_blocks": [...]
}"#;
// Returns JSON array of transactions
let result_json = scanner.scan_json?;
WASM Usage
Enable the wasm feature:
[]
= { = "0.1", = ["wasm"] }
Then compile with wasm-pack:
Types
ZecTransaction
CompactBlock
Matches the lightwalletd compact block format. See types.rs for full definitions.
How It Works
This crate wraps the official zcash_client_backend::scanning::scan_block function with a simpler, more ergonomic API:
- Decode UFVK — Parse the Unified Full Viewing Key
- Convert blocks — Transform JSON/serde blocks to protobuf format
- Scan — Use official Zcash scanning logic to find transactions
- Return — Provide clean transaction records with pool info
Privacy Guarantees
- Your viewing key is only used locally for decryption
- Compact blocks contain only commitments, not full transaction data
- No network requests are made by this crate
Compatibility
| Zcash Crate | Version |
|---|---|
zcash_client_backend |
0.21.0 |
zcash_primitives |
0.26.0 |
zcash_protocol |
0.7 |
zcash_keys |
0.12.0 |
License
MIT License — see LICENSE for details.
Contributing
Contributions welcome! Please open an issue or PR.
Built with ❤️ for the Zcash ecosystem.