XChain Platform Hub: Configuration

Environment Variables

Silent-failure variables (read this first)

Two variables degrade security when left empty. The hub starts and appears healthy either way, so the misconfiguration is easy to miss.

HUB_API_KEY: empty leaves write authentication disabled. When HUB_API_KEY is set, authentication fails closed: mutating methods (updateconfig, registervalidator, propose, vote, requestattestation, reportreorg, initiateswap, the oracle/price push methods) return 401 unless the caller presents the configured key. Hub feed reads accept the narrower HUB_FEED_API_KEY when it is configured, as described below.

When it is unset or empty, those paths are open, so the hub refuses to boot unless keyless operation is declared with HUB_ALLOW_UNAUTHENTICATED=true. Keyless remains supported (single-host regtest, a hub reachable only on a private network or behind an authenticating proxy), but it has to be a stated choice rather than the result of a forgotten variable. xchain-node sets the declaration automatically when it deploys a hub with no key in the host environment, except on mainnet, where the refusal stands.

Always set a strong, random HUB_API_KEY in production. Generate one with:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Clients then send it on each request (the indexer reads the same value as HUB_API_KEY, the encoder-facing services as their own *_ENCODER_API_KEY, and so on).

HUB_FEED_API_KEY: empty keeps feed reads on the bulk key. Set this to a separate read-only credential for hub-DB snapshots, WebSocket subscriptions, and gethubs. It grants no config reads and no push or other write method. HUB_API_KEY continues to authorize these feed reads for compatibility and remains the credential for ordinary pushes. Retraction pushes use HUB_REORG_API_KEY when that separate key is configured.

SIGNING_PRIVKEY_SECRET: empty means unsigned P2P messages and no federation identity. SIGNING_PRIVKEY_SECRET is the Ed25519 private key (a 32-byte seed, encoded as 64 hex characters) that authenticates this hub’s P2P messages to the rest of the validator federation. When the P2P cluster is enabled (see P2P_VALIDATOR_ADDR) but this key is empty, the hub loads no validator identity: outbound messages go out unsigned, and this hub has no verifiable identity among its peers. Nothing fails loudly; the hub simply never participates as an authenticated validator, and depending on peers’ REQUIRE_SIGNATURES its messages may be silently dropped.

Generate a key pair (the private seed is what you set; keep it secret):

# Private seed (set this as SIGNING_PRIVKEY_SECRET):
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

The corresponding public key is derived automatically at startup from the seed (the hub logs the first 16 hex characters of the pubkey when the identity loads). Each validator’s pubkey must be registered in the cluster so peers can verify its signatures.

The key format is validated: it must be exactly 64 hex characters. An invalid non-empty value throws at startup; only the empty case is silent.

Secret variable naming

Automatic secret redaction, in terminals, CI logs and assistant transcripts, keys on the variable name and matches _SECRET, _KEY, or _TOKEN. A name like HUB_DB_PASS matches nothing, so the value prints in full every time someone reads the env file.

Three hub secrets accept a _SECRET name, with the historical name kept as a deprecated fallback so no running deployment breaks:

Preferred Deprecated
HUB_DB_SECRET HUB_DB_PASS
XCHAIN_PRICE_INDEXER_DB_SECRET XCHAIN_PRICE_INDEXER_DB_PASS
SIGNING_PRIVKEY_SECRET SIGNING_PRIVKEY_HEX

The hub logs a warning at startup for each secret still supplied under the deprecated name. Setting both names to different values is a startup error, not a precedence rule: that shape is a half-finished rename, and picking a winner is how a hub keeps authenticating with the credential it was supposed to rotate away from. Renaming does not un-leak anything by itself: a credential that has already been read out loud still has to be rotated.

Core (Required)

These variables are required regardless of operating mode.

