▸ PRODUCT · v2.0.0

The verifier doesn’t trust the template. It re-derives it.

Veldra v2.0.0 ships the Invariant Shield: 22 canonical re-derivation checks (Phase 1) plus mempool ground truth (Phase 2). Layered on top of the existing 59-code v1 policy gateway and 61-key TOML config baseline.

HONEST SCOPING · v2.0.0 STATEWIREDvs.OBSERVING

v2.0.0 wired, on origin, CI green. Independent consensus re-derivation runs. Mempool ground truth runs. The launch claim that the system catches consistent template-manager tampering at the verifier layer in production requires the production observation cycle to complete first. Until then, public messaging distinguishes “wired and tested in CI” from “validated against real mainnet templates over a multi-week observation window.”

▸ SECTIONS
01Reason codes02Configuration03Telemetry04rg-consensus facade05Phase-2 fail-stale state machine06Threat model · ceilings · caveats07Adoption modes08Veldra vs SRI09Roadmap
01

Reason codes

Every disagreement gets a name. The reason-code surface is the contract: what the verifier emits when it rejects a template, on the metric stream and the log line, with a canonical source you can grep.

59
gateway reason codes · v1 baseline
22
v2_invariant_* codes total · canonical from rg-consensus::ConsensusViolation::ALL_CODES
T1 · ×5Tier 1 · criticalPhase 1 (v2.0.0)

Defects that produce an immediately invalid block. Re-derived from raw block bytes.

CoinbaseValueCoinbaseHeightMerkleRootWitnessCommitmentMismatchTxCount
T2 · ×5Tier 2 · highPhase 1 (v2.0.0)

Defects that produce orphan-likely or downstream-invalid blocks.

TemplateWeightSigopsCoinbaseSigopsWitnessCommitmentMissingCoinbaseBip34
T3 · ×7Tier 3 · belt-and-suspendersPhase 1.5 (post observation cycle)

Wires after the v2.0.0 production observation cycle completes cleanly.

CoinbaseScriptLengthCoinbaseOutputCountWeightExceedsMaxSigopsExceedMaxNonCoinbaseNullPrevoutHeaderVersionLowDuplicateTx
CLASS M · PHASE 2 (mempool ground truth)

Cross-references the template's non-coinbase txids against an independent bitcoind mempool view. Rejects when the unknown-tx ratio exceeds tolerance_pct.

Canonical source: rg-consensus::ConsensusViolation::ALL_CODES

02

Configuration

61 baseline TOML keys plus 8 new under [policy.mempool] in v2.0.0. All 8 optional with defaults — older configs continue to load unchanged.

v1 baseline · 61 keys across [gateway] · [timing] · [share] · [auth]
[policy.mempool]NEW IN v2.0.0 · 8 KEYS
enforcefalseadvisory until operator opts in
tolerance_pct4.0unknown-tx ratio threshold; tunable down toward 2.0
poll_interval_secs10getrawmempool poll cadence
max_stale_secs60fail-stale window before view becomes Degraded
per_tx_detailfalseexpand SAMPLE_UNKNOWN_CAP=10 to all unknown txids
rpc_urloperator-side bitcoind RPC endpoint
rpc_userRPC auth · or via env var
rpc_passRPC auth · or via env var

All 8 new keys optional with defaults so older configs continue to load unchanged.

03

Telemetry

Four new Prometheus streams in v2.0.0 for Phase 2. Existing exports unchanged.

NEW IN v2.0.0 · 4 STREAMS
verifier_phase2_checks_total{result}counterresult ∈ {agreed, rejected, skipped, stale}
verifier_phase2_degraded_totalcounterincremented per template served while view is Degraded
verifier_mempool_view_age_secondsgaugeage of last successful refresh
verifier_mempool_view_sizegaugetx count in last successful refresh

Existing exports unchanged. Prometheus / Grafana / CSV / NDJSON observability per current site.

04

rg-consensus facade

The narrow public API of the consensus engine. Five re-derivation entry points and five accessors over rust-bitcoin — the entire Class D / Class S surface.

rg-consensus is a separable facade wrapping rust-bitcoin behind a narrow boundary.

RE-DERIVATION ENTRY POINTS · ×5
re_derive_coinbase_value()re_derive_template_weight()re_derive_merkle_root()re_derive_witness_commitment()count_sigops()
CLASS ACCESSORS · ×5
template_txidsparse_blocktotal_sigopscoinbase_sigopsbip34_height
05

Phase-2 fail-stale state machine

What happens when the operator’s bitcoind RPC poll fails. Three states, named transitions, no template drops.

Mempool-view state machine: the verifier transitions through three states based on age, then degrades cleanly without dropping templates.

