| Crates.io | zecscope-scanner |
| lib.rs | zecscope-scanner |
| version | 0.1.0 |
| created_at | 2025-12-02 19:33:41.645917+00 |
| updated_at | 2025-12-02 19:33:41.645917+00 |
| description | High-level Zcash shielded transaction scanner for viewing keys. Scan compact blocks with UFVKs to discover Sapling and Orchard transactions. |
| homepage | https://github.com/N-45div/zecscope |
| repository | https://github.com/N-45div/zecscope |
| max_upload_size | |
| id | 1962476 |
| size | 76,048 |
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.
Add to your Cargo.toml:
[dependencies]
zecscope-scanner = "0.1"
| Feature | Default | Description |
|---|---|---|
sapling |
✅ | Enable Sapling pool scanning |
orchard |
✅ | Enable Orchard pool scanning |
wasm |
❌ | Enable WASM compatibility |
use zecscope_scanner::{Scanner, ScanRequest, CompactBlock};
// Create a scanner for mainnet
let scanner = Scanner::mainnet();
// Your viewing key (from a wallet like Zashi or Ywallet)
let viewing_key = "uview1...";
// Compact blocks from lightwalletd
let blocks: Vec<CompactBlock> = fetch_blocks_from_lightwalletd();
// Create scan request
let request = ScanRequest {
viewing_key: viewing_key.to_string(),
key_id: "my-wallet".to_string(),
compact_blocks: blocks,
};
// Scan!
let transactions = scanner.scan(&request)?;
for tx in &transactions {
println!(
"{} {} ZEC at height {} ({})",
if tx.direction == TxDirection::In { "Received" } else { "Sent" },
tx.amount_zec(),
tx.height,
tx.pool
);
}
use zecscope_scanner::Scanner;
let scanner = 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(request_json)?;
Enable the wasm feature:
[dependencies]
zecscope-scanner = { version = "0.1", features = ["wasm"] }
Then compile with wasm-pack:
wasm-pack build --target web
pub struct ZecTransaction {
pub txid: String, // Transaction ID (hex)
pub height: u64, // Block height
pub time: i64, // Unix timestamp
pub amount_zat: String, // Amount in zatoshis
pub direction: TxDirection, // In or Out
pub memo: Option<String>, // Decoded memo (if available)
pub key_id: String, // Which key found this tx
pub pool: ShieldedPool, // Sapling or Orchard
}
Matches the lightwalletd compact block format. See types.rs for full definitions.
This crate wraps the official zcash_client_backend::scanning::scan_block function with a simpler, more ergonomic API:
| Zcash Crate | Version |
|---|---|
zcash_client_backend |
0.21.0 |
zcash_primitives |
0.26.0 |
zcash_protocol |
0.7 |
zcash_keys |
0.12.0 |
MIT License — see LICENSE for details.
Contributions welcome! Please open an issue or PR.
Built with ❤️ for the Zcash ecosystem.