Variable Required Default Description
HUB_HOST No 0.0.0.0 Host to bind the API server
HUB_PORT Yes None Port for the JSON-RPC API
HUB_DB_HOST Yes None MariaDB host
HUB_DB_PORT Yes None MariaDB port
HUB_DB_NAME Yes None MariaDB database name (e.g., XChain_Hub)
HUB_DB_USER Yes None MariaDB username
HUB_DB_SECRET Yes None MariaDB password. Deprecated name HUB_DB_PASS is still read; see Secret variable naming above.
HUB_DB_KEEPALIVE_INTERVAL No 30000 Interval (ms) between no-op keepalive queries sent to the MariaDB pool to prevent idle-connection drops
CORS_ORIGIN No false Allowed CORS origin(s); unset disables cross-origin requests. * allows any origin, or give one origin or a comma-separated allowlist matched per origin (browser wallet shells each send a different origin). A stray * inside a list is not a wildcard, so the grant fails closed.
HUB_RATE_LIMIT_RPM No 100 Requests allowed per IP per 60-second window on every route except the mirror-bootstrap family /hub-db/snapshot/*, which HUB_SNAPSHOT_RATE_LIMIT_RPM below meters in its own bucket. Over the limit the request returns HTTP 429 with a JSON-RPC error body (code -32029) naming the limit, the window and the seconds to wait, plus Retry-After and RateLimit-* headers. Behind a reverse proxy the limiter keys on X-Forwarded-For, which is what HUB_TRUST_PROXY below governs.
HUB_AUTH_RATE_LIMIT_RPM No 60000 Requests allowed per IP per 60-second window on the JSON-RPC surface for callers whose x-api-key header matches a key this hub has configured, metered in their own bucket so the fleet’s own indexers and replay traffic keep a high budget while keyless callers stay at HUB_RATE_LIMIT_RPM. A wrong key lands in the public bucket, and a keyless hub has no authenticated bucket, so every caller is public there. A request is charged to one bucket only, and a batch is charged one token per call. The mirror-bootstrap routes /hub-db/snapshot/* stay in the HUB_SNAPSHOT_RATE_LIMIT_RPM bucket, and the HUB_RATE_LIMIT_EXEMPT_LOCAL exemption applies here too. An unset, unparseable or non-positive value keeps the default, raised to HUB_RATE_LIMIT_RPM if that is higher.
HUB_RATE_LIMIT_EXEMPT_LOCAL No true Exempts callers whose resolved client IP is loopback or private-range (RFC1918, IPv6 unique-local and link-local) from the per-IP limit above. This is what lets a node’s own indexer rebuild price history from the chain at the shipped default: it replays one pushpricebatch per batch-bearing block, far faster than 100/min, and reaches the hub over the container bridge. The check runs on the post-trust proxy client IP, so a public caller arriving through a private-IP reverse proxy is still limited. Set to false to enforce the cap on every caller.
HUB_SNAPSHOT_RATE_LIMIT_RPM No 600 Requests allowed per IP per 60-second window on the mirror-bootstrap routes /hub-db/snapshot/*, metered in their own bucket so a mirroring indexer draining from id 0 and ordinary polling cannot starve each other: on the 2026-09-16 fleet roll three indexers behind one public address spent the shared 100 req/min, 429ed part way and stayed wedged until HUB_RATE_LIMIT_RPM was raised by hand. Sized to the measured drain (about 32 page reads for one mirror’s full bootstrap, about 96 for three mirrors behind one address). A request here is charged to this bucket only, never to HUB_RATE_LIMIT_RPM. Over the limit the hub answers 429 in the { "error": ... } shape these REST routes already use. The HUB_RATE_LIMIT_EXEMPT_LOCAL exemption above applies to this bucket too. An unset, unparseable or non-positive value keeps the default.
HUB_SNAPSHOT_MAX_INFLIGHT No 4 Snapshot page reads in flight at once on /hub-db/snapshot/*, across every caller. The per-IP limits exempt loopback and private-range callers, so without this bound a page flood fills the shared ten-connection pool and the health probe’s SELECT 1 starves. Excess reads are shed with 429, Retry-After: 1 and the limiter’s JSON-RPC error body (code -32029), which the indexer bootstrap retries; a finished, failed or aborted request frees its slot. Keep it below the pool size. An unset, unparseable or value below 1 keeps the default.
BTC_INDEXER_RATE_LIMIT_RPM No 600 The per-IP request limit of the BTC indexer this hub proxies capability snapshot proofs to. Set it to match that indexer’s INDEXER_RATE_LIMIT_RPM; it caps HUB_CAPABILITY_PROOF_RPM below.
HUB_CAPABILITY_PROOF_RPM No half of BTC_INDEXER_RATE_LIMIT_RPM (300) Proof requests a minute this hub sends to the BTC indexer across all its mirroring clients, one shared budget per hub process with a burst of 4. A request whose turn is within 5 s waits for it; a later one gets 429 with Retry-After, and an upstream 429 is passed back the same way instead of 503. Never above BTC_INDEXER_RATE_LIMIT_RPM.
HUB_MAX_RPC_BATCH No 20 Maximum call objects in one JSON-RPC batch array. The rate limiter above charges one token per HTTP request while the dispatcher runs every element of the batch, so without this cap one request amplifies past the limit. Over the cap the hub answers 400 with JSON-RPC error -32600. Every hub connector sends a single call object, so the cap breaks no existing client.
HUB_TRUST_PROXY No loopback, uniquelocal Express trust proxy setting. A containerized hub behind a local reverse proxy works with the default. Set to false to disable, a hop count (e.g. 1), or a CIDR list for other topologies. See Express docs.
HUB_ALLOW_UNAUTHENTICATED No false A hub in validator mode (P2P_VALIDATOR_ADDR set) with no HUB_API_KEY refuses to boot, because its write methods would let anyone drive consensus-affecting writes. Set to true to explicitly acknowledge running keyless (regtest/dev only). See OPERATIONS.md → Authentication.
HUB_API_KEY_PREVIOUS No None The previous HUB_API_KEY, still accepted beside it while a key rotation rolls out, on the same authenticated routes, snapshot, WebSocket and rate-limit checks. Only the variable name is ever logged. Unset accepts HUB_API_KEY alone.
HUB_FEED_API_KEY No None Read-only credential accepted for hub-DB snapshots, WebSocket subscriptions, and gethubs. It grants no config reads or writes. Unset keeps those reads on HUB_API_KEY; the bulk key remains valid for feed reads during rolling deployment. Treat as a credential.
HUB_PUBLIC_API_URL No None Public feed base URL this hub advertises to signer-set peers and returns through gethubs. It has no derived default because P2P_VALIDATOR_ADDR is a signing address, not necessarily a reachable URL. Omit it to keep this hub out of discovery results.
HUB_CONFIG_SECRETS_API_KEY No None Separate API key authorizing getallconfigs requests that ask for the unredacted config tree. Set it to split the credential tier off the bulk HUB_API_KEY; unset, HUB_API_KEY unlocks both, and a hub declared HUB_ALLOW_UNAUTHENTICATED serves them unauthenticated either way. Deploy xchain-explorer and xchain-sync before a hub that sets this, since a consumer that does not send the flag receives a redacted password. Treat as a credential.

Telemetry Collector

The hub is the single collector for anonymous node-operator telemetry (the telemetry_pings table; see Database Schema below). The raw client IP is never stored: at ingest the hub derives a coarse country/region and a keyed one-way hash, then discards the IP.

Variable Required Default Description
TELEMETRY_ENABLED No true Accept telemetry pings. Set false on a private/local hub.
TELEMETRY_RETENTION_DAYS No 90 Prune telemetry rows older than N days.
TELEMETRY_IP_SALT No None Secret salt for the one-way IP hash. Without it, ip_hash is left null (an unsalted hash would be trivially reversible).
TELEMETRY_ADMIN_KEY No None x-api-key gate for the telemetry admin/query surface (empty leaves it fail-closed). Must match the value the dashboard service is configured with.

Metrics and Log Shipping

The shared observability module adds a Prometheus scrape endpoint and a structured log shim. Both are off unless set here: with no variables the hub registers no extra route, starts no timer, and opens no socket.

Variable Required Default Description
METRICS_ENABLED No off Serve the Prometheus scrape endpoint.
METRICS_PATH No /metrics Scrape path.
METRICS_TOKEN No None Require Authorization: Bearer <token> on the scrape. Set this (or keep the path behind the fronting proxy) on any internet-reachable box.
METRICS_HTTP No true when metrics are on Per-request counters and a latency histogram. Set 0 for endpoint-only.
LOG_FORMAT No text json emits one NDJSON record per log line.
LOG_LEVEL No info debug, info, warn, or error.
LOG_SHIP_ENABLED No off POST batched NDJSON to a collector. Needs LOG_SHIP_URL too; either alone stays off.
LOG_SHIP_URL No None Collector endpoint (http/https).
LOG_SHIP_TOKEN No None Bearer token for the collector. Never logged or echoed.
LOG_SHIP_BATCH_SIZE No 100 Lines per POST.
LOG_SHIP_INTERVAL_MS No 5000 Flush interval.
LOG_SHIP_MAX_BUFFER No 5000 Bounded buffer; the oldest lines are dropped and counted, never grown without limit.
LOG_SHIP_TIMEOUT_MS No 5000 Per-batch POST timeout.

P2P Gossip Layer

Validator mode is activated when P2P_VALIDATOR_ADDR is set. All P2P-dependent subsystems (consensus, oracle, cross-chain, reorg, governance) are no-ops without it.

Variable Required Default Description
P2P_VALIDATOR_ADDR No None This validator’s public address. Setting this activates validator mode.
P2P_PORT No 10001 WebSocket P2P listen port
P2P_HOST No 0.0.0.0 P2P bind address
SEED_NODES No None Comma-separated list of peer addresses (e.g., peer1.example.com:10001,peer2.example.com:10001)
SIGNING_PRIVKEY_SECRET No None 64-hex-char Ed25519 private key seed for message signing. Deprecated name SIGNING_PRIVKEY_HEX is still read; see Secret variable naming above and Silent-failure variables for what an empty value does.
HUB_NETWORK Yes (validator mode) None Deployment network: mainnet, testnet, or regtest. Required when P2P_VALIDATOR_ADDR is set; process.exit(1) if absent or invalid. Must match the INDEXER_NETWORK of the chains this hub federates. Controls consensus activation gating (e.g. STAKE_WEIGHTED_QUORUM activation height is per-network).
REQUIRE_SIGNATURES No true When true, reject unsigned P2P messages. Defaults to true in validator mode; pass false to bootstrap a new federation before all nodes have keys.
P2P_HEARTBEAT_INTERVAL No 15000 Milliseconds between heartbeat broadcasts
P2P_RECONNECT_BASE No 2000 Base delay for reconnect backoff (ms)
P2P_RECONNECT_MAX No 60000 Maximum delay for reconnect backoff (ms)
P2P_MSG_DEDUP_TTL No 60000 Message deduplication cache TTL (ms)
P2P_MAX_PAYLOAD No 1048576 Maximum WebSocket message size in bytes (1 MB)
P2P_DEDUP_PRUNE_INTERVAL No 30000 Interval (ms) at which the seen-message deduplication cache is pruned
P2P_WS_PING_INTERVAL No 30000 Interval (ms) for WebSocket ping/pong keepalive (dead-connection detection)
P2P_MAX_CONNECTIONS_PER_IP No 3 Maximum simultaneous inbound connections from a single IP (anti-DoS). Increase for co-located federations where multiple validators share one IP.
HUB_P2P_FEED_ENABLED No true Whether this hub also answers the mirror feed on its P2P port, so an indexer can mirror hub state and report what landed on its chain without reaching the private API port. The surface provides snapshot and subscription reads, gethubs, and the existing indexer push methods. Read requests accept HUB_FEED_API_KEY or the bulk HUB_API_KEY; pushes still require their bulk or reorg key. Set to false to keep the port to validator gossip alone. The feed is refused outright when neither feed key is configured, because its reads would otherwise be unauthenticated.
HUB_CAPABILITY_CONFIG No None Path to the capability config JSON (see below). Required for capability qualification + self-tests.

Hub discovery and peer catch-up

gethubs is a read-only feed method. It returns { hubs: [ { api_url, signing_pubkey } ] } for this hub and connected signer-set peers that advertise HUB_PUBLIC_API_URL. Indexers and explorers merge these addresses with their configured seeds after each certified drain. An empty result changes no candidates.

On startup and whenever a peer link reconnects, a hub catches up each mirrored table from a connected signer-set peer. It pages that peer’s snapshot, verifies each row with the table’s normal signature or validation rules, and inserts accepted content under a new local id. A table becomes caught up only after a complete pass against a peer. If no peer is reachable, it remains not caught up and the hub logs that condition periodically.

The hub-DB ready frame reports caught_up: true only when every mirrored table is caught up. While it is false, the hub holds its admission watermark at the floor persisted before the outage. Multi-hub consumers move to another candidate; pinned consumers wait and retry. A missing caught_up field from an older hub is treated as true for rolling compatibility.

Capability Configuration

Capability staking decides which of the five capabilities (price, cross_chain, oracle_publish, attestation, full_node) a validator is qualified and ready to serve. The hub loads this from the JSON file at HUB_CAPABILITY_CONFIG, applies it on startup, and hot-reloads on file change. It supplies two things:

  • CAPABILITIES.<cap>.MIN_STAKE: the stake threshold a pubkey must meet (queried from the indexer) to qualify. If a capability has no configured MIN_STAKE, the hub treats it as not qualified (fail-closed); it does not default to 0.
  • Per-capability self-test config blocks, checked locally so the hub only participates when it can actually serve:
    • price: { "sources": [...], "fiats": [...] }
    • cross_chain: { "chains": { "BTC": { "rpc": "..." }, ... } }. The rpc value is the chain’s coin-node RPC, and the full_node self-test reads the same BTC entry; matching itself resolves the chain’s indexer through <COIN>_INDEXER_API_URL
    • oracle_publish: { "doge_address": "...", "doge_wallet": "..." }
    • attestation: { "providers": { "<id>": false } } (omit a key to enable it)
  • DISABLED_CAPABILITIES: array of capabilities to opt out of even when qualified.
{
  "CAPABILITIES": {
    "price":          { "MIN_STAKE": "1000.00000000" },
    "oracle_publish": { "MIN_STAKE": "500.00000000" }
  },
  "DISABLED_CAPABILITIES": ["cross_chain", "attestation"],
  "price": { "sources": ["coingecko"], "fiats": ["USD"] },
  "oracle_publish": { "doge_address": "D...", "doge_wallet": "/data/.dogecoin/wallet.dat" }
}

xchain-node validator init generates a starter file and xchain-node install mounts it into the hub container automatically. See OPERATIONS.md → Validator Mode.

PBFT Consensus

Variable Required Default Description
PBFT_TIMEOUT No 30000 Consensus round timeout in milliseconds. Triggers view change on expiry.
MIN_VALIDATORS No 1 Minimum validators required before a consensus round may run.
PBFT_SNAPSHOT_TOLERANCE_BLOCKS No 144 How far a config-PBFT PRE_PREPARE’s leader-stamped btcBlockHeight may deviate from this hub’s own BTC tip before a federated follower declines to PREPARE. The stamped height selects the validator set, the leader and the stake-weighted-quorum outcome, so an unbounded one lets the proposer choose all three; a follower that cannot resolve a tip of its own declines. Single-node hubs are unaffected.
ORACLE_SNAPSHOT_TOLERANCE_BLOCKS No 144 The same bound on the price-round PROPOSE path: how far a leader-supplied btcBlockHeight may deviate from this hub’s own BTC tip before a federated follower drops the round.
HUB_CONSENSUS_INPUT_ALERT_AFTER No (built-in default) Consecutive consensus-input failures before the alarm fires. A non-integer or non-positive value logs an error and falls back to the default rather than disabling the alarm, so a typo cannot silently restore fail-closed-and-silent behaviour.
HUB_SNAPSHOT_REORG_BUFFER No 6 Blocks of reorg buffer applied when building a capability snapshot. Consensus-critical: it must match across the federation. A malformed value logs an error and falls back to 6 rather than forking the federation on a typo.
XCHAIN_HUB_SKIP_ZERO_CONF_ASSERT No (unset) Set to 1 to bypass the boot assertion that ATTEST_ZERO_CONF_ACTIVATION is at or above both ATTEST_RESPONSE_MIRROR_ACTIVATION and ATTEST_RESPONSIBLE_WIDENING_ACTIVATION on every network where it is armed. Only for a venue where every hub runs the same maps: below the mirror height a round would run at zero confirmations and burn a broadcast fee against a reorged request, and with widening unarmed the flip would remove the wait with no headroom behind it. On mainnet and testnet a violation otherwise refuses to start (ZERO_CONF_ORDERING); standalone and regtest warn instead. The bypass logs a warning every time it is taken.
XCHAIN_HUB_SKIP_REORG_BUFFER_ASSERT No (unset) Set to 1 to bypass the assertion that HUB_SNAPSHOT_REORG_BUFFER equals the canonical federation value. Only for a venue where every hub runs the same override: each hub subtracts this buffer before resolving a snapshot, so hubs disagreeing on it lock different blocks for the same round and produce divergent validator sets and quorum N. On mainnet and testnet a mismatch otherwise refuses to start (REORG_BUFFER_MISMATCH); standalone and regtest warn instead. The bypass logs a warning every time it is taken.
XCHAIN_HUB_SKIP_MIN_STAKE_ASSERT No (unset) Set to 1 to skip the minimum-stake assertion at startup. Test and bring-up seam; leaving it set on a real deployment disables a safety check.
ATTEST_RESPONSE_FORWARD_S_OVERRIDE No (unset) Overrides ATTEST_RESPONSE_FORWARD_S (120), the seconds a round leader adds to now when stamping the effective time an attestation response becomes applicable at. Honoured on regtest only; on any other network a differing value is ignored with a warning latched once per process, and standalone mode (no network) counts as not-regtest and keeps the frozen value. On regtest a value that is not a whole number of seconds throws at resolve time rather than defaulting, because a silent fallback to 120 leaves an acceptance run waiting two minutes per attestation with nothing in the log to explain it. The seam exists because regtest blocks are stamped at roughly now, so without it no mirrored response could bind for 120 real seconds. Also readable from the validator config table under the same key, which takes precedence over the environment.
ATTEST_BATCH_WINDOW_S_OVERRIDE No (unset) Overrides ATTEST_BATCH_WINDOW_S (3600), the length of the window an attestation batch closes on. Same seam and same rules as ATTEST_RESPONSE_FORWARD_S_OVERRIDE above, with one difference: on regtest the value must be a positive whole number of seconds, because a window of zero is not a faster cadence but a division by zero in the alignment arithmetic, and a bad spelling throws at resolve time rather than defaulting. Honoured on regtest only; elsewhere a differing value is ignored with a warning latched once per process, since the window bounds are part of the batch key and of the signed batch canonical, so a hub running its own cadence proposes batches no peer can co-sign. Also readable from the validator config table under the same key, which takes precedence over the environment.

Hub-DB WebSocket (GET /hub-db/subscribe)

Caps on the live-update channel indexers subscribe to. See API.

Variable Required Default Description
WS_MAX_SUBSCRIBERS No 1000 Maximum simultaneous subscribers across all IPs
WS_MAX_PER_IP No 100 Maximum simultaneous subscribers from a single IP
WS_BACKPRESSURE_LIMIT No 50 Buffered messages a slow subscriber may accumulate before its connection is dropped
WS_WATERMARK_INTERVAL_MS No 10000 Interval between watermark heartbeats, which let a subscriber tell “the mirror is behind” apart from “no rows are being produced”
WS_WATERMARK_LATE_FACTOR No 2 Multiple of WS_WATERMARK_INTERVAL_MS after which a heartbeat gap counts as late and is logged; getWatermarkStats() exposes the tally on /health. A value below 1 would mark an exactly-on-time tick late, so anything under 1 falls back to the default rather than raising permanent false alarms
XDEX_ROUND_TIMEOUT_MS No 120000 The single-round timeout of the cross-chain consensus rail (matches, calls, bridge transfers and policy snapshots), in milliseconds. The admission watermark reads it to size that rail’s default terminal bound. A zero, negative or non-numeric value falls back to the default.
XDEX_ROUND_MAX_LIFETIME_MS No 4 × XDEX_ROUND_TIMEOUT_MS The terminal bound of a cross-chain round, in milliseconds. A view change re-arms the single-round timeout on a round that is still open, so the watermark trails by this lifetime rather than by one timeout. Widen it together with the rail’s rounds.
ADMISSION_ORACLE_INGEST_WINDOW_MS No 600000 How far the hub’s ingest of on-chain PRICE v1 rows may trail the chain it reads before the admission watermark stops waiting for it, in milliseconds. The oracle price table has no consensus round, so this is its only bound.
HUB_ADMISSION_RELAY No (unset) Set to 1 or true on a relay hub that serves a mirrored copy of another hub’s database. A relay observes no rounds, so it claims no admission height of its own: it republishes its upstream’s entry verbatim or none, and its indexers defer fail-closed.
ADMISSION_WATERMARK_SAMPLE_MS No 30000 How often the hub samples the admission height watermark it publishes on these frames, in milliseconds. Sampling starts only once a hub source is attached.

Indexer tip freshness

The hub reads the BTC chain tip to anchor consensus rounds. These gates stop a stale tip from locking an out-of-date validator set into a round.

Variable Required Default Description
BTC_INDEXER_URL No (from config table) BTC indexer JSON-RPC URL used by the full-node challenge round.
BTC_INDEXER_API_KEY No (from config table) API key presented to that indexer’s fail-closed federation-read gate. Treat as a credential.
BTC_INDEXER_API_URL No None BTC indexer JSON-RPC URL for the validator-mode price oracle’s block-height anchor (getlatestblock). Set it when the hub is not co-located with a BTC indexer and must reach one over the network. Empty falls back to local resolution. xchain-node forwards this from the host environment.
MAX_INDEXER_LAG_BLOCKS No 200 Maximum blocks the BTC indexer may lag before its tip is treated as untrustworthy and ignored, degrading gracefully instead of locking in a stale validator set.
MAX_TIP_AGE_S No 2 × ORACLE_ROUND_INTERVAL (seconds) Maximum age of the indexer-pushed BTC tip before it is considered stale. Rejecting it costs one HTTP call: the hub falls through to a direct getlatestblock.
MAX_DIRECT_TIP_AGE_S No 7200 (seconds) Age at which the hub stops trusting a direct getlatestblock height that has not advanced past the pushed tip just rejected, and reports no BTC tip at all. Separate from MAX_TIP_AGE_S on purpose: this gate is terminal, so its bound is sized so an ordinary long block gap on a healthy chain never trips it. A height that beats the pushed tip is always accepted, whatever the tip’s age.
ADMISSION_TIP_MAX_AGE_S No 6 × the chain's block interval (seconds) How long a chain’s decoder tip may stay at one height before the hub treats it as stalled when resolving an admission height. The default is a block count, so it scales with each chain: about an hour on BTC, 15 minutes on LTC and 6 minutes on DOGE. A zero, negative or non-numeric value uses the default.
INDEXER_COIN_CHECK No enabled Set to 0 to disable the per-coin indexer reachability check.

Oracle

Variable Required Default Description
ORACLE_ROUND_INTERVAL No 600000 Milliseconds between oracle rounds (default: 10 minutes)
ORACLE_EPOCH_START Yes (validator mode on an unpinned network) None Unix-ms timestamp anchoring oracle round numbering. On testnet the epoch is pinned in the hub code (ORACLE_EPOCH_START_PINS): the hub always uses the pin, a validator boots with the variable unset, and a value that differs from the pin is ignored with a warning at boot. Mainnet has no pin yet and regtest always reads the variable, so there it is required when P2P_VALIDATOR_ADDR is set, and the hub calls process.exit(1) at boot when it is unset or empty. A standalone hub may leave it unset. The hub reads it with parseInt, so a fractional value is truncated to whole milliseconds. It must be identical across all hubs in the federation.
ORACLE_SUBMISSION_WINDOW No 180000 Milliseconds to collect validator price submissions (default: 3 minutes)
ORACLE_FINALIZATION_TIMEOUT No 120000 Timeout for oracle PBFT finalization round (default: 2 minutes)
ORACLE_CLAMP_RESEED_MS No 60000 Milliseconds between re-seeds of the last-finalized clamp reference (default: 1 minute). Cadence only, and deliberately NOT federation-uniform: it decides how promptly a hub catches up to finalized rows it already holds, never what any hub clamps to, so it needs no flag day. A longer interval degrades toward clamping against a stale reference; a shorter one costs one indexed query per pass.
ORACLE_MIN_SUBMISSIONS No 2 Minimum distinct-validator price submissions required before a round can be finalized. Consensus-critical: a single-hub or regtest deployment stalls every oracle round unless this is set to 1, because the default of 2 requires a second submitter that will never arrive.
ORACLE_MAX_SUBMISSIONS_PER_ROUND No 200 Cap on the number of price submissions accepted per round. Submissions beyond this limit are discarded to bound memory and consensus payload size.
ORACLE_STALENESS_THRESHOLD_S No 2 x ORACLE_ROUND_INTERVAL Seconds since the last finalized price snapshot before the GET /health endpoint reports oracle_stale: true (and returns HTTP 503). Defaults to twice the round interval; override for slow-start or custom round cadences.
ORACLE_EARLY_MSG_MAX_ROUNDS No 256 Cap on the number of distinct future consensus rounds the oracle buffers early messages for. Bounds memory against a peer flooding fabricated round numbers; messages for rounds beyond the cap are dropped.
COINGECKO_API_KEY No None CoinGecko API key (optional, improves rate limits)
COINMARKETCAP_API_KEY No None CoinMarketCap API key (enables a fourth price source; CoinGecko, Kraken and Coinbase are all keyless and always active)
PRICE_FETCH_TIMEOUT No 10000 HTTP timeout for external price API calls (ms)
ORACLE_LEADER_TIMEOUT_MS No 30000 How long a round waits on its leader before failover. Kept below the finalization window.
ORACLE_FINALIZED_MAX No 10000 Cap on retained finalized-round records held in memory.
ORACLE_SUBMISSIONS_RETENTION_ROUNDS No (unset) Number of past rounds of raw price submissions to retain. Unset keeps the built-in retention.
ATTESTATION_POLL_MS No 15000 How often a validator hub polls its indexer for new attestation requests, in milliseconds.
ATTESTATION_ROUND_TIMEOUT_MS No 120000 How long an attestation round may run before it is abandoned, in milliseconds. A round that times out leaves the request for a later round rather than failing it. Coupled, so retune it deliberately: the request-seen window is sized to stay outside a live round, and both the round and the consensus engine read this one value. Raising it without that in mind lets a second window re-open a request whose round is still pending, which pays a provider a second time for the same fetch.
ATTESTATION_FETCH_TIMEOUT No 20000 Budget in milliseconds for one external provider fetch, and the same budget the judge_model strategy gives its judge call, so both legs of a round agree on how long a slow vendor is allowed to be. Raised from 10000 by operator ruling: a healthy-but-slow provider that crossed 10 s was aborted, leaving the round with fewer independent bodies than its redundancy asked for, which byte_equality scores as a no_quorum rather than as a slow vendor. Keep it well under ATTESTATION_ROUND_TIMEOUT_MS, which stays the terminal backstop. A zero, a negative or a non-numeric value warns and falls back to the default.
ATTESTATION_PROPOSER_SEEN_MAX No 10000 Cap on the in-memory record of which validators have proposed for a given attestation request. This outlives a single round’s own state, since a round that times out is torn down while the request itself lives on across retries, so leader rotation still needs to know who already spoke for it. Ring-bounded FIFO eviction, so a flood of distinct request ids cannot grow it without bound.
ATTESTATION_ROUND_TTL_MS No 3600000 (1 h) Time-to-live for in-memory attestation round entries before lazy eviction.
ATTESTATION_TORNDOWN_MAX No 10000 Cap on the ring of request ids whose round was torn down, whose late envelopes are dropped instead of buffered. FIFO eviction, so request id flooding cannot grow it without bound.
ORACLE_PUBLISHED_ROUNDS_RETENTION_ROUNDS No 12960 Number of recent rounds of published-round markers to keep, roughly 90 days at the default round interval. Set to 0 to disable pruning and keep every marker. Only confirmed markers are ever pruned: a marker for a round whose on-chain state is still unknown is a quarantine record an operator reconciles by hand, so those are always retained.
ORACLE_ALLOW_UNVERIFIED_PAIRS Regtest only false Set to true to co-sign a proposed pair this hub can verify against nothing (no live local aggregate and no finalized history). It stands down a Byzantine-leader defense, so it is honored only on regtest: on mainnet, testnet, and a standalone hub with no HUB_NETWORK, it is ignored (and logged) and unverifiable-pair co-sign stays fail-closed. A real federation always has a second fetcher, so the hatch has no legitimate use there.
ORACLE_MAX_PRICE_AGE_SECONDS Regtest only (coin registry, per pair) Maximum age of an oracle price before it is treated as stale. Resolution order is p2pConfig → this variable → the per-pair value pinned in the coin registry. The bound is consensus-pinned: it is content-hashed into CONSENSUS_CONFIG_PIN, and the indexer reads only the pinned bundle with no override path of its own. So the override is honored only on regtest; on mainnet, testnet, and standalone it is ignored (and logged) in favour of the pinned bound. Honoring it elsewhere would detach this hub’s fee quotes, and the oracleMaxPriceAgeSeconds it reports over getoraclesubmissions, from the bound they claim to mirror: quoting rounds the fleet’s fee gate rejects, or refusing rounds it accepts. To change the staleness gate for real, change the pinned coin bundle.
ORACLE_ROUND_ABANDON_GRACE_MS No 15000 Extra slack, on top of a round’s own timer ladder (ORACLE_LEADER_TIMEOUT_MS + a fixed fallback grace + ORACLE_FINALIZATION_TIMEOUT), before this hub’s round-abandonment watchdog gives up on a round it opened and never saw finalized. When the watchdog fires, the hub records a locally-skipped row for that round so its own absence of a snapshot is a stated fact rather than a silent hole, which is what lets hub-to-hub round-presence comparison (getoracleroundpresence) tell “the whole federation lost this round” apart from “only this hub never saw it”. Raising it gives a round already running late more time before it is written off; it never widens the ladder those other timeouts define.

Oracle Publishing

Controls OraclePublisher, which broadcasts finalized price rounds on-chain as DOGE PRICE actions.

Variable Required Default Description
ORACLE_PUBLISH_ENABLED No true Set to false to stop this hub publishing oracle rounds on-chain. Consensus participation is unaffected.
ORACLE_PUBLISH_FAILOVER_WINDOW_BLOCKS No 0 How many blocks a hub waits before re-assembling a publishing window its leader left dark. A hub publishes only the windows it leads, so without this a window whose leader never broadcasts stays unpublished forever; followers take over in rank order, one at a time rather than all at once. 0 disables takeover, which is the default because taking over spends DOGE on a window a peer may already have paid for. Arm it per deployment once the observation feed is known to be working.
ORACLE_PUBLISH_BLOCK_MS No 600000 Approximate block time in milliseconds, used only to convert ORACLE_PUBLISH_FAILOVER_WINDOW_BLOCKS into a takeover timer. The default is the Bitcoin ten-minute target; set it lower on a faster chain, or the takeover wait is longer than intended. Values that are not a positive number fall back to the default.
ORACLE_TAKEOVER_AMBIGUOUS_COOLDOWN_MS No ORACLE_PUBLISH_FAILOVER_WINDOW_BLOCKS × ORACLE_PUBLISH_BLOCK_MS How long a follower holds off taking over a window when something says a batch for it may already be on the wire, but unmined. A hub can only see batches that have been mined, so a leader whose transaction is stuck in the mempool looks the same as a leader that never sent, and stepping in pays the DOGE fee twice. The wait starts either from the co-signature this hub gave that window’s leader or from an ambiguous broadcast of its own; once it passes with the window still absent from the chain, the earlier transaction never landed and the takeover goes ahead. 0 removes the wait. Only meaningful when takeover is armed.
ORACLE_PUBLISH_CONFIRM_CHECK_MS No 300000 How often the publisher checks that the transactions it broadcast actually confirmed. Recording a transaction id proves only that it was sent, so without this a batch that never mines leaves the hub reporting a healthy last publication forever. Results appear in getoraclepublisherstatus. 0 disables the check.
ORACLE_PUBLISH_CONFIRM_STALE_MS No 1800000 How long a published transaction may stay unconfirmed before it is logged as stale. Detection only: nothing is re-broadcast and no fee is bumped, because a transaction still sitting in a mempool may yet confirm and re-sending would pay twice for the same rounds.
ORACLE_PUBLISH_ALLOW_UNCONFIRMED_INPUTS No false Whether a published batch may be funded from this hub’s own unconfirmed change. Off by default: miners judge a transaction by its whole ancestor package, so one cheap early transaction holds down every batch chained behind it, however much the newest one pays. Leaving it off means a hub with no confirmed output defers the window instead, which is recoverable. Turn it on only for a venue that mines on demand, such as regtest, where waiting for a confirmation would stall the harness.
ORACLE_PUBLISH_SELF_CHAIN_MAX_DEPTH No 4 How many wires one publish pass may chain onto its own change. A catch-up sweep broadcasts several wires within one second, and each spends a confirmed output and leaves its change unconfirmed, so the wires past the address’s confirmed-output count would otherwise see only dust and fail to build. Within a single pass a wire may therefore spend the change of a wire that same pass broadcast, which is the one exception to the setting above; the count bounds how far that may chain. Only this pass’s own transactions qualify, so a third party’s unconfirmed payment stays unspendable, and a later pass still defers entirely when no confirmed output is available.
ORACLE_BATCH_WINDOW_ROUNDS No 6 How many finalized rounds one published action carries. A round does not ride its own transaction: it is buffered, and the whole window leaves together under a single quorum signature set. Hubs configured differently elect different leaders and may publish overlapping windows, which is harmless (ingest is idempotent) but wasteful, so keep this equal across a federation.
ORACLE_BATCH_LANDING_RESERVE_MS No 300000 Estimated time from a window closing to its published batch being readable on-chain: assembly, the co-signing round, broadcast, and one DOGE confirmation plus indexing. Measured at roughly 180s on public testnet; the default is that with headroom. Subtracted, together with ORACLE_BATCH_GRACE_MS, from the fee-price staleness bound when deriving the largest ORACLE_BATCH_WINDOW_ROUNDS that still keeps the freshest priced snapshot inside that bound; raising it shrinks the derived window ceiling.
ORACLE_BATCH_GRACE_MS No 300000 How long after a window closes the elected leader waits before assembling it, giving late-finalizing peers time to agree on its contents. Armed once per window and never extended, so a trickle of stragglers cannot postpone a window indefinitely.
ORACLE_BATCH_SIGN_TIMEOUT_MS No 60000 How long the leader waits for a signing quorum on an assembled window. No quorum means no publication for that window: it stays buffered and a later leader can propose it again. One name, two rails, two defaults: here OracleBatchSigner reads it from the validator config table only and defaults to 60000, while the attestation batch rail reads the same name from the environment first and defaults to 15000 (see Attestation Publishing below). Setting it in the environment therefore moves the attestation rail and leaves this one unchanged.
ORACLE_BATCH_BUFFER_MAX_ROUNDS No 4032 Upper bound on buffered rounds, so a hub that never leads a window cannot grow its buffer without limit. Reached only if publication has been failing for a long time; the oldest rounds are dropped first.
HUB_PRICE_CAPABILITY_DERIVE No on Whether a hub derives capability snapshots from its own Bitcoin view for each of the four capabilities whose consensus writer does not run locally: price, oracle_publish, cross_chain, and attestation. Each unit of derivation is one capability-and-height pair. Without these snapshots, the indexer cannot resolve the signer set for the affected on-chain actions. Set to off to disable all derived pairs, which is logged loudly. A hub skips each capability covered by a local consensus writer and disarms the pass only when local writers cover all four.
HUB_PRICE_CAPABILITY_DERIVE_LOOKBACK_BLOCKS No 144 How many Bitcoin heights back the derivation pass covers, newest first, for each capability it must derive. The default is about a day and can represent up to 576 capability-and-height pairs when all four capabilities need derivation. A node following the tip needs no more; a node catching up across a longer gap needs this raised, at a cost of one Bitcoin indexer call per uncovered pair.
HUB_PRICE_CAPABILITY_DERIVE_INTERVAL_S No 60 Seconds between derivation passes. With the default per-pass budget, each pass covers at most 64 uncovered capability-and-height pairs, finishing all required capabilities at a newer height before moving backward, and skips pairs already written.
PUBLISHER_QUEUE_PATH No ./data/publisher-queue.jsonl Durable queue file for pending publishes. Point at persistent storage so a restart does not lose queued rows.
PUBLISHER_MAX_ATTEMPTS No 5 Attempts before a queued publish is abandoned.
DOGE_ADDRESS No (from config table) Dogecoin address the hub publishes from.
DOGE_PUBKEY_HEX No (from config table) Public key, hex, of the DOGE publishing wallet.

| DOGE_ENCODER_URL | No | (from config table) | Encoder URL used to build DOGE publish transactions. | | DOGE_ENCODER_API_KEY | No | (from config table) | API key presented to that encoder when it runs keyed. Treat as a credential. | | DOGE_LOW_BALANCE_THRESHOLD | No | 10 | DOGE balance below which the publisher warns that it is running out of funds. | | ORACLE_BATCH_CATCHUP_INTERVAL_MS | No | 3600000 (1 hour) | How often a recurring sweep re-proposes closed batch windows that are still buffered and unpublished (a signing round that failed to reach quorum, for example). Deliberately slow: the refusal it recovers from is either a peer being down or content drift that the leader repairs from price_snapshots before re-proposing, and a faster retry would only add a signing round per window per interval across the federation without fixing either cause sooner. | | ORACLE_BATCH_CATCHUP_BACKLOG_INTERVAL_MS | No | 60000 (1 minute) | The catch-up sweep cadence while a backlog exists, used instead of ORACLE_BATCH_CATCHUP_INTERVAL_MS whenever more than four closed windows are still buffered. A sweep proposes at most four windows, so at the hourly idle cadence a backlog of several hundred windows could never drain; at a minute the same backlog is walked in a few hours. Capped at ORACLE_BATCH_CATCHUP_INTERVAL_MS, so it can only make the sweep faster, never slower. | | ORACLE_BATCH_CATCHUP_MAX_ATTEMPTS | No | 6 | Failed catch-up proposals after which a window is retired from the sweep, provided it is also old enough (see ORACLE_BATCH_CATCHUP_RETIRE_AFTER_MS). Retirement is a memo entry, not a deletion: the buffered rounds stay where they are and every other bound behaves as before; the window simply stops consuming a re-proposal slot that the windows behind it need. 0 disables retirement, so every window is re-proposed forever, for an operator who would rather a stuck backlog stay visible than be retired quietly. | | ORACLE_BATCH_CATCHUP_RETIRE_AFTER_MS | No | 21600000 (6 hours) | Minimum age of a window’s FIRST failed catch-up attempt before the attempt count may retire it. Both bounds are needed: a count alone would retire a window that lost six attempts in six minutes to one peer rebooting, and an age alone would retire a window that has only been waiting its turn behind a long backlog. Together they describe the one hopeless shape, a window this hub has proposed repeatedly over hours that the federation will not co-sign because its contents diverge. |

Encoder HTTP budget. The hub’s per-call budget to the encoder is fixed at 120000 ms (EncoderClient) and is not an env knob. It must stay strictly greater than the encoder’s own NODE_RPC_TIMEOUT (default 30000 ms) times the longest sequential node-RPC chain one broadcast_tx can run, which is three hops. Raising NODE_RPC_TIMEOUT above 40000 ms on the encoder re-inverts that relationship, and the hub then aborts calls the encoder would have answered. A client-side abort is indistinguishable from a broadcast that may already have reached the coin node, so those rounds are dead-lettered for manual on-chain verification rather than retried.

Rewards and Slashing

SLASH_DEVIATION_THRESHOLD and SLASH_MISSED_ROUNDS_THRESHOLD are both env-owned controls. For either variable, the hub refuses a governance proposal that attempts to change its value.

Variable Required Default Description
ORACLE_REWARD_PER_ROUND No "10.00000000" XCHAIN budget the hub splits equally among the validators that submitted a price in a finalized round, for its own local validator_rewards ledger only. It is not pushed to the indexer and does not change what the chain credits
SLASH_DEVIATION_THRESHOLD No "0.05" Price deviation (5%) at which the hub records a price_deviation offense. SLASH_DEVIATION_THRESHOLD is env-owned; the hub refuses any governance proposal that attempts to change it. Hub-local: governance can suspend the validator, on-chain stake is untouched
SLASH_MISSED_ROUNDS_THRESHOLD No "30" Missed rounds at which the hub records a non_participation offense. SLASH_MISSED_ROUNDS_THRESHOLD is env-owned; the hub refuses any governance proposal that attempts to change it. Hub-local: governance can set validators.status='suspended', on-chain stake is untouched. Only a permissionless SLASH proof of equivocation burns stake (see Decentralization)

ANCHOR Publishing

Controls StateAnchorPublisher (commits checkpoints and the cross-chain match archive on-chain via the DOGE ANCHOR action) and RewardTracker (hub-local ledger of anchor-publish rewards; the chain credits the frozen amounts from the ANCHOR bytes, not this ledger).

Variable Required Default Description
ANCHOR_INTERVAL_MS No 86400000 Milliseconds between ANCHOR publish cycles (default: 24 hours)
ANCHOR_MATCH_BATCH_SIZE No 200 Maximum cross_chain_matches rows to include per ANCHOR archive chunk
ANCHOR_CHUNK_RETRY_MS No 2500 Delay before retrying a failed archive chunk upload (ms)
ANCHOR_ELECTION_TOLERANCE_BLOCKS No 36 BTC blocks a non-leader hub waits before the next eligible rank may take over
ANCHOR_REWARD_PER_PUBLISH No "10.00000000" XCHAIN distributed to the elected ANCHOR publisher per successful publish cycle
ANCHOR_CHECKPOINT_EVERY_N No 1 Anchor only every Nth checkpoint ordinal on-chain, gating the whole round (one bundle covers every chain). Eligibility is FLOOR(checkpoint_seq / CHECKPOINT_INTERVAL_BLOCKS) % N, not checkpoint_seq % N: the cadence latch advances the seq by exactly one interval per round, so a raw-seq test is a residue class pinned by the seed rather than a 1-in-N sample, and for any N sharing a factor with the interval the federation would anchor every round or never anchor at all. Both this and CHECKPOINT_INTERVAL_BLOCKS must be fleet-uniform, and the hub enforces it: an override is honoured on regtest only, and on mainnet, testnet and a standalone hub a set value is ignored with a warning and the hub uses 1. Retuning it on a live network is a coordinated code change, never a local setting. checkpoint_seq is consensus data, so the predicate is deterministic across every hub. On regtest it decouples on-chain ANCHOR spend from checkpoint production cadence, it is not a cadence control (ANCHOR_INTERVAL_MS is): skipped (off-multiple) ordinals remain in the off-chain hub-DB mirror and are still verifiable via the explorer. 1 anchors every checkpoint (original behaviour).
XCHAIN_HUB_SKIP_ANCHOR_CADENCE_ASSERT No (unset) Set to 1 to silence the regtest warning logged when CHECKPOINT_INTERVAL_BLOCKS or ANCHOR_CHECKPOINT_EVERY_N differs from the fleet-canonical values (6 and 1). It never lifts the pin: on mainnet, testnet and a standalone hub both knobs always use 6 and 1. Log-only, never fatal.
ANCHOR_ENABLED No true Set to false to stop this hub publishing ANCHORs.
ANCHOR_MAX_BATCH No 1000 Maximum cross_chain_matches rows drained into one publish cycle.
ANCHOR_CHUNK_MAX_BYTES No 6000 Maximum payload bytes per ANCHOR archive chunk.
ANCHOR_ROUND_TIMEOUT_MS No 120000 Timeout for one ANCHOR signing round.
ANCHOR_RATELIMIT_MAX_WAIT_MS No 60000 Caps a single honoured Retry-After wait when the encoder rate-limits an anchor chunk upload.
ANCHOR_RATELIMIT_MAX_WAITS No 3 Caps how many rate-limit waits one broadcast may take before the anchor defers to a later flush instead of stalling the current one.
ANCHOR_AMBIGUOUS_POLL_ATTEMPTS No 3 Re-polls before an ambiguous publish result (broadcast may or may not have landed) is resolved.
ANCHOR_AMBIGUOUS_POLL_MS No 5000 Delay between those re-polls.
ANCHOR_DEADLETTER_PATH No ./data/anchor-publish.deadletter.jsonl Append-only JSONL record of an ANCHOR send that failed after the signer hook committed funds, holding the signed reveal an operator rebroadcasts instead of paying for the payload again; an unset or empty value uses the default.
ANCHOR_ANNOUNCE_RETRY_MS No 300000 Delay between retries of the anchor announcement (5 minutes). Peers stamp anchor_txid once the anchor is buried XCHAIN_CONFIRMATIONS_DOGE deep; that knob governs only the hub’s stamp and attest gate. The BTC indexer’s anchor-reward mint gate applies a frozen ledger depth (ANCHOR_REWARD_DOGE_MIN_CONFIRMATIONS, equal to the per-coin DOGE default) that no environment variable moves, so on regtest, where a lowered override is honoured, the hub attests before the indexer will mint and BTC block processing defers until the anchor reaches the frozen depth.
ANCHOR_ANNOUNCE_RETRY_TTL_MS No 21600000 How long announcement retries continue before the entry is dropped (6 hours, roughly six times the 60-confirmation DOGE window).
ANCHOR_ANNOUNCE_QUEUE_MAX No 500 Maximum queued anchor announcements, bounding memory.
ANCHOR_ARCHIVE_NEXT_SEQ_OVERRIDE No (unset) Regtest drill lever: a whole number that every ANCHOR v1 archive draw on this hub returns as the next batch seq, ahead of the row-derived seq, the federation floor and the redraw above this hub’s own spent seqs, so a drill can lead a head under a seq the hub already spent. Every hub that should co-sign must carry the same value, and every round keeps reusing it until it is unset. Honoured on regtest only: set on mainnet, testnet or a standalone hub, the hub refuses to start with ArchiveNextSeqOverrideNetworkError, and a value that is not a whole number refuses with ArchiveNextSeqOverrideValueError.
ANCHOR_RANK_WAKE_MS No 900000 How often a non-rank-0 publisher wakes to check whether the anchor it is ranked behind was published (15 minutes). Only rank-0 keeps the interval and size triggers, so this is the takeover cadence, not the publish cadence.
ANCHOR_INTENT_TTL_MS No 21600000 How long a recorded anchor spend intent is held before it is dropped and the send re-broadcast (6 hours, the same reasoning as ANCHOR_ANNOUNCE_RETRY_TTL_MS: past roughly six times the 60-confirmation DOGE window, a send that never relayed is not coming back).
ANCHOR_STARTUP_FLUSH_MS No 60000 Delay after start before the hub runs its one leader flush. The interval timer does not fire until a full ANCHOR_INTERVAL_MS after start, so without this a hub restarted more often than once per interval would never anchor. Safe across a rolling restart. 0 disables it.
ANCHOR_PUBLISH_ALLOW_UNCONFIRMED_INPUTS No false Whether an anchor may be funded from this wallet’s own unconfirmed change. Off by default so every anchor stands on its own fee rate: Dogecoin miners score a transaction on its own rate, not its ancestors, so a well-paid child never lifts a stuck parent. A flush with no confirmed output stands down and the next rank wake retries it. Archive chunks always spend their head’s change by design. Turn it on only on a test venue that mines on demand.
ANCHOR_CONFIRM_CHECK_MS No 300000 How often the watchdog re-reads the publisher wallet to see which of this hub’s own anchor broadcasts have mined (5 minutes). 0 disables it.
ANCHOR_CONFIRM_STALE_MS No 1800000 Age at which a still-unconfirmed anchor broadcast starts being logged as stale on every watchdog pass (30 minutes). Nothing is re-broadcast or fee-bumped.
ANCHOR_MARKER_RETENTION_MS No 7776000000 How long a confirmed anchor broadcast marker is kept in anchor_published_checkpoints and anchor_published_archives before it is swept, roughly 90 days. Set to 0 to disable pruning and keep every marker. Only confirmed markers are ever deleted: an intent-only row is the ambiguous-send record, the sole durable trace that DOGE may already have paid, and it is kept regardless of age. The cutoff is floored at a multiple of ANCHOR_INTENT_TTL_MS, so a shorter window here can never reach a marker still inside its hold window.

Why those magnitudes (before you retune them)

None of the ANCHOR knobs is consensus data: hubs on different values still produce mutually verifiable anchors. Three of them do encode a real bound, and the full derivation is in ANCHOR.md:

  • ANCHOR_CHUNK_MAX_BYTES = 6000 reserves head room under the protocol’s 8192-byte MAX_ACTION_DATA_LENGTH ceiling, because chunk 0 shares its action with the checkpoint prefix (~322 bytes) and the signature lists (194 bytes per (PUBKEY, SIG) pair; a v1 head always carries the publisher tail, another 194 bytes per attesting signer). What is left is about nine signature pairs on a v1 with no attestations, or 4+4 at full quorum, so lower this as the federation grows: a 5+5 v1 quorum needs ~5860 or less, a 7+7 quorum ~5080. Exceeding the ceiling is silent, since the decoder simply drops the action.
  • ANCHOR_MATCH_BATCH_SIZE = 200 is an early-flush latency trigger and ANCHOR_MAX_BATCH = 1000 is the per-cycle DOGE spend bound. Archive rows are signature-dominated and barely compress (~0.55 KB of gzip+base64 per settled match), so 1000 rows is ~550 KB, ~93 chunks, ~93 DOGE transactions in a cycle; 200 rows is ~19.
  • ANCHOR_ELECTION_TOLERANCE_BLOCKS = 36 is ~6 hours of BTC blocks per failover rank, counted in blocks rather than wall clock so every hub agrees on the unlock without clock sync. The ordering carries the meaning: signing round (120s) + DOGE burial (60 confs, ~1h) << 36 blocks (~6h) << ANCHOR_INTERVAL_MS (24h). Roughly 6 to 144 blocks keeps both bounds; a wrong value costs duplicate DOGE spend or delayed anchoring, never a divergence.

Attestation Publishing

Controls AttestationPublisher, which writes the validator network’s answers to contract attestation requests back on-chain.

Variable Required Default Description
ATTEST_ENABLED No true Set to false to stop this hub publishing attestation results.
ATTESTATION_QUEUE_PATH No ./data/attestation-queue.jsonl Durable queue file for pending attestation publishes. Point at persistent storage.
ATTESTATION_FAILOVER_WINDOW_BLOCKS No 2 Blocks of leader silence before the rank-1 hub steps in.
ATTESTATION_FAILOVER_POLL_MS No 30000 Failover sweep cadence.
ATTESTATION_LEADER_RETRY_MS No 60000 Grace period before the sweep retries a leader’s entry.
ATTESTATION_BLOCK_MS No 600000 Nominal block interval used to translate the failover window from blocks into time. Defaults to the BTC ~10 minute interval.
ATTESTATION_AMBIGUOUS_COOLDOWN_MS No ATTESTATION_FAILOVER_WINDOW_BLOCKS × ATTESTATION_BLOCK_MS Cooldown after an ambiguous publish result before another hub may retry.
ATTEST_PUBLISHED_REQUESTS_RETENTION_MS No 7776000000 How long a confirmed publish marker is kept in attest_published_requests before it is swept, roughly 90 days. Set to 0 to disable pruning and keep every marker. Only confirmed markers are ever deleted: an intent-only row is the quarantine record for a request whose on-chain state is unknown, which an operator reconciles by hand, so those are kept regardless of age. The window is also floored at the longest live provider deadline_window_blocks and never touches a request still on the durable queue file.
BTC_ADDRESS No (from config table) BTC address of this hub’s publishing wallet.
ATTEST_BATCH_PUBLISH_ENABLED No true Set to false to stop this hub publishing attestation batches on-chain, halting the outbound DOGE spend during an incident without tearing the pipeline’s configuration down. Consensus participation is unaffected. A halted publisher skips each window rather than buffering it, so re-enabling does not flood the rail with a backlog. Read from the environment first, then the validator config table under the same key.
ATTEST_BATCH_BUFFER_PATH No ./data/attest-batch-buffer.jsonl Durable record of what each attestation batch window was built from at the moment it published, so an operator replaying a dead-lettered or quarantined window has its content instead of reconstructing it from tables that have since moved on. Point at persistent storage. The dead-letter file sits beside it, at the same path with .deadletter.jsonl in place of .jsonl. Belongs to the batch publisher alone and must not be pointed at the price publisher’s buffer. Read from the environment first, then the validator config table under the same key.
ATTEST_BATCH_MAX_REFUSAL_ATTEMPTS No 3 How many times a window whose HEAD wire was refused before it could be sent is rebuilt and re-proposed before it latches like any other broadcast failure. The shapes that qualify prove no transaction left the process: an encoder HTTP 4xx such as insufficient funds or unconfirmed change, or an ECONNREFUSED/ENOTFOUND/EAI_AGAIN that never connected. On those the publish-intent marker is withdrawn and the window is retried with byte-identical content on the next cycle instead of being quarantined for an operator; at the bound it latches once and quarantines as before. A failure on any later wire, and every ambiguous failure, latches immediately and is unaffected by this setting.
ORACLE_BATCH_SIGN_TIMEOUT_MS No 15000 How long the attestation batch leader waits for a signing quorum on an assembled window. Shares its name with the price rail’s setting under Oracle Publishing above, and the two are NOT the same knob in practice: this one is read from the environment first and defaults to 15000, while the price rail reads the validator config table only and defaults to 60000. An operator exporting this variable moves this rail alone.

For each closed window, the batch publisher records an empty window as skipped and publishes nothing. It rechecks skipped windows inside the catch-up horizon so a late response can still produce a batch. Before a sweep publishes any pending windows, it makes one range request to the Dogecoin indexer through getattestbatches and records windows that already have a valid, complete head on-chain as landed; the read fails open if the indexer is unavailable or does not support the method. Publisher stats expose chainReconcileRuns, chainReconcileLandedWindows, and chainReconcileFailures for this path.

Attestation Relay

Controls AttestationRelay, the driver that carries attestation requests to the validator network and the response leg back. Attestation staking lives on Bitcoin, so an ATTEST request made on an origin chain (LTC, DOGE) is relayed to BTC as a v3 request, and the finalized answer is relayed back to the origin chain as a v4 response. The relay therefore needs a broadcast rail on every origin chain it serves, not just on the home chain.

Variable Required Default Description
ATTEST_RELAY_ENABLED No 0 Set to 1 to run the relay. Opt-in rather than a kill switch, deliberately: a fleet that has merely deployed this code must run nothing until an operator turns it on.
ATTEST_RELAY_POLL_MS No 15000 How often the relay sweeps for work.
ATTEST_RELAY_FAILOVER_MS No 1200000 Leader silence tolerated before another hub takes the relay over. Twenty minutes.
ATTEST_RELAY_QUEUE_PATH No ./data/attest-relay-queue.jsonl Durable at-most-once record of v3 broadcasts. Point it at persistent storage: replaying a v3 is rejected on-chain but still burns a real BTC fee, and this file is what stops a restart from doing that.
ATTEST_RELAY_EVICT_GRACE_BLOCKS No 144 How long the relay keeps remembering a request it has already relayed, counted in blocks on the chain the request came from, past that request’s own deadline and on top of that chain’s confirmation depth. Once the origin chain is that far past the deadline the request can never be serviced again, so the relay forgets it and rewrites the queue file without it: this is what stops both the queue file and the in-memory sets from growing for as long as the process runs. Raise it to keep records longer. Lowering it is the risky direction, because forgetting a request the origin chain has not finished expiring yet lets the relay send it a second time and pay a second fee.
BTC_PUBKEY_HEX No (from config table) Public key, hex, of that wallet.
BTC_ENCODER_URL No (from config table) Encoder URL used to build BTC publish transactions.
BTC_ENCODER_API_KEY No (from config table) API key presented to that encoder when it runs keyed. Treat as a credential.
ATTESTATION_HTTP_GET_ALLOW_PRIVATE No (unset, fails closed) Set to 1 to let the http_get attestation provider reach private and loopback addresses. Off by default and security-relevant: the provider normally resolves the hostname once and pins the request to that public address, which is what stops a contract-supplied URL being used for SSRF against the validator’s own network. Enable only on an isolated test venue.

Per-origin-chain broadcast rail

The variables below are read dynamically (process.env[coin + '_ENCODER_URL'] and friends) for each origin chain, so a static scan of the source will not list them; <COIN> is any allowed coin other than BTC, so today LTC and DOGE. Each also resolves from the hub’s p2pConfig; the env var wins.

Leaving an origin chain’s rail unconfigured does not fail loudly. The v4 response is still consensus-finalized and then held forever, behind one startup warning (no <COIN> broadcast rail). Responses are held rather than dropped, so the recovery is to configure the rail and restart, but nothing re-warns in the meantime. Check attest_relay on /health to see the hold: a rising awaiting_broadcast with a flat responses_relayed is this misconfiguration.

Variable Required Default Description
<COIN>_ENCODER_URL If relaying to <COIN> None xchain-encoder endpoint used to build the v4 response transaction on origin chain <COIN> (e.g. LTC_ENCODER_URL). Empty means no rail; see the hold warning above.
<COIN>_ENCODER_API_KEY No None API key for that origin chain’s encoder.
<COIN>_ADDRESS If relaying to <COIN> None Wallet address on <COIN> that pays for and publishes v4 responses (e.g. LTC_ADDRESS).
<COIN>_PUBKEY_HEX If relaying to <COIN> None Public key (hex) for that address.
<COIN>_INDEXER_API_URL If relaying to <COIN> None Indexer endpoint the relay reads <COIN>-origin ATTEST requests from. Also accepted as <COIN>_INDEXER_URL, or pushed via xchain-node updateconfig. A chain with no indexer URL is skipped every tick, with a startup warning.
<COIN>_INDEXER_API_KEY No None API key for that indexer.

The home (BTC) rail reuses the BTC attestation publisher variables above (BTC_ENCODER_URL, BTC_ADDRESS, BTC_PUBKEY_HEX, BTC_INDEXER_API_URL). Origin rails are deliberately kept separate from it: an operator broadcast hook configured for one chain would put an LTC payload on BTC, where it is rejected outright after burning a real BTC fee. Spend limits come from the shared spend guard under the ATTEST prefix (see Effector Spend Policy below), and confirmation depths from XCHAIN_CONFIRMATIONS_<COIN>.

Effector Spend Policy

Every hub effector that spends real coin on-chain runs behind a shared spend guard: a balance floor, a rolling per-window spend ceiling (hard-clamped at a $2000 admission ceiling), and a per-capability runtime pause. The knobs below take a per-effector <PREFIX>; the four prefixes are ORACLE_PUBLISH, ATTEST, ANCHOR, and FULLNODE. Each variable also resolves from p2pConfig; the env var wins. The spend ceiling is default-enabled: unset config yields the $2000 clamp, never “off”.

Variable Required Default Description
<PREFIX>_MAX_SPEND_USD_CENTS_PER_WINDOW No 200000 ($2000) Rolling per-window spend budget in USD cents. Clamped to <= 200000; an operator can only lower it.
<PREFIX>_EST_SPEND_USD_CENTS No 100 ($1) Per-broadcast cost estimate charged against the window budget when the caller does not supply a real fee.
<PREFIX>_MAX_PUBLISHES_PER_WINDOW No 0 (off) Optional per-window broadcast count cap, defense in depth alongside the USD budget. <=0 disables the count cap.
<PREFIX>_SPEND_WINDOW_MS No 3600000 (1h) Rolling window length (ms) for both the count and USD ceilings.
<PREFIX>_MIN_BALANCE No 0 Wallet floor (native coin). A balance below the floor, or an unreadable (null) balance, skips the spend fail-closed.

Runtime pause is operator-driven via JSON-RPC (auth-gated): pauseeffectorspend / resumeeffectorspend take { label } (the effector’s guard label, e.g. OraclePublisher), and geteffectorspendstatus lists every effector’s live state. A pause halts the effector’s primary/leader spend path immediately, with no restart.

State Checkpoints

Controls StateCheckpointEngine, which produces the quorum-signed per-block state-hash checkpoints that light clients and xchain-sync replicas verify against.

Variable Required Default Description
CHECKPOINT_ENABLED No true Set to false to stop this hub participating in checkpoint rounds.
CHECKPOINT_CHAINS No all supported coins Comma-separated list of chains to checkpoint. Entries outside the supported set are dropped.
CHECKPOINT_INTERVAL_BLOCKS No 6 BTC blocks between checkpoints. Fleet-uniform, so an override is honoured on regtest only: on mainnet, testnet and a standalone hub a set value is ignored with a warning and the hub uses 6. Retuning it on a live network is a coordinated code change, never a local setting.
CHECKPOINT_CONFIRMATIONS No 6 Confirmations required before a block is eligible for checkpointing.
CHECKPOINT_POLL_MS No 60000 Interval between checkpoint eligibility polls.
CHECKPOINT_ROUND_TIMEOUT_MS No 60000 Timeout for one checkpoint signing round.
CHECKPOINT_COSIGN_TOLERANCE_BLOCKS No 144 Fail-closed co-sign gate: a SIGN_REQ whose snapshot_block deviates from this hub’s own BTC tip by more than this many blocks is declined. The default is roughly a day of BTC blocks.
CHECKPOINT_STALL_LOG_MS No 3600000 (1 h) Throttle for the “cadence stalled” log line. The eligibility poll runs far more often than the checkpoint cadence, so the reason is logged at most this often and the counter carries the true rate.
CHECKPOINT_FROZEN_TIP_TICKS No 60 Consecutive not-my-slot eligibility ticks that see the same BTC tip before the tick is metered as a cadence stall naming the frozen block. A frozen tip pins the rotation slot to one constant, so every hub whose rank is not that constant returns forever with no stall counted; at the default 60 s poll this is about an hour, longer than any normal inter-block gap. Non-positive values fall back to 60.

Stake-share monitor (StakeShareWatcher)

Watches this operator’s own share of active stake against the STAKE_WEIGHTED_QUORUM commit gate (3*tally > 2*S) and warns while rounds are still finalizing.

The gate counts community stake in its denominator whether or not that stake ever signs, so a federation whose share has drifted to two thirds halts the moment one more staker appears, and the round before gives no warning at all. On 2026-09-01 that cost testnet 18 hours of dead price rounds, found by a tester rather than by a monitor.

Without HUB_OPERATOR_STAKE_SOURCES (or its per-chain form) the hub cannot tell its own stake from anyone else’s and the monitor stays off, saying so loudly at boot. Read the result on /health (stake_share), from the getstakeshare RPC, or from the xchain_stake_share_* gauges. Alert on xchain_stake_share_stakes_to_halt <= 1 or xchain_stake_share_meets_gate == 0; it never flips /health to 503, because it is a forecast about the federation rather than a sickness of this process. These gauges are rebuilt from scratch on every scrape, so an unreadable snapshot renders the affected chain/capability series absent rather than repeating the last healthy number. Both rules above therefore go quiet on a gap: pair them with an absent(xchain_stake_share_meets_gate{...}) clause if a missing measurement should also be visible, and note that the underlying indexer outage is ConsensusInputMonitor’s alarm, deliberately not paged twice here. An unreadable snapshot never raises an alert, but it does not clear one either: a standing CRITICAL, HALTED or BLOCKED reading holds (xchain_stake_share_alerting stays 1, the log says UNCONFIRMED, and /health shows held_level and held_age_s) until a real reading replaces it.

The monitor reads stake through the gate’s own snapshot code, so a read the gate would refuse (a BTC indexer that reports another coin, a capability with no MIN_STAKE and no feed floor, an answer for the wrong block or capability) shows as unavailable with the gate’s reason rather than as a margin.

Variable Required Default Description
HUB_OPERATOR_STAKE_SOURCES_<COIN> No `` Comma-separated staking addresses this operator controls on that chain. Only _BTC is read, because capability staking is BTC-only; _LTC and _DOGE are ignored with one log line at boot.
HUB_OPERATOR_STAKE_SOURCES No `` Fallback list, merged with HUB_OPERATOR_STAKE_SOURCES_BTC.
HUB_STAKE_SHARE_CHAINS No BTC Only BTC is watched, the one chain the stake-weighted gate reads; any other tick is ignored with one log line at boot.
HUB_STAKE_SHARE_CAPABILITIES No price,oracle_publish,archive_publish,attestation,cross_chain,* Stake sets to watch: every one whose rounds pass the same two-thirds weighted gate. price is the price round’s commit quorum, oracle_publish the publisher election that puts the result on chain, archive_publish the set the archive leg signs on (the oracle_publish set minus rollcall-absent sources once that presence gate is armed, the same set before), attestation the attestation rounds and their publisher, cross_chain DEX, call and bridge settlement, retraction and the state-anchor archive, and * the whole-federation set (every staker, no capability filter) that config-change consensus tallies. A capability this operator has not staked for reads as unconfigured (not alerting); one nobody has staked for reads as blocked (alerting), because its weighted gate fails closed on an empty set. Narrow the list here for a rail this federation does not run.
HUB_STAKE_SHARE_POLL_MS No 300000 Poll cadence. Stake moves at block cadence and the warning has hours of lead time.
HUB_STAKE_SHARE_CRITICAL_STAKES No 1 Margin, in new stakes, that counts as CRITICAL (alerting). 1 means “the next community staker halts rounds”. One stake is sized as the largest third-party stake already on that chain, floored at the capability MIN_STAKE.
HUB_STAKE_SHARE_WARN_STAKES No 2 Margin, in new stakes, that counts as WARNING (logged, not alerting).

Roll Call

Controls RollcallRound, which signs the per-epoch ledger-hash roll call and elects the hub that publishes it on DOGE. Epoch cadence and the accept window are consensus constants and are not configurable; these knobs cover only this hub’s own timing, participation and rails.

Variable Required Default Description
ROLLCALL_ENABLED No true Set to false to stop this hub signing roll calls and standing for publisher election.
ROLLCALL_POLL_MS No 30000 Interval between roll-call epoch polls.
DOGE_INDEXER_URL No (from config table) DOGE indexer JSON-RPC URL the round reads to learn what is already on chain for the epoch. DOGE_INDEXER_API_URL takes precedence when both are set.
DOGE_INDEXER_API_KEY No (from config table) API key presented to that DOGE indexer. Treat as a credential.
ROLLCALL_SPEND_LOG_PATH No ./data/rollcall-publish.spend.jsonl JSONL spend audit for the fee-bearing publish. The intent line is written and fsynced BEFORE the DOGE moves and the broadcast is gated on it, so a crash mid-flight still leaves a trace that DOGE may have been spent.
ROLLCALL_SIGN_LOG_PATH No ./data/rollcall-signatures.jsonl Durable store of the signatures this hub has emitted. A restart inside the accept window re-emits the same signature for an epoch rather than minting a second one.
ROLLCALL_PUBLISH_DELAY_BLOCKS No 12 (regtest 1) Blocks after the accept window closes before the elected publisher broadcasts, so late gossiped signatures still make the published set. Non-numeric values fall back to the default rather than disabling the gate.
ROLLCALL_ELECTION_TOLERANCE_BLOCKS No 36 (regtest 3) Blocks the elected publisher is given before the next hub in the election ladder may take over. Separate from ANCHOR_ELECTION_TOLERANCE_BLOCKS on purpose: the two ladders climb against different anchors.
ROLLCALL_SELF_PUBLISH_BLOCKS No 100 (regtest 9) Blocks after which any hub still holding an unpublished epoch publishes it itself, whatever the ladder says.

Without DOGE_INDEXER_URL / DOGE_INDEXER_API_URL this hub cannot tell a signature it holds from one already on chain, so it publishes nothing and logs nothing. That failure is silent: the round leader still sees this hub’s own oracle submissions arrive, but no roll call ever lands with this hub’s pair in it, and a validator left in that state for two consecutive rolled epochs is evicted. A validator with no Dogecoin indexer of its own points these at the public explorer’s replicated read: DOGE_INDEXER_API_URL=https://explorer.xchain.io/TDOGE/api/ on testnet, https://explorer.xchain.io/DOGE/api/ on mainnet, with no DOGE_INDEXER_API_KEY (the explorer answers these reads to anyone, like the rest of its API). That answer comes from the explorer’s own replica, so a replica that has fallen behind makes the round wait longer rather than publish against stale data.

Full-Node Challenge

Controls FullNodeChallengeRound, the periodic possession challenge proving a validator runs a real coin full node rather than mirroring the decoder and indexer databases. Feeds the full-node verified reward tier and the on-chain NODEPROOF action.

Variable Required Default Description
FULLNODE_ENABLED No true Set to false to stop this hub running full-node challenges.
FULLNODE_BTC_RPC No (from coin config) BTC node JSON-RPC URL used to pose the challenge.
FULLNODE_CHALLENGE_INTERVAL_BLOCKS No 144 Blocks between challenge rounds (about daily on BTC).
FULLNODE_SPEND_LOG_PATH No ./data/fullnode-verdict.spend.jsonl JSONL record written and fsynced BEFORE a verdict fee is committed, so a crash mid-flight leaves a durable trace instead of only stdout.
FULLNODE_CONFIRM_DEPTH No 100 Depth behind the tip from which challenge material is drawn.
FULLNODE_VERDICT_ACCEPT_WINDOW_BLOCKS No 24 Blocks during which a verdict remains acceptable.
FULLNODE_POLL_MS No 30000 Poll cadence for challenge progress.
FULLNODE_COLLECT_MS No 20000 Window for collecting challenge answers.
FULLNODE_COLLECT_DEPTH_BLOCKS No 3 Blocks past the collection point before the round closes.
FULLNODE_PROOF_WINDOW_BLOCKS No per-coin Blocks a challenged node has to submit a proof.
FULLNODE_REWARD_PASS_WINDOW_BLOCKS No per-coin Blocks in the reward-pass window.
FULLNODE_MIN_PASS_RATE_BPS No per-coin Minimum pass rate, in basis points, for a node to be treated as passing.
FULLNODE_REWARD_SHARE No per-coin Full-node fraction of the designed oracle-round reward split; a consensus parameter that must match the coin default. Nothing pays the full-node tranche today (see COLLECT).
FULLNODE_GENESIS_VERIFIERS No per-coin Comma-separated genesis verifier pubkeys (lowercased).
XCHAIN_HUB_SKIP_FULLNODE_ASSERT No (unset, assertion active) Set to 1 to skip the canonical-FULLNODE assertion at startup and warn instead. Intended as a loud one-off bypass for a venue running its own challenge cadence and verifier set: divergent NODEPROOF knobs fork the challenge schedule, so this is not a setting to leave on.

Retraction Consensus

Variable Required Default Description
RETRACT_ROUND_TIMEOUT_MS No 180000 Timeout for one retraction round.
RETRACT_SIGN_RETRY_MS No 15000 Delay before re-sending a retraction SIGN_REQ.
RETRACT_INTENT_TTL_MS No 3600000 How long a retraction intent stays live before expiring (1 hour).

XCHAIN Price Derivation

The XCHAIN/USD price is derived from platform-realized fills rather than an external feed. These read the indexer database holding those fills.

Variable Required Default Description
XCHAIN_PRICE_INDEXER_DB_HOST No None Host of the indexer DB the fills are read from
XCHAIN_PRICE_INDEXER_DB_PORT No None Port of that database
XCHAIN_PRICE_INDEXER_DB_NAME No None Database name
XCHAIN_PRICE_INDEXER_DB_USER No None Database user
XCHAIN_PRICE_INDEXER_DB_SECRET No None Database password. Deprecated name XCHAIN_PRICE_INDEXER_DB_PASS is still read; see Secret variable naming above. Treat as a credential: supply it from the deployment environment, never a checked-in file.
XCHAIN_PRICE_INDEXER_DB_COIN No BTC Chain whose fills the price is derived from

The four derivation parameters below are consensus-uniform, not per-operator tuning. Every validator has to compute the same window over the same fills, so a hub honoring a local override would produce a different XCHAIN/BTC leg, land outside the co-sign deviation band, and expose itself to a recorded price_deviation offense and hub-local suspension. They are therefore honored on regtest only: on mainnet and testnet the hub logs a set but IGNORED warning and uses the consensus-pinned value regardless of what the environment says, and so does a standalone hub with no HUB_NETWORK. Retuning them for real is a coordinated flag-day change to the pinned values, never an operator environment variable. The per-operator XCHAIN_PRICE_INDEXER_DB_* source settings above are not gated this way: those are per-validator by design.

Variable Required Default Description
XCHAIN_PRICE_WINDOW_BLOCKS Regtest only (built-in) Rolling window, in blocks, over which fills are aggregated. Ignored (and logged) off regtest.
XCHAIN_PRICE_MIN_BTC_VOLUME Regtest only (built-in, supersession disabled) Minimum BTC-notional volume in the window before a derived price supersedes the carry-forward. 0 means any realized volume supersedes, which is what an e2e drill sets to prove the derived branch at all. Ignored (and logged) off regtest.
XCHAIN_PRICE_CONFIRMATION_BUFFER Regtest only (built-in) Confirmations a fill needs before it counts toward the derived price. Ignored (and logged) off regtest.
XCHAIN_PRICE_BOOTSTRAP_SATS Regtest only 1000 Bootstrap XCHAIN price in SATOSHIS, used before enough on-platform volume exists to derive one. Converted to USD at round time with the consensus BTC/USD, so it is never a USD pin. Ignored (and logged) off regtest: a per-operator value would fork fee acceptance.

LLM Attestation Provider

Backs the ATTEST path where a contract asks an approved model a question. See Attestation.

Variable Required Default Description
LLM_PROVIDER_ENABLED No true Set to false to disable the LLM attestation provider on this hub.
LLM_DEFAULT_MODEL No claude-sonnet-4-6 Default judge model. It must be in the approved-models list.
LLM_MAX_BUDGET_USD No (built-in cap) Spend ceiling in USD for LLM attestation calls. A kill-switch against runaway cost.
CLAUDE_BIN No claude Path to the Claude CLI binary the provider spawns. Override when it is not on PATH.
LLM_SPEND_LOG_PATH No ./data/llm-spend.jsonl File the provider appends each spend record to, written before the call so the audit trail cannot be lost to a crash mid-request.
LLM_SPEND_LOG_FALLBACK_PATH No llm-spend.jsonl inside the OS temp directory Where a per-dispatch LLM spend audit line is written when the primary sink (LLM_SPEND_LOG_PATH) cannot be written. The aggregate spend-state file cannot stand in for it: that file carries a rolling window of costs and no per-dispatch identity, so an operator reconciling a vendor invoice against it cannot tell which call was which.
LLM_MAX_SPEND_USD_CENTS_PER_WINDOW No 1000 ($10) Rolling-window USD budget, in cents, for LLM dispatch. A call that would exceed it is refused before the vendor is called. Clamped to at most 200000; env wins over hub config.
LLM_EST_SPEND_USD_CENTS No 5 ($0.05) Cents reserved against the window before each call; the reservation settles to the invoiced cost afterwards.
LLM_SPEND_WINDOW_MS No 3600000 (1 h) Length of the rolling spend window in milliseconds.
LLM_SPEND_STATE_PATH No ./data/spend-state/llm.json File the spend window persists to on a live validator hub, so a restart does not hand back a spent budget.
HUB_CLAUDE_CONFIG_DIR No ~/.claude-xchain Hub-scoped Claude CLI config directory holding the credentials the claude_spawn transport uses. Preferred over a shared CLAUDE_CONFIG_DIR.

Cost note. Each on-chain checkpoint anchor spends real DOGE on one bundle per network, not one transaction per chain: a single ANCHOR v0 carries BTC, LTC and DOGE as sections of the same payload, broadcast on the DOGE chain over the P2SH lane’s funding plus reveal pair. The cost therefore scales with encoded payload bytes at the venue’s fee rate rather than with the number of chains checkpointed. State recovery (recovery.js) only needs the latest anchored checkpoint per chain, so anchoring every intermediate checkpoint_seq is optional in principle. On mainnet and testnet the checkpoint and anchor cadence is pinned fleet-wide (CHECKPOINT_INTERVAL_BLOCKS 6, ANCHOR_CHECKPOINT_EVERY_N 1), so neither knob is a per-hub spend lever there: a set value is ignored with a warning. Only regtest honours an override. checkpoint_seq is consensus data, so the gate is deterministic across every hub.

Operator Signer

Variable Required Default Description
HUB_SIGNER_MODULE No None Path to a CommonJS module exporting walletSign(psbtHex) → Promise<txHex>. Used by OraclePublisher and AttestationPublisher to sign DOGE transactions; StateAnchorPublisher borrows the same hooks via resolveSigner(). Optional: without it the publishers stay idle. Set-but-unloadable throws at startup (fail loudly). Falls back to setWalletSignHook / setBroadcastHook if the module is not provided.

Cross-Chain

Variable Required Default Description
ATTESTATION_TIMEOUT No 60000 Cross-chain attestation consensus timeout (ms)
CROSS_CHAIN_INDEXER_TIMEOUT No 15000 HTTP timeout (ms) for the hub’s federation-read calls to indexers during cross-chain verification
XCALL_POLL_MS No 15000 Poll cadence of the cross-chain call relay
XCALL_RELAY_MARGIN_BLOCKS No 4 Margin, in blocks of the gating chain, stamped onto every relayed row’s effective_time. Sized by that chain’s nominal block interval.
XDEX_POLL_MS No 15000 Poll cadence of the cross-chain DEX settlement engine
XDEX_MIN_CONFIRMATIONS No (per-coin config) Flat confirmation floor for cross-chain DEX settlement, overriding the per-coin values
XDEX_MIN_CONFIRMATIONS_<COIN> No per-coin (BTC 6, LTC 12, DOGE 60) Per-coin confirmation depth override (e.g. XDEX_MIN_CONFIRMATIONS_DOGE). Takes precedence over the flat XDEX_MIN_CONFIRMATIONS variable. Consensus-affecting.
XCHAIN_CONFIRMATIONS_<COIN> No per-coin Cross-chain attestation/swap confirmation depth for <COIN> (e.g. XCHAIN_CONFIRMATIONS_BTC), read by the cross-chain and cross-chain-call engines. Also resolves from p2pConfig and falls back to per-coin defaults; the env var is the highest-precedence override. Consensus-affecting.
XCHAIN_ATTEST_FINALIZED_MAX No 10000 Cap on retained finalized cross-chain attestation records held in memory
XCHAIN_ATTEST_STORE_RETRIES No 4 Attempts made when persisting a cross-chain attestation record. The INSERT is idempotent (ON DUPLICATE KEY UPDATE), so a retry after a partial failure is safe.
XCHAIN_ATTEST_STORE_RETRY_MS No 100 Base backoff (ms) between those attempts.
XBRIDGE_POLL_MS No 15000 Poll cadence of the cross-chain bridge engine (CrossChainBridgeEngine), which signs bridge_transfers and policy_snapshots rows.
<COIN>_INDEXER_URL No (from config table) Per-coin indexer JSON-RPC URL the cross-chain bridge engine polls for confirmed transfer and policy legs (e.g. BTC_INDEXER_URL). Shared knob name with the other per-coin indexer reads on this page; falls back to the config table, then an empty string.
<COIN>_INDEXER_API_KEY No (from config table) API key presented to that indexer by the cross-chain bridge engine. Treat as a credential.

Regtest-only seams. All three engines honour these only when the hub’s network is regtest, and read them as NaN/false everywhere else, so a stray environment variable or config row can never reach the signed snapshot anchor or seed a validator on mainnet or testnet. They deliberately share names between the DEX, XCALL and bridge engines so a no-BTC regtest stack is configured once.

Variable Required Default Description
XDEX_SNAPSHOT_BLOCK No None Pin the snapshot anchor block on a regtest stack that has no BTC chain
XDEX_SEED_LOCAL_VALIDATOR No None Set to 1 to seed the local hub as a validator on a single-node regtest stack

Genesis and Regtest Binding

Regtest-only genesis overrides, ignored on mainnet and testnet, which always use the frozen bundled values. Consensus-relevant: they bind the local chain’s genesis anchor.

Variable Required Default Description
XCHAIN_GENESIS_BLOCK Regtest only per-coin Genesis block height for a regtest chain.
XCHAIN_GENESIS_LEDGER_HASH Regtest only per-coin Genesis ledger-hash pin for a regtest chain.
XCHAIN_GENESIS_DUMP_HASH Regtest only per-coin Genesis dump-hash pin for a regtest chain.
XC_ROLLCALL_REGTEST_ACTIVATION Regtest only unset (inert) Arms ROLLCALL on a private regtest venue, so this hub signs roll calls and elects publishers there. armed (or genesis/on/true/yes) activates at BTC height 0; a bare non-negative integer activates at that height; off/inert/false and anything unrecognised leave it inert. Read once at startup, so a change needs a restart. Ignored on mainnet and testnet, whose heights are fixed in source and unreachable from the environment.

| XC_ROLLCALL_GATES_REGTEST_ACTIVATION | Regtest only | unset (inert) | Arms ROLLCALL v1 on a private regtest venue: from the armed epoch height on, this hub publishes roll calls that carry the consensus gates its build knows, and the attestation capability set drops a validator whose recorded list lacks a rule active at the request block. Same grammar as XC_ROLLCALL_REGTEST_ACTIVATION (armed at height 0, a bare integer at that height, anything else inert), read once at startup, and separate from the roll-call rail so a rail-armed venue can still drive v0 roll calls as its control. Ignored on mainnet and testnet, whose heights are fixed in source. | | XC_MIRROR_ADMISSION_ACTIVATION | Regtest only | unset (inert) | Arms the per-coin regtest entries of MIRROR_ADMISSION_ACTIVATION and MIRROR_ADMISSION_CONSUMER_ACTIVATION (the mirror-admission heights) and the regtest entry of ANCHOR_ATTEST_BARRIER_ACTIVATION in the hub’s activation registry, one variable for the whole barrier family. Same grammar and inert default as XC_ROLLCALL_REGTEST_ACTIVATION; the armed form arms at height 0. Applied when a row is read, from the environment as it stands then; set identically on every hub, indexer, sync and explorer process in the venue. Ignored on mainnet and testnet, whose heights are fixed in source. | | XC_ANCHOR_FOLD_REGTEST_ACTIVATION | Regtest only | unset (inert) | Arms the regtest entries of both ANCHOR_FOLD_ACTIVATION and ARCHIVE_SECTION_VERDICT_STATE_HASH_ACTIVATION in the hub’s activation registry, because the section-scoped verdict is armed only with the fold. armed, genesis or on arms at DOGE height 0; a non-negative integer arms at that height. Unset or off leaves both gates inert; anything else is refused with a warning and leaves them inert. |

ROLLCALL arming is a venue-wide setting: set XC_ROLLCALL_REGTEST_ACTIVATION (and, when the gates rail is wanted, XC_ROLLCALL_GATES_REGTEST_ACTIVATION) identically on every hub and every BTC indexer in the venue, and wire the indexers’ DOGE_INDEXER_API_URL. Regtest ships inert because arming a network commits every BTC indexer on it to a wired DOGE peer, and a single-coin BTC venue would defer forever at its first epoch close. A venue that arms its hubs and forgets an indexer surfaces as a consensus-rules digest mismatch rather than as silent disagreement about which epochs exist.

Fee Destination Override

Variable Required Default Description
XCHAIN_FEE_DESTINATION_<COIN>_<NETWORK> Regtest only bundled Overrides the native-fee destination address for <COIN> on <NETWORK>. Honored on regtest only: on mainnet and testnet it is ignored (and logged), because the fee destination is consensus-pinned and an env override would escape the freeze and fork the block-hashed ledger.

Reorg

Variable Required Default Description
REORG_TIMEOUT No 60000 Reorg consensus timeout (ms)
REORG_MAX_LOOKBACK_MS No 86400000 How far back (24 hours) a reorg may be considered
REORG_MAX_DEPTH No 2000 Height-dimension blast-radius bound: the hub abstains from a reorg whose height sits more than this many blocks below its own indexer’s tip
REORG_MAX_PENDING No 64 Maximum concurrently pending reorg records, bounding memory
REORG_TIMESTAMP_SKEW_MS No 10800000 Tolerated clock skew (3 hours) when comparing reorg block timestamps
REORG_ALLOW_UNRECORDED_OLDHASH No (unset, abstain) Set to 1 to co-sign a reorg whose recorded orphaned block hash is null (unrecorded), so its claimed old hash cannot be verified against local history. Off by default: the hub abstains from such rounds rather than co-sign a claim it cannot check. An escape hatch for operators knowingly running against history with unrecorded orphan hashes, at the cost of co-signing unverified claims.

Governance

Variable Required Default Description
GOV_VOTING_PERIOD No 604800000 Governance voting period in milliseconds (default: 7 days)
GOVERNANCE_TALLY_INTERVAL No 60000 Interval between governance tally sweeps
GOVERNANCE_OVERDUE_MS No 7200000 (2 hours) Time after voting ends before a still-voting proposal is considered overdue (ms).

Diagnostic Scripts (bin/)

Read-only operator tools; neither broadcasts nor writes anything and neither is read by the running hub process itself.

Variable Required Default Description
HUB_RPC_URL No http://127.0.0.1:4000 Hub JSON-RPC base URL bin/stake-share-drill.js queries (getstakeshare) when no --hub flag is given. The drill reports how much more third-party stake the federation can absorb before the stake-weighted quorum commit gate stops being reachable, and what a stake of a given size would do to that margin; used to size a top-up before putting real stake on the network.
HUB_RPC_URLS No (empty; --hubs required instead) Comma-separated hub JSON-RPC URLs bin/oracle-round-presence.js polls (getoracleroundpresence) when no --hubs flag is given. Asks every named hub about the same round range and reports whether the federation agrees on which rounds happened, so a round that finalized on some validators and not others shows up as a named divergence instead of looking like ordinary absence. At least two URLs are required; comparing one hub to itself is refused.
XCHAIN_HUB_DIR No ../xchain-hub Sibling-checkout override bin/lib/carrier_logic_pin.js’s siblingDir() resolves for cross-repo carrier-logic comparison; the repo_guards twin test points it at a second checkout with XCHAIN_REQUIRE_SIBLINGS=1. Never read by the running hub process.
XCHAIN_INDEXER_DIR No ../xchain-indexer Sibling-checkout override for the xchain-indexer tree the same siblingDir() resolves when the pin tool compares against the indexer’s canonical copy; read by literal name so the coverage gate can see it. Never read by the running hub process.
NODE_OPTIONS No (unset) Node’s own option string. bin/suite-title-map.js appends --require=<its own path> to the caller’s value while it collects suite titles, so every mocha child it spawns loads the sibling mask, and restores the caller’s value afterwards. Never read by the running hub process.
XCHAIN_SUITE_TITLE_REPO_ROOT No (unset) Set only by bin/suite-title-map.js for the mocha children it spawns: the checkout being collected. When present, the child hides every adjacent xchain-* checkout from file and module reads, so a pin collected beside a platform checkout matches one collected in standalone CI. Not an operator setting; never read by the running hub process.
XCHAIN_DOCS_DIR No ../xchain-documentation Sibling-checkout override for the documentation tree the hub’s conformance tests read their vectors from. bin/suite-title-map.js unsets it, together with XCHAIN_INDEXER_DIR, for the mocha children it spawns and restores both afterwards, so an override cannot point a child back at a sibling the mask hides. Never read by the running hub process.
XCHAIN_SYNC_DIR No ../xchain-sync Sibling-checkout override for the xchain-sync tree the same siblingDir() resolves when the pin tool compares against sync’s copy; read by literal name so the coverage gate can see it. Never read by the running hub process.
DRILL_HUB_ROOT No the checkout holding the drill Hub tree bin/drill-llm-spend-guard.js loads the LLM provider from, for running the spend-guard drill inside a deployed hub container. The drill stubs the vendor CLI, so no money moves.
DRILL_WINDOW_MS No 8000 Spend window the same drill sets for its run, short so the window-roll step finishes quickly.

Database Schema

The hub keeps all of its state in one MariaDB database. Tables are auto-created on startup from src/sql/, one file per table. For the table inventory and the column reference, see Database.

Config Table Detail

Column Type Description
coin VARCHAR(16) Coin identifier (BTC, LTC, DOGE)
network VARCHAR(16) Network (mainnet, testnet, regtest)
module VARCHAR(64) Service name (xchain-decoder, xchain-indexer, etc.)
param_name VARCHAR(32) Parameter name (host, port, db_host, db_port, name, user, pass, service_port)
param_value TEXT Parameter value
updated_at DATETIME Last update timestamp

Config is served as a nested object: { coin: { network: { module: { param: value } } } }.

Connection Pool

Parameter Value Description
connectionLimit 10 Maximum simultaneous connections
connectTimeout 10000 Connection timeout (ms); override with DB_CONNECT_TIMEOUT
acquireTimeout 10000 Time to wait for a free pooled connection (ms); override with DB_ACQUIRE_TIMEOUT
queryTimeout 30000 Query execution timeout (ms); override with DB_QUERY_TIMEOUT
socketTimeout queryTimeout + 15000 Client-side socket timeout (ms); override with DB_SOCKET_TIMEOUT. queryTimeout is enforced by the server, so a frozen or partitioned MariaDB would leave an in-flight query holding its pool slot and HTTP request with no bound; this cuts the dead socket on the client. It sits above queryTimeout so a healthy server’s own limit always fires first. A non-numeric value keeps the default.
migration statement timeout 3600000 Per-statement limit (ms) the hub sets for each boot-time column retype, restoring the pool value afterwards; override with MIGRATE_QUERY_TIMEOUT (a non-numeric or negative value falls back to the default)
idleTimeout 60000 Idle connection timeout (ms)

DB_CONNECT_TIMEOUT, DB_ACQUIRE_TIMEOUT, and DB_QUERY_TIMEOUT are read by the indexer’s pool with the same names and the same defaults.

Circuit Breaker

Parameter Value Description
Threshold 10 Consecutive failures before opening the circuit
Cooldown 30000 Milliseconds before attempting a half-open retry
Max retries 30 Maximum retry attempts with backoff
Backoff range 500ms–15s Delay range with jitter

When the circuit opens, all database queries fail fast until the cooldown period expires. Retries use exponential backoff with jitter to prevent thundering herd.

Validator Identity

Ed25519 keys are used for P2P message signing and verification:

  • Private key: 32-byte seed from SIGNING_PRIVKEY_SECRET (64 hex chars), wrapped in PKCS8 DER for Node.js crypto.
  • Public key: extracted as raw 32-byte SPKI, stored as 64 hex chars.
  • Signing: canonical payload is JSON with sorted fields (id, type, sender, timestamp, data).
  • Generation: ValidatorIdentity.generate() produces a random keypair.
const { ValidatorIdentity } = require('./src/ValidatorIdentity');
const { privkey, pubkey } = ValidatorIdentity.generate();
// privkey: 64-char hex string for SIGNING_PRIVKEY_SECRET
// pubkey:  64-char hex string for registervalidator

Copyright © 2025–2026 Dankest, LLC

Based on XChain Platform by Dankest, LLC – https://dankest.llc

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-or-later) with a commercial license available for proprietary use.

You may use, modify, and distribute this material under the terms of the License. See LICENSE and NOTICE for full terms. See the licensing overview.

Edit this page on GitHub ↗