Crate zecscope_scanner

Crate zecscope_scanner 

Source
Expand description

§zecscope-scanner

High-level Zcash shielded transaction scanner for viewing keys.

This crate provides a simple API to scan Zcash compact blocks using Unified Full Viewing Keys (UFVKs) and discover incoming shielded transactions in both the Sapling and Orchard pools.

§Features

  • Simple API: Just provide a UFVK and compact blocks, get transactions
  • Sapling + Orchard: Scans both shielded pools (Orchard requires orchard feature)
  • WASM-compatible: Use in browsers via WebAssembly (enable wasm feature)
  • Serde support: All types serialize/deserialize for easy JSON interop

§Example

use zecscope_scanner::{Scanner, ScanRequest, Network};

// Create a scanner for mainnet
let scanner = Scanner::new(Network::Mainnet);

// Scan blocks with a viewing key
let request = ScanRequest {
    viewing_key: "uview1...".to_string(),
    key_id: "my-wallet".to_string(),
    compact_blocks: blocks, // Vec<CompactBlock>
};

let transactions = scanner.scan(&request)?;

for tx in transactions {
    println!("{}: {} ZEC ({})", tx.txid, tx.amount_zec(), tx.pool);
}

Structs§

ChainMetadata
Chain metadata from compact blocks.
CompactBlock
A compact block from lightwalletd.
CompactOrchardAction
A compact Orchard action.
CompactSaplingOutput
A compact Sapling output.
CompactSaplingSpend
A compact Sapling spend.
CompactTx
A compact transaction.
ScanRequest
Request to scan compact blocks with a viewing key.
ScanSummary
Result of scanning a range of blocks.
Scanner
High-level scanner for Zcash shielded transactions.
ZecTransaction
A discovered shielded transaction.

Enums§

Network
The enumeration of known Zcash networks.
ScanError
Errors that can occur during scanning.
ShieldedPool
Which shielded pool a transaction belongs to.
TxDirection
Direction of a transaction relative to the viewing key.

Type Aliases§

ScanResult
Result type alias for scanner operations.