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:

Architecture

Bedrock consists of several crates that work together:

ComponentPurpose
zcash-pool-serverMain pool server orchestrating all mining operations
zcash-mining-protocolBinary Stratum V2 message types for Zcash Equihash
zcash-equihash-validatorShare validation and adaptive difficulty (vardiff)
zcash-template-providerFetches block templates from Zebra RPC
zcash-jd-serverJob Declaration server for miner-controlled templates
zcash-jd-clientStandalone 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