Mining infrastructure for Zcash
Stratum V2 mining protocol with miner-controlled transaction selection, encrypted transport, compact block relay, and production observability.
Why Bedrock Exists
51% Risk
ViaBTC hit 53.69% of Zcash hashrate in September 2023. Four pools control ~84% of all hashrate. Bloomberg covered it as systemic risk.
Transaction Censorship
F2Pool censored shielded transactions since April 2017, mining only 120 of ~86,849 expected. 30% of ZEC is now in shielded addresses.
Aging Protocol
Stratum V1 from 2016: unencrypted plaintext, no miner agency over transaction selection. No P2Pool, no Stratum V2 for Zcash until Bedrock.
The Solution
Reduces Centralization Pressure
Mining centralizes around large pools because they have direct peering with other pools and exchanges, propagating blocks hundreds of milliseconds faster. Smaller pools see more orphaned blocks and less predictable revenue, pushing miners toward the incumbents.
FORGE relays compact blocks -- only 6-byte transaction short IDs instead of full transaction data -- reconstructing blocks from the receiver's mempool. When transactions are missing, Reed-Solomon forward error correction codes fill the gaps without a round trip. The result is sub-second propagation for any pool, regardless of its peering relationships or geographic location.
- Compact blocks reduce relay payload from ~1-2 MB to ~20-30 KB for a typical block
- Reed-Solomon FEC recovers missing transactions without additional round trips
- Projected stale rate reduction from ~3.9% to <1% at 25-second block times
Eliminates Censorship Risk
In Stratum V1, the pool constructs the block template and sends miners a fixed header to hash against. Miners have zero visibility into which transactions are included. F2Pool used this to silently drop shielded transactions for six years -- their 2016-era code never computed the Sapling commitment tree root.
Stratum V2's Job Declaration protocol inverts this. The miner runs a
local Zebra node, calls getblocktemplate, selects
transactions, and submits the completed template to the pool. The pool
validates the coinbase payout and block structure but cannot modify the
transaction set. Miners see exactly what they're mining.
- Miners call
getblocktemplateon their own Zebra node and choose transactions - Pool validates coinbase output and merkle root but cannot alter the transaction list
- Binary framing with TLV encoding -- 60% smaller than V1's newline-delimited JSON
Built for Faster Blocks
The Zcash community is exploring reducing block times from 75 seconds to 25 seconds. Bedrock is engineered for this future -- every component is designed around latency.
Architecture
Key Features
Miner-Controlled Transaction Selection
Job Declaration protocol lets miners choose which transactions go in blocks, restoring decentralization to mining.
Encrypted Transport
All connections between pool and miner are authenticated and encrypted, preventing hashrate hijacking and man-in-the-middle attacks.
Compact Block Relay with FEC
FORGE protocol with Reed-Solomon forward error correction for sub-second block propagation across the network.
Adaptive Difficulty (Vardiff)
Automatically adjusts per-miner difficulty targeting ~5 shares/min for optimal bandwidth and payout accuracy.
Prometheus Metrics + Tracing
Strata provides real-time dashboards and OpenTelemetry integration for full visibility into pool operations.
Binary Protocol
60% bandwidth reduction vs Stratum V1's JSON plaintext. Purpose-built binary encoding for mining workloads.
Start Mining in 5 Minutes
# Clone and build
git clone https://github.com/iqlusioninc/stratum-zcash
cd stratum-zcash
cargo build --release
# Run pool server (requires Zebra node)
cargo run --example run_pool -p zcash-pool-server