Bedrock Documentation
Bedrock is a suite of mining infrastructure components for Zcash, built around the Stratum V2 protocol. It enables decentralized mining where miners can control transaction selection, communicate over encrypted channels, and relay blocks efficiently.
Getting Started
New to Bedrock? Start here depending on your role:
- Miners — Miner Quick Start covers connecting to a Stratum V2 pool in 5 minutes
- Pool Operators — Pool Operator Guide walks through setting up and running a pool
- Mining Software Developers — Mining Software Integration details the binary protocol for integration
- Decentralized Mining Advocates — JD Client Guide explains how to run your own block template construction
Architecture
Bedrock consists of several crates that work together:
| Component | Purpose |
|---|---|
| zcash-pool-server | Main pool server orchestrating all mining operations |
| zcash-mining-protocol | Binary Stratum V2 message types for Zcash Equihash |
| zcash-equihash-validator | Share validation and adaptive difficulty (vardiff) |
| zcash-template-provider | Fetches block templates from Zebra RPC |
| zcash-jd-server | Job Declaration server for miner-controlled templates |
| zcash-jd-client | Standalone client for decentralized template construction |
Sub-Protocol Components
Bedrock includes three named sub-protocol components:
FORGE — Block Relay
FORGE implements compact block relay (adapted from BIP 152) for low-latency block propagation in Zcash. It reduces bandwidth by transmitting short transaction IDs for transactions already in peer mempools.
Strata — Observability
Strata provides the observability stack: Prometheus metrics, structured logging, and distributed tracing. It exposes connection counts, share rates, hashrate estimates, and validation latency.
Noise — Encrypted Transport
Noise implements the Noise_NK_25519_ChaChaPoly_BLAKE2s handshake pattern used by Stratum V2. It authenticates the pool to miners and encrypts all traffic, preventing hash hijacking and eavesdropping.
Key Concepts
Stratum V2 is a binary mining protocol that replaces the JSON-based Stratum V1. It brings encrypted communication, compact message encoding, and support for Job Declaration where miners can construct their own block templates.
Job Declaration lets miners customize or fully control block construction. In Coinbase-Only mode, miners customize the coinbase transaction. In Full-Template mode, miners select all transactions — the strongest form of mining decentralization.
Equihash (200,9) is the proof-of-work algorithm used by Zcash. Solutions are 1,344 bytes (512 indices packed at 21 bits each), and the full nonce is 32 bytes split between pool-assigned prefix and miner-iterated suffix.
Reference
- Protocol Reference — Complete binary message format documentation
- Security Analysis — Analysis of known attack vectors and mitigations
- Migration from V1 — Guide for migrating from Stratum V1 (ZIP 301)