A high-performance service for scanning Zcash blocks and decrypting shielded transactions using Unified Full Viewing Keys (UFVKs). Built with Node.js and Rust for optimal performance and reliability.
- Privacy-Focused: UFVKs processed in memory, never stored
- High Performance: Rust-powered cryptographic operations with
librustzcash - NU6.1 Support: Compatible with the latest Zcash network upgrade
- Automatic Failover: Multi-provider support with seamless fallback
- Smart Caching: SQLite/PostgreSQL/MySQL support to minimize API calls
- Rate Limit Protection: Automatic retry with exponential backoff
- Production Ready: Comprehensive error handling and logging
# 1. Clone the repository
git clone git@github.com:Len3hq/zcashblockdecryption.git
cd zcashblockdecryption
# 2. Build the Rust decryptor
cd zcash_tx_decryptor
cargo build --release
cd ..
# 3. Install Node.js dependencies
cd block_scanner_api
npm install
# 4. Configure environment
cp .env.example .env
nano .env # Add your API keys
# 5. Start the server
npm run devThe API will be available at http://localhost:3005
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Request β
β POST /scan + blockHeights + UFVK β
βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Node.js API Server β
β β’ Request validation β
β β’ Multi-provider client (with failover) β
β β’ Cache management (SQLite/PostgreSQL/MySQL) β
βββββββββββββββββ¬ββββββββββββββββββββββββ¬ββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββ ββββββββββββββββββββββββ
β Primary RPC β β Fallback RPC β
β GetBlock.io β β (Multiple sources) β
βββββββββββββββββββββ ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββ
β Raw Transaction Data β
βββββββββββ¬ββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββ
β Rust Decryptor Binary β
β β’ librustzcash integration β
β β’ NU6.1 compatibility layer β
β β’ Sapling/Orchard decryption β
βββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββ
β Decrypted Transaction Data β
β (Amount, Memo, Protocol, etc.)β
βββββββββββββββββββββββββββββββββββ
cd zcash_tx_decryptor
cargo build --releaseThe binary will be created at: zcash_tx_decryptor/target/release/zcash-tx-decryptor
cd block_scanner_api
npm installcp .env.example .envEdit .env and set your configuration:
# Primary endpoint (required)
GETBLOCK_ENDPOINT=https://go.getblock.io/YOUR_API_KEY
# Fallback endpoints (optional, comma-separated)
FALLBACK_ENDPOINTS=https://go.getblock.io/KEY2,http://localhost:8232
# Server configuration
PORT=3005
DECRYPTOR_PATH=../zcash_tx_decryptor/target/release/zcash-tx-decryptor
# Database (SQLite by default)
DB_TYPE=sqlite
DB_PATH=./cache/blocks.dbSee FALLBACK_SETUP.md for detailed configuration options.
Protect against rate limits and downtime by configuring multiple RPC endpoints:
# Multiple GetBlock.io accounts
FALLBACK_ENDPOINTS=https://go.getblock.io/account2,https://go.getblock.io/account3
# Mix of providers
FALLBACK_ENDPOINTS=https://quicknode.endpoint/token,http://localhost:8232
# Self-hosted node
FALLBACK_ENDPOINTS=http://rpcuser:rpcpass@localhost:8232See FALLBACK_SETUP.md for:
- Available RPC providers
- Self-hosted node setup
- Cost optimization strategies
- Testing and monitoring
Development mode (with auto-reload):
npm run devProduction mode:
npm startcurl http://localhost:3005/healthResponse:
{
"status": "healthy",
"timestamp": "2025-11-26T12:00:00.000Z",
"uptime": 123.45
}curl -X POST http://localhost:3005/scan \
-H "Content-Type: application/json" \
-d '{
"blockHeights": [3148327, 3148328],
"ufvk": "uview1..."
}'Response:
{
"success": true,
"blocksScanned": 2,
"transactionsFound": 1,
"transactions": [
{
"transaction_id": "abc123...",
"amount_zec": 10.5,
"incoming_zec": 10.5,
"block_height": 3148327,
"outputs": [
{
"protocol": "Sapling",
"amount_zats": 1050000000,
"transfer_type": "Incoming",
"memo": "Payment for services"
}
]
}
]
}Scan specific blocks for transactions belonging to a UFVK.
Request Body:
{
blockHeights: number[]; // Array of block heights (max 100)
ufvk: string; // Unified Full Viewing Key
}Validation:
blockHeights: Must be an array of positive integers, max 100 blocksufvk: Must start withuview1(mainnet) oruviewtest1(testnet)
Response:
{
success: boolean;
blocksScanned: number;
transactionsFound: number;
transactions: TransactionDetails[];
error?: string; // Only present if success is false
}- Follow existing code style
- Add tests for new features
- Update documentation
- Never commit sensitive data (use
.env.example)
This project is open source. See the LICENSE file for details.
- Zcash for the amazing privacy technology
- librustzcash for cryptographic primitives
- GetBlock.io for reliable blockchain RPC access
Built with β€οΈ for the Zcash community