Stratum V2 Infrastructure

SV2 mining gateway
built for production pools

ReserveGrid OS is a miner-facing Stratum V2 gateway with Noise NX encrypted transport, template verification, fail-closed prevhash switching, and a two-event share lifecycle. Every decision carries a machine-readable reason code.


34
GatewayReason codes
50ms
Verdict timeout
ReserveGrid OS
v1.0.0 · Stratum V2 Gateway
3
Deployment modes
2
Share lifecycle events
The problem

SV2 enables miner autonomy.
That autonomy needs guardrails.

The SV2 adoption challenge

Stratum V2 lets miners propose their own block templates. Pools gain encrypted transport and reduced bandwidth, but lose visibility into what miners submit. Without verification, a pool has no way to detect malformed templates, fee policy violations, or stale prevhash references before distributing work.

The ReserveGrid solution

ReserveGrid OS sits between miners and the pool as a standard job server. It verifies every template against operator policy, switches prevhash references with fail-closed safety, tracks shares through a two-event lifecycle, and emits structured reason codes for every decision.

Architecture

End-to-end gateway flow

From miner handshake to upstream share submission, every hop is observable.

Noise NX TCP/NDJSON RPC Miner SV2 client sv2-gateway ReserveGrid OS pool-verifier template-manager Upstream poller bitcoind Block templates shares → pool backend (HTTP POST)
The gateway also forwards valid shares upstream via HTTP POST to the pool backend. Shares flow through a bounded queue with configurable backpressure policy.
Capabilities

What the gateway handles

Three deployment modes

Shadow audits templates without miners. Observe logs verdicts without gating. Inline enforces policy with fail-closed safety. One binary, one config key.

See modes

Two-event share lifecycle

Every share produces share_accepted at ACK time and share_forward_result after upstream POST. Joined by share_id with a 1:1 invariant.

See pipeline

Fail-closed prevhash

When a new block arrives, miners hold on stale work until the verifier responds. 50ms verdict timeout, 5s stale hold, deterministic disconnect on expiry.

See timing
Comparison

What changes with ReserveGrid

Capability Traditional pool SV2 without ReserveGrid SV2 + ReserveGrid
Miner transport encryption ✗ Plaintext ✓ Noise NX ✓ Noise NX
Template verification ○ Pool-side only ✗ None ✓ Policy-driven, 34 reason codes
Prevhash safety ○ Implicit ✗ No verification gate ✓ Fail-closed, 50ms + 5s hold
Share audit trail ✗ Pool internal ✗ None at gateway ✓ Two-event lifecycle with HMAC
Reject traceability ✗ Opaque ✗ SV2 wire codes only ✓ reason_code + policy context
Operator config surface ○ Varies ✗ Minimal ✓ 51 TOML keys + env overrides
Observability ○ Custom ✗ Not built in ✓ Prometheus + event stream + Grafana
Output

What operators see

Every verdict is structured, machine-readable, and carries the policy context that caused it.

{
  "accepted": false,
  "reason_code": "avg_fee_below_minimum",
  "reason_detail": "avg_fee=141 < min_avg_fee_used=200",
  "policy_context": {
    "fee_tier": "mid",
    "min_avg_fee_used": 200
  }
}
Get started

Ready to deploy SV2 with confidence?

Shadow mode costs nothing. Observe mode builds trust. Inline mode protects revenue.