STATE 1
Fresh
ENTERS WHEN
successful poll within poll_interval_secs
BEHAVIOR
Class M check runs against fresh view.
STATE 2
Stale
ENTERS WHEN
refresh failure, age ≤ max_stale_secs
BEHAVIOR
Class M still runs against last-known view.
STATE 3
Degraded
ENTERS WHEN
age > max_stale_secs × 2
BEHAVIOR
Class M skipped. Templates fall through to Phase 1. verifier_phase2_degraded_total ++.
DEFAULTS
max_stale_secs = 60  ·  sample_unknown_cap = 10
06

Threat model · ceilings · caveats

What’s in scope, what’s structurally out of scope, and what the 4% mempool-tolerance window can and cannot do.

ID
THREAT
STATUS
CAUGHT BY
T1raw_block tampering✓ INL2 Phase 1
T2declared-versus-bytes mismatch✓ INL2 Phase 1
T3consistent template-manager tampering✓ INL3 Phase 2
T4compromised operator bitcoind✗ OUTexplicitly out of scope
T5selfish mining · aggressive mempool divergence✗ OUTv3.x territory

ReserveGrid OS v2.0.0 with Phase 1 plus Phase 2 catches T1, T2, T3. T4 and T5 are explicitly out of scope.

▸ ARCHITECTURAL CEILINGS · WHAT EACH LAYER STRUCTURALLY CAN'T CATCH
L1 · CAN'T

any template whose declared fields pass operator thresholds, even if underlying bytes are fabricated

L2 · CAN'T

tampering whose declared values and raw bytes are internally consistent by construction

L3 · CAN'T

tampering operating within the configured tolerance window, or while bitcoind itself is compromised

▸ CAVEATS · NAMED UPFRONT
  • 01The 4% tolerance window in Phase 2 absorbs benign mempool divergence (legitimate propagation latency between operator’s bitcoind and the network).
  • 02Tuning down toward 2.0 narrows the window but cannot reach zero without producing false positives on real templates.
  • 03Phase 2 trusts the operator’s bitcoind by definition. If that bitcoind is itself compromised, Class M is blind.
07

Adoption modes

Three deployment shapes — Shadow (warn-only · free), Observe (license · no enforcement), Inline (license · fail-closed). The bitcoind prerequisite is named upfront.

MODE
Shadow
Free~1 day to wire

Run the gateway behind your existing path with verdict = warn-only. Zero share-flow change.

MODE
Observe
License~1 week

Self-hosted Docker stack plus license key. Mainnet bitcoind required (or use rg-feed-server).

MODE
Inline
LicenseDepends on infra readiness

Fail-closed enforcement. Gateway in the share path.

BITCOIND PREREQUISITE

Observe and inline both require operator-side bitcoind: synced, resourced, RPC reachable, env-var or [policy.mempool] rpc_* credentials wired.

LICENSE KEY FLOW

Operators who want observe or inline mode get a license key from their veldra.org account (Sign In).

Observe and inline both require operator-side bitcoind: synced, resourced, RPC reachable, env-var or [policy.mempool] rpc_* credentials wired.

08

Veldra vs SRI

The single named product comparison. Stratum Reference Implementation is the canonical proof the SV2 protocol is implementable. Veldra is built for pool operators who need verification, not just connectivity.

The Stratum Reference Implementation (SRI) is the canonical proof that the SV2 protocol is implementable. Veldra is built for pool operators who need verification, not just connectivity.

AXIS
SRI
Veldra
SV2 protocol surface
Yes · canonical reference
Yes · production-shaped
v1 policy-class checks
Partial
Full · 59 gateway reason codes
L2 invariant re-derivation
No
Yes · 22 v2_invariant codes
L3 mempool ground truth
No
Yes · Phase 2 Class M
Built for pool operator deployment
Implementation reference
Yes

DATUM and other miner-side template protocols are ecosystem context. Veldra’s verification layer is independent of which miner-side protocol the pool runs.

09

Roadmap

v2.0.0 → Phase 1.5 → v3.x. No calendar dates — the milestones are gated on the production observation cycle, not the wall clock.

v2.0.0v2.0.0 launch milestonecurrent

Invariant Shield Phase 1 plus Phase 2 mempool ground truth.

p1.5Phase 1.5next engineering bucket

Seven Tier 3 belt-and-suspenders invariants wire after the v2.0.0 production observation cycle completes cleanly.

v3.xv3.x (mild vision)design sketch

Selfish mining detection. Per-tx detail mode plus the four Phase 2 metrics shipped in v2.0.0 set up the data shape for time-series detection of templates whose unknown-tx sets cluster temporally with structurally coherent fingerprints. v3.x design begins from the shipped Phase 2 surface — no protocol change required, no migration cost beyond enabling per-tx detail in operator policy.

▸ READ NEXT
Architecture →
How a single block template walks through the gateway, independent re-derivation, Class D, and Class M, six steps with the codes named at every stage.
Failure Atlas →
A history of pool incidents, indexed by date — what each one was, what layer would have caught it, and what reason code would have fired.
Q&A · Operator evaluation →
Six blunt questions in order. What it does. What it tells you. How to configure. Cost. Why not existing tools. What’s WIRED today.