Zecscan
Zcash Encrypted Blockchain Explorer
The problem Zecscan solves
Zcash’s strongest feature, "the shielded pool" is also its biggest usability hurdle. Because transactions are encrypted, users cannot easily verify payments, audit their history, or prove funds to third parties using standard block explorers. The blockchain is opaque by design.
The Current Dilemma
To view shielded data today, users are forced to choose between two bad options:
- Run a Full Node: This is technically difficult, resource-intensive (requires downloading gigabytes of data), and inaccessible to 99% of users.
- Trust a Centralized Service: Some services allow you to view data, but they require you to upload your Viewing Keys to their servers. This fundamentally breaks the trust model of Zcash—you are doxxing your entire financial history to a third party.
The Gap
There is no lightweight, trustless way to interact with shielded Zcash data.
- Lightweight: Accessible in a browser, no downloads.
- Trustless: No one (including the service provider) sees your keys or data.
The ZecScan Solution
ZecScan solves this by moving the "node" logic into the browser. By compiling Zcash cryptography to WebAssembly, we allow users to:
- Bring their own Viewing Key.
- Decrypt transaction data locally on their own device.
- Audit their history without ever exposing their keys to a server.
ZecScan bridges the gap between the transparency of a block explorer and the privacy of a local wallet.
Challenges I ran into
WebAssembly Integration for Zcash Cryptography
The Problem
Implementing real-time client-side decryption of shielded Zcash transactions required integrating complex cryptographic operations in the browser. Unlike simple JavaScript libraries, Zcash's cryptography is implemented in Rust and needs to run at native speeds to handle the complex zero-knowledge proof verification.
Initial naive approach:
// ❌ Pure JavaScript - way too slow for ZK cryptography
function decryptZcashMemo(viewingKey, transaction) {
// Would take minutes instead of seconds!
return slowCryptoOperations();
}
The WebAssembly Journey
I needed to compile Zcash's Rust cryptographic libraries to WebAssembly for browser execution. Challenges included:
- Binary Size - Initial WASM build was 15MB+, way too large for web delivery
- Loading Performance - WASM module initialization added 2-3 seconds to page load
- Browser Compatibility - Different browsers handle WASM memory differently
- Debugging Complexity - Stack traces in WASM are cryptic and hard to debug
The Optimization Process
Size Reduction:
# Cargo.toml optimizations
[profile.release]
opt-level = "z" # Optimize for size
lto = true # Link-time optimization
codegen-units = 1 # Better optimization
strip = true # Remove debug symbols
This reduced the WASM binary from 15MB to ~3MB!
Lazy Loading Strategy:
// Don't load WASM until user actually needs decryption
useEffect(() => {
async function loadWasm() {
const script = document.createElement('script');
script.src = '/wasm/zcash_wasm.js';
script.type = 'module';
script.onload = () => setWasmLoaded(true);
document.body.appendChild(script);
}
loadWasm();
}, []);
Progress Indication:
Added a terminal animation to give users feedback during WASM initialization and decryption:
<TerminalOutput
isActive={showTerminal}
onComplete={handleTerminalComplete}
/>
This provides visual feedback while the heavy cryptographic operations happen in the background.
The Final Architecture
Client-Side Processing:
- Validate viewing key format (instant)
- Load WASM module if not cached (1-2s first time)
- Fetch transaction data from blockchain APIs (500ms)
- Perform cryptographic decryption in WASM (1-2s)
- Display decrypted memo and transaction details
// All sensitive operations happen in the browser
const handleDecryptSingle = async () => {
setLoading(true);
setShowTerminal(true);
// Validate viewing key locally
if (!validateViewingKey(viewingKey)) {
throw new Error('Invalid viewing key format');
}
// Fetch transaction data
const [txDetails, rawTx] = await Promise.all([
fetchZcashExplorerTransaction(txId),
fetchZcashExplorerRawTransaction(txId)
]);
// WASM handles the decryption
// Viewing key never sent to server
setTransactionDetails(txDetails);
};
Lessons learned:
- WebAssembly is powerful but requires careful optimization
- User experience matters - show progress during long operations
- Lazy loading is essential for large WASM modules
- Browser caching makes subsequent loads nearly instant
Mobile Responsiveness - SearchBar Wrapping Issues
The Problem
The search bar and example links looked great on desktop but completely broke on mobile devices.
Issues:
- Example links wrapped awkwardly
- Search button overlapped text
- Padding was too large for small screens
- Font sizes didn't scale
The Debugging Process
// Original problematic code
<div className="flex gap-2">
<button className="px-6 text-base">Example: Block #2500000</button>
<button className="px-6 text-base">Example: Transaction</button>
</div>
This worked fine on desktop but on mobile:
flexdidn't allow wrapping- Fixed padding (
px-6) took up too much space - Text size was too large
The Solution
Implemented responsive utility classes with Tailwind:
<div className="flex flex-wrap gap-2 sm:gap-3">
<button className="px-3 py-1.5 sm:px-6 sm:py-2 text-xs sm:text-base">
Example: Block #2500000
</button>
<button className="px-3 py-1.5 sm:px-6 sm:py-2 text-xs sm:text-base">
Example: Transaction
</button>
</div>
Changes made:
- Added
flex-wrapto allow multi-line layout on small screens - Used responsive sizing:
px-3 sm:px-6(smaller on mobile, larger on desktop) - Responsive text:
text-xs sm:text-base - Gap adjustment:
gap-2 sm:gap-3
Result: Perfect layout on all screen sizes!
Tracks Applied (6)
General Bounty
Network School
Zcash Data & Analytics
Gemini
Privacy Infrastructure & Developer Tools
Zcash Community Grants
Zcash Data & Analytics
Raybot
Privacy Infrastructure & Developer Tools
Raybot
General Bounty
Project Tachyon

