XChain Platform Action - ANCHOR
On-chain commitment of federation-signed state, checkpoints and the cross-chain match archive, with two legs and four version-discriminated phases:
- v0: Checkpoint bundle. Validator-broadcast. One logical anchor cycle per network,
normally carried by one action but split into multiple actions when the byte budget requires
it, with every checkpointed chain carried as its own section: the chain’s hash triple, its SPV
light-client roots and its own quorum signature list, followed by a single
PUBLISHERattestation tail covering the whole bundle. BelowANCHOR_FOLD_ACTIVATION, v0 is the only checkpoint wire the hub emits. - v1: Archive head + publisher attestation. Validator-broadcast. One chain’s quorum-signed
state checkpoint (the per-block
ledger/actions/contracthash triple) plus a compressed batch of fullcross_chain_matchesrecords (including their validator signatures and thecapability_snapshotsrows needed to re-verify them), plus the elected archive leader’sPUBLISHERpubkey and a quorateoracle_publishattestation (theXANCPUBcanonical) keyed onMATCH_BATCH_SEQ, binding which validator earns the archive reward. ThePUBLISHERtail is always appended;ATTEST_SIG_COUNTMAY be 0 when the attestation round degrades, in which case the checkpoint and archive still indexvalid, no publisher attestations are stored, and noanchor_archivereward is derived. The indexer derives the reward straight from these bytes, retiring the last key-authenticatedpushvalidatorrewardsrail. - v2: Archive continuation. Validator-broadcast. Carries overflow chunks when a v1 archive payload exceeds the per-action data limit. Authenticated by its parent v1 (carries no signatures of its own).
- v3: Folded checkpoint + archive bundle. Validator-broadcast, at/above
ANCHOR_FOLD_ACTIVATION. Carries the same per-chain checkpoint sections as v0 plus, at most, one archive section bound to one of those sections by an explicitWRAPPER_SECTION_INDEX, so a network emits one logical ANCHOR cycle instead of a separate v0 bundle and v1/v2 archive pair. The cycle can still span multiple transactions when the byte budget requires a split. See Version 3 below. v0, v1 and v2 keep their shapes byte-for-byte and stay parseable forever; the fold only adds a new version, it narrows nothing below it.
Activation
ANCHOR_ACTIVATION is a frozen consensus constant, one mined-height value per network, keyed
on the anchor’s own DOGE BLOCK_INDEX:
| Network | ANCHOR_ACTIVATION |
Why |
|---|---|---|
| mainnet | 6360000 | activated: the restarted set is live on mainnet |
| testnet | 67858600 | 24 blocks above the last pre-restart anchor at 67858576 |
| regtest | 0 | stacks are rebuilt from genesis, so there is no pre-restart history |
Mainnet’s height has been reached. The restarted wire set is live there: the DOGE tip passed the height near 2026-09-03 with no arming ruling, and the 2026-10-09 ruling accepts it as live. Testnet’s sits just above the last anchor it published under the old set and is already past, so that window is open and needs no publisher-side guard.
The gate runs before format dispatch: an ANCHOR of any version mined below its network’s
activation height is invalid: ANCHOR before activation. At or above the activation height,
only versions 0, 1, 2 and (at/above ANCHOR_FOLD_ACTIVATION) 3 exist (this document); any
other version byte is invalid: VERSION (unknown). See Notes for how this reads on
the versions this restart retires.
Fold activation (ANCHOR_FOLD_ACTIVATION)
A second, independent height gate, per network, keyed the same way as ANCHOR_ACTIVATION (the
anchor’s own DOGE BLOCK_INDEX) and always at or above it: version 3 cannot exist before the
restarted wire set does. Below ANCHOR_FOLD_ACTIVATION a version-3 anchor is
invalid: VERSION (unknown), identically to any version this document does not define. At or
above it, versions 0, 1 and 2 are still valid: the fold adds a wire, it does not retire the
unfolded ones, so a publisher mid-rollout (or a network that never arms the fold) keeps
publishing v0 bundles and v1/v2 archive batches exactly as before.
ANCHOR_FOLD_ACTIVATION uses the house UNARMED sentinel on mainnet: it is ruled and unscheduled
there, and stays inert until the year 2286. Testnet is armed per chain through the map’s
BTC:testnet, LTC:testnet and DOGE:testnet heights in constants.js; the
bare testnet key is only the fallback for a chain with no key of its own. Its regtest entry is
null by default. XC_ANCHOR_FOLD_REGTEST_ACTIVATION can arm that entry at DOGE height zero or a
selected height for a private venue without scheduling either public network.
ANCHOR_EMPTY_FOLD_REJECT_ACTIVATION is the separate enforcement gate for the existing v3
section-count rule. A v3 with SECTION_COUNT 0 is an empty fold and is never a legal v3 wire:
at or above this gate it is invalid: SECTION_COUNT (empty fold). Before activation, indexers
retain the earlier acceptance behavior only for consensus replay compatibility; that behavior
does not make a zero-section fold valid for publishers to emit. The reject gate is currently
UNARMED on every network pending the historical empty-fold audit.
ARCHIVE_SECTION_VERDICT_STATE_HASH_ACTIVATION is the companion gate for the v3 archive
section’s verdict scope (see Version 3 only below). It carries the fold’s values
on every network, so testnet is armed per chain at the same heights. Mainnet holds the same
UNARMED sentinel, and regtest is null by default. The same
XC_ANCHOR_FOLD_REGTEST_ACTIVATION setting arms both regtest gates at the same height, because
the section-scoped verdict is armed only with the fold.
Archive reward termination (ANCHOR_ARCHIVE_FOLD_TERM_ACTIVATION)
The fold changes the publishing shape immediately, but an already attested v1
anchor_archive reward can mature after that change. Its proof and mint therefore need a
separate consensus boundary. ANCHOR_ARCHIVE_FOLD_TERM_ACTIVATION terminates that legacy
reward family only when it and ANCHOR_FOLD_ACTIVATION are active. If either gate is
inactive, v1 archive rewards retain their pre-fold behavior. The term never affects
anchor_bundle rewards, and a v3 action never creates a separate anchor_archive reward.
The conjunction is evaluated on both consensus planes that can admit the reward:
- The BTC derive pass evaluates both gates at the reward’s
SNAPSHOT_BLOCK. Once both are active there, a mirroredanchor_archiveattestation cannot mint. - The DOGE proof binding evaluates both gates at the archive head’s own DOGE
BLOCK_INDEX. Once both are active there, that head cannot prove ananchor_archivereward tuple.
Mainnet and every testnet chain slot use the house UNARMED sentinel for the term gate, so neither public network terminates legacy archive rewards until an operator arms it. Regtest is genesis-active at height 0, but the conjunction still requires the regtest fold gate to be armed. The current public-network state is listed on Flag-Day Values.
A network with pre-restart history must not pin 0. The retired wires reused the same version bytes under different meanings, so with the gate disabled they fall through to the table above and are read as shapes they are not: the old per-chain version 0 would be reported as a checkpoint bundle carrying SPV roots and a publisher attestation, and the old tail-less version 1 as an archive head with a publisher tail. Both claims would be false. Mainnet carries 56 such rows and testnet 11, which is why each gets a height above its own history rather than 0.
flowchart TD
subgraph CP["Checkpoint leg"]
v0["v0: Checkpoint bundle<br>(one per network per cycle,<br>one section per chain,<br>one publisher attestation)"]
end
subgraph AR["Archive leg"]
v1["v1: Archive head + publisher attestation<br>(tail always appended, ATTEST_SIG_COUNT may be 0)"]
v2["v2: Archive continuation<br>(overflow chunks, authenticated by parent v1)"]
v1 -->|"overflow chunks"| v2
end
ANCHOR is valid only on the anchor chain; DOGE (all networks). Indexers on other chains
reject it. BTC and LTC state is still covered: a v1 names the CHAIN it checkpoints, and
a v0 carries one section per chain, so one cheap chain carries the commitments for all three.
ANCHOR supersedes the hub’s legacy raw XDEXANCHOR payload (which was not a protocol action and
was invisible to the decoder). The XDEXANCHOR publisher (CrossChainDexAnchor) was removed
from the hub on 2026-06-11 after ANCHOR verified end-to-end on mainnet; rows it stamped
(batch_root) remain readable but nothing publishes the legacy payload anymore.
Purpose
- Verifiable state. Light clients verify any indexer/explorer response against a
checkpoint signed by a quorum of
oracle_publishvalidators (stake-weighted and source-deduped at/aboveSTAKE_WEIGHTED_QUORUM_ACTIVATION, otherwise the legacymax(2f+1, ceil((N+1)/2))signer count), without trusting a single operator. - Full-parse recoverability. Cross-chain match records are the only consensus-relevant dataset not natively on-chain (they are mirror-delivered; see Cross-Chain DEX). The v1/v2 archive places the records themselves on-chain, so the entire platform state is reconstructible from a full parse of the three blockchains with no surviving hub database.
PARAMS
| Name | Type | Versions | Description |
|---|---|---|---|
VERSION |
Integer | all | Format version (0=checkpoint bundle, 1=archive head + publisher, 2=continuation, 3=folded checkpoint + archive bundle) |
NETWORK |
String | 0, 1, 3 | mainnet | testnet | regtest. On a v0/v3 it is carried once, in the header, and applies to every section |
SNAPSHOT_BLOCK |
Integer | 0, 1, 3 | BTC block selecting the oracle_publish validator set. On a v0/v3 it is the bundle’s election and attestation block: the MAX of the sections’ SECTION_SNAPSHOT_BLOCK |
SECTION_COUNT |
Integer | 0, 3 | Number of per-chain checkpoint sections that follow; at least 1 in both versions, and 0 is never legal in v3 |
CHAIN |
String | 0, 1, 3 | Chain being checkpointed: BTC | LTC | DOGE. One per v0/v3 section |
BLOCK_INDEX |
Integer | 0, 1, 3 | Checkpointed block height on CHAIN |
BLOCK_HASH |
String | 0, 1, 3 | 64-hex block hash of CHAIN at BLOCK_INDEX |
LEDGER_HASH |
String | 0, 1, 3 | 64-hex chained ledger hash (blocks.ledger_hash at BLOCK_INDEX) |
ACTIONS_HASH |
String | 0, 1, 3 | 64-hex chained actions hash |
CONTRACT_HASH |
String | 0, 1, 3 | 64-hex chained contract hash |
CHECKPOINT_SEQ |
Integer | 0, 1, 3 | Monotonic checkpoint counter per (CHAIN,NETWORK) |
SECTION_SNAPSHOT_BLOCK |
Integer | 0, 3 | The section’s own BTC snapshot block, the one its signatures verify against. Usually equal to the bundle SNAPSHOT_BLOCK; lower when a lagging chain rides at an older checkpoint |
STATE_ROOT |
String | 0, 3 | 64-hex SPV state root (SMT over balances+stakes) at BLOCK_INDEX |
STATE_ROOT_VERSION |
Integer | 0, 3 | Merkle scheme version the STATE_ROOT was computed under |
BLOCK_MERKLE_ROOT |
String | 0, 3 | 64-hex SPV per-block content Merkle root at BLOCK_INDEX |
BLOCK_MERKLE_VERSION |
Integer | 0, 3 | Merkle scheme version the BLOCK_MERKLE_ROOT was computed under |
ARCHIVE_COUNT |
Integer | 3 | 0 or 1: whether the archive section that follows the checkpoint sections is present. A second archive in one v3 is invalid: ARCHIVE_COUNT |
WRAPPER_SECTION_INDEX |
Integer | 3 | 0-based index into the v3’s own SECTION_COUNT sections, naming which chain section’s signatures extend to cover the archive fields below. Present only when ARCHIVE_COUNT is 1 |
MATCH_BATCH_SEQ |
Integer | 1, 2, 3 | Monotonic archive-batch counter (ties v2 chunks to their v1, and identifies a v3’s folded archive section) |
MATCH_COUNT |
Integer | 1, 3 | Number of match records in this archive batch |
BATCH_CRC32 |
String | 1, 3 | 8-hex CRC32 of the uncompressed archive JSON bytes |
ARCHIVE_B64 |
String | 1, 3 | base64url of gzip(archive JSON): chunk 0 when the batch is chunked |
CHUNK_INDEX |
Integer | 2 | 1-based continuation index (the v1 head, and a v3’s folded archive section, carry chunk 0) |
TOTAL_CHUNKS |
Integer | 1, 2, 3 | Total chunks in the batch (1 = unchunked, archive-head-only) |
ARCHIVE_B64_CHUNK |
String | 2 | This continuation’s slice of the base64url payload |
SIG_COUNT |
Integer | 0, 1, 3 | Number of (pubkey, sig) pairs that follow; on a v0/v3 it is per section |
PUBKEY_n |
String | 0, 1, 3 | 64-hex Ed25519 pubkey, in the oracle_publish set at the signature’s snapshot block |
SIG_n |
String | 0, 1, 3 | 128-hex Ed25519 signature over the canonical checkpoint message |
PUBLISHER |
String | 0, 1, 3 | 64-hex Ed25519 pubkey of the elected publisher that earns the anchor reward |
ATTEST_SIG_COUNT |
Integer | 0, 1, 3 | Number of (pubkey, sig) attestation pairs that follow; on a v1 this MAY be 0 when the attestation round degraded, while a v0 or v3 MUST carry at least 1 (an unattested bundle is deferred, not published) |
APUBKEY_n |
String | 0, 1, 3 | 64-hex pubkey in the oracle_publish set at SNAPSHOT_BLOCK (attestation signer) |
ASIG_n |
String | 0, 1, 3 | 128-hex Ed25519 signature over the XANCPUB canonical |
Formats
Version 0: Checkpoint bundle (validator-broadcast)
ANCHOR|0|NETWORK|SNAPSHOT_BLOCK|SECTION_COUNT|CHAIN|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SECTION_SNAPSHOT_BLOCK|STATE_ROOT|STATE_ROOT_VERSION|BLOCK_MERKLE_ROOT|BLOCK_MERKLE_VERSION|SIG_COUNT|PUBKEY1|SIG1|...|PUBLISHER|ATTEST_SIG_COUNT|APUBKEY1|ASIG1|...
Read as a header, SECTION_COUNT repeats of one section, and one publisher tail:
ANCHOR|0|NETWORK|SNAPSHOT_BLOCK|SECTION_COUNT
|CHAIN|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SECTION_SNAPSHOT_BLOCK
|STATE_ROOT|STATE_ROOT_VERSION|BLOCK_MERKLE_ROOT|BLOCK_MERKLE_VERSION
|SIG_COUNT|PUBKEY|SIG|... (repeated SECTION_COUNT times)
|PUBLISHER|ATTEST_SIG_COUNT|APUBKEY|ASIG|...
NETWORKis carried once. A section has no network field of its own; the header’sNETWORKapplies to every section, and the indexer rebuilds each section’s signing canonical with it and writes it onto every stored section row.SNAPSHOT_BLOCKis the bundle’s block, used for the publisher election and for the attestation quorum. It is the MAX of the sections’SECTION_SNAPSHOT_BLOCK. In the normal case every section shares it; a chain that lagged one cycle rides at its own older block.- A section is one chain’s checkpoint, verified exactly as a standalone checkpoint is:
its signatures cover its own
XCHECKPOINTcanonical at its ownSECTION_SNAPSHOT_BLOCK. Nothing about per-chain checkpoint verification changes when it travels in a bundle. - Ordering is fixed. Sections are ordered by
CHAINascending, and within a section the(PUBKEY, SIG)pairs are ordered byPUBKEYascending. Both rules are load-bearing: they make two publishers racing the same cycle produce byte-identical bundles, which is what lets the attestation peers byte-match what they rebuild from their own checkpoint rows. SECTION_COUNTis at least 1. A one-section bundle is valid and, under the daily cadence, common: a chain whose newest eligible checkpoint is already anchored is simply absent from this cycle and rides the next one.- Roots are required in every section. The bundle is root-bearing by construction; a checkpoint row with null roots is skipped with a log line, never emitted rootless.
- One publisher tail per physical bundle, whatever the section count. Every bundle created
by splitting one cycle repeats the cycle’s same
PUBLISHER,XANCPUBcanonical and attestation signature set; those repeated wire tails represent one logical attestation. - Byte budget: 8189 bytes of wire text (
MAX_ACTION_DATA_LENGTH8192 minus the 3-byte push prefix). A cycle that would exceed it is split chain-ascending into as many bundles as fit, all sharing the election keyed by(NETWORK, SNAPSHOT_BLOCK); a single section that cannot fit alongside the attestation tail its bundle will carry is refused loudly and counted, never sent truncated. The assembled payload is measured once more before broadcast, so an under-estimated tail is refused here rather than dropped by the decoder.
Version 1: Checkpoint + match archive + publisher attestation (validator-broadcast)
ANCHOR|1|CHAIN|NETWORK|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SNAPSHOT_BLOCK|MATCH_BATCH_SEQ|MATCH_COUNT|BATCH_CRC32|TOTAL_CHUNKS|ARCHIVE_B64|SIG_COUNT|PUBKEY1|SIG1|...|PUBLISHER|ATTEST_SIG_COUNT|APUBKEY1|ASIG1|...- The
PUBLISHER+ attestation list is appended after the wrapper signature list (never inserted mid-string), and is always present: every v1 carries aPUBLISHERand anATTEST_SIG_COUNT, which MAY be 0 when the attestation round degraded. A count-0 v1 isvalid, stores no publisher attestations, and derives noanchor_archivereward; every other archive rule (integrity,MATCH_BATCH_SEQmonotonicity, v2 tie) is unaffected by the count. Continuation chunks stay v2, tied byMATCH_BATCH_SEQexactly as for any v1 head.
Version 2: Archive continuation (validator-broadcast; no signatures)
ANCHOR|2|MATCH_BATCH_SEQ|CHUNK_INDEX|TOTAL_CHUNKS|ARCHIVE_B64_CHUNK
Version 3: Folded checkpoint + archive bundle (validator-broadcast)
ANCHOR|3|NETWORK|SNAPSHOT_BLOCK|SECTION_COUNT|CHAIN|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SECTION_SNAPSHOT_BLOCK|STATE_ROOT|STATE_ROOT_VERSION|BLOCK_MERKLE_ROOT|BLOCK_MERKLE_VERSION|SIG_COUNT|PUBKEY1|SIG1|...|ARCHIVE_COUNT|[WRAPPER_SECTION_INDEX|MATCH_BATCH_SEQ|MATCH_COUNT|BATCH_CRC32|TOTAL_CHUNKS|ARCHIVE_B64]|PUBLISHER|ATTEST_SIG_COUNT|APUBKEY1|ASIG1|...
Read as a header, SECTION_COUNT repeats of one section (byte-identical in shape to a v0
section), one optional archive section, and one publisher tail:
ANCHOR|3|NETWORK|SNAPSHOT_BLOCK|SECTION_COUNT
|CHAIN|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SECTION_SNAPSHOT_BLOCK
|STATE_ROOT|STATE_ROOT_VERSION|BLOCK_MERKLE_ROOT|BLOCK_MERKLE_VERSION
|SIG_COUNT|PUBKEY|SIG|... (repeated SECTION_COUNT times)
|ARCHIVE_COUNT
|WRAPPER_SECTION_INDEX|MATCH_BATCH_SEQ|MATCH_COUNT|BATCH_CRC32|TOTAL_CHUNKS|ARCHIVE_B64 (iff ARCHIVE_COUNT is 1)
|PUBLISHER|ATTEST_SIG_COUNT|APUBKEY|ASIG|...
- v3 is the fold of v0 and v1/v2 into one wire.
NETWORK,SNAPSHOT_BLOCK,SECTION_COUNTand every section field carry the identical meaning, ordering rules (CHAIN-ascending sections,PUBKEY-ascending pairs within a section) and signature-verification behavior as a v0 bundle; nothing about per-chain checkpoint verification changes when it travels folded. There is still exactly one publisher tail per physical bundle, whatever the section count, and one election covering the whole(NETWORK, SNAPSHOT_BLOCK)cycle (checkpoint sections plus the archive, when present). Split actions repeat the same tail and do not create another election or attestation. ARCHIVE_COUNTis 0 or 1, never more. It is the field the fold adds right after the section list: 0 means this cycle’s archive leg missed its sub-deadline (or the network has nothing pending to archive) and the bundle ships with checkpoints only; 1 means exactly one archive section follows. A v3 whoseARCHIVE_COUNTclaims 2 or more, or that does not match the archive section actually present, isinvalid: ARCHIVE_COUNT.WRAPPER_SECTION_INDEXis an explicit binding, never an assumed position. WhenARCHIVE_COUNTis 1,WRAPPER_SECTION_INDEXis the 0-based index into this v3’s own section list naming which chain section the archive rides: that section’s(PUBKEY, SIG)list signs the EXTENDED canonical (the section’s checkpoint bytes and roots, then the archive fields; see Canonical signing message below) instead of the plain checkpoint canonical every other section in the bundle signs. The archive section carries no signature list of its own: it is authenticated by riding the named section’s signatures. An out-of-rangeWRAPPER_SECTION_INDEX, or one naming a section whose signatures do not verify against the extended canonical, isinvalid: WRAPPER_SECTION_INDEX.- Liveness of the checkpoint leg never depends on the archive leg. The archive co-sign rides
the bundle’s existing sign round with its own sub-deadline; a miss drops
ARCHIVE_COUNTto 0 and the bundle still ships on time with every checkpoint section intact, rather than delaying the whole cycle for a slow archive quorum. - One reward per
(NETWORK, SNAPSHOT_BLOCK)cycle, whatever the section count, split count orARCHIVE_COUNTis. The publisher attestation tail signs the sameXANCPUB|anchor_bundle|...reward tuple a v0 bundle signs (see Publisher-attestation canonical below); v3 never mints a separateanchor_archivereward, folded or not. See Version 3 only for the retirement this implies atANCHOR_FOLD_ACTIVATION.
Examples
ANCHOR|0|mainnet|900120|3|BTC|900123|00000000...|3f9a...|b81c...|44d0...|900123|900120|9ab1...|1|77cc...|1|3|a1b2...|c3d4...|e5f6...|0718...|292a...|3b4c...|DOGE|5401230|9f2c...|...|LTC|3102277|1c88...|...|f0e1...|3|a1b2...|55aa...|e5f6...|66bb...|292a...|77cc...
One bundle for mainnet at snapshot block 900120: three sections (BTC, DOGE, LTC in chain order), each with its own roots and 3-of-N signatures, then one publisher attestation tail
ANCHOR|1|BTC|mainnet|900123|00000000...|3f9a...|b81c...|44d0...|418|900120|42|17|9c4e1b22|1|H4sIAAAA...|3|a1b2...|c3d4...|...|8899...|2|aa11...|bb22...|cc33...|dd44...
Checkpoint plus archive batch 42 (17 match records, single chunk), publisher tail with a 2-of-N attestation
ANCHOR|1|BTC|mainnet|900123|00000000...|3f9a...|b81c...|44d0...|418|900120|43|9|7a1e2c0b|1|H4sIAAAA...|3|a1b2...|c3d4...|...|8899...|0
Same shape, but the attestation round degraded: PUBLISHER is still present, ATTEST_SIG_COUNT is 0, no anchor_archive reward is derived
ANCHOR|2|42|1|3|AAAB7Rxe...
Continuation chunk 1 of 3 for archive batch 42
ANCHOR|3|mainnet|900120|3|BTC|900123|00000000...|3f9a...|b81c...|44d0...|900123|900120|9ab1...|1|3|a1b2...|c3d4...|e5f6...|0718...|292a...|3b4c...|DOGE|5401230|9f2c...|...|LTC|3102277|1c88...|...|f0e1...|3|a1b2...|55aa...|e5f6...|66bb...|292a...|77cc...|1|0|42|17|9c4e1b22|1|H4sIAAAA...|f0e1...|3|a1b2...|55aa...|e5f6...|66bb...|292a...|77cc...
One folded bundle for mainnet at snapshot block 900120: three checkpoint sections (BTC, DOGE, LTC in chain order) exactly as a v0 would carry them, then ARCHIVE_COUNT=1 with the archive bound to WRAPPER_SECTION_INDEX 0 (the BTC section, whose signatures therefore cover the extended canonical), then one publisher attestation tail
ANCHOR|3|mainnet|900120|3|BTC|900123|00000000...|3f9a...|b81c...|44d0...|900123|900120|9ab1...|1|77cc...|1|3|a1b2...|c3d4...|e5f6...|0718...|292a...|3b4c...|DOGE|5401230|9f2c...|...|LTC|3102277|1c88...|...|f0e1...|3|a1b2...|55aa...|e5f6...|66bb...|292a...|77cc...|0|f0e1...|3|a1b2...|55aa...|e5f6...|66bb...|292a...|77cc...
Same cycle, but the archive co-signers missed their sub-deadline: ARCHIVE_COUNT is 0, no archive section follows, and every section signs the plain (unextended) checkpoint canonical. The checkpoint leg ships on the normal cadence regardless
Canonical signing message (v1 / v0 sections)
Each SIG_n covers the UTF-8 bytes of:
XCHECKPOINT|CHAIN|NETWORK|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SNAPSHOT_BLOCK
and for v1, with the archive structure appended:
XCHECKPOINT|...|SNAPSHOT_BLOCK|MATCH_BATCH_SEQ|MATCH_COUNT|BATCH_CRC32|TOTAL_CHUNKS
and for a v0 section, with the SPV light-client roots appended (the bytes the federation signs, so the roots are covered by the quorum, not merely transported):
XCHECKPOINT|CHAIN|NETWORK|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SECTION_SNAPSHOT_BLOCK|STATE_ROOT|STATE_ROOT_VERSION|BLOCK_MERKLE_ROOT|BLOCK_MERKLE_VERSION
NETWORK here is the bundle header’s network and SECTION_SNAPSHOT_BLOCK the section’s own snapshot block, so a section’s signed bytes are byte-identical to the checkpoint canonical the hub StateCheckpointEngine signs and the SDK / explorer verifiers reconstruct (the publisher reuses the checkpoint row’s signatures verbatim, it does not re-sign anything to build a bundle).
That identity holds at or above CHECKPOINT_COMMITMENT_ACTIVATION, evaluated on the header network at SECTION_SNAPSHOT_BLOCK (see flag days). Below it the hub and the SDK / explorer verifiers omit the root suffix while the indexer rebuilds every v0 section with it, so no bundle may carry a v0 section whose own snapshot block sits below that height. Such a section fails signature verification rather than being accepted, and because the bundle verdict is all-or-nothing it takes the whole bundle with it; the verifier never adopts roots the quorum did not sign.
ARCHIVE_B64 is not part of the signed bytes; the blob is bound to the signed structure by
BATCH_CRC32, computed over the uncompressed JSON. (CRC over uncompressed bytes keeps
verification independent of the zlib version that produced the gzip stream.) Chain/network are
uppercase/lowercase exactly as on the wire; numerics are decimal with no leading zeros; hashes
are lowercase hex. A signature counts only if its pubkey is in the oracle_publish capability
snapshot at SNAPSHOT_BLOCK and the Ed25519 signature verifies.
The v1 wrapper signatures cover the archive canonical, and each v0 section’s signatures cover that section’s own checkpoint canonical; the publisher attestation below is a SEPARATE signature list in both cases.
A v3’s chain sections are v0 sections, signed the same way, with one exception: the section
named by WRAPPER_SECTION_INDEX (only when ARCHIVE_COUNT is 1) signs the v0 section canonical
above with the archive fields appended, exactly as a v1 appends them to its own checkpoint
canonical:
XCHECKPOINT|CHAIN|NETWORK|BLOCK_INDEX|BLOCK_HASH|LEDGER_HASH|ACTIONS_HASH|CONTRACT_HASH|CHECKPOINT_SEQ|SECTION_SNAPSHOT_BLOCK|STATE_ROOT|STATE_ROOT_VERSION|BLOCK_MERKLE_ROOT|BLOCK_MERKLE_VERSION|MATCH_BATCH_SEQ|MATCH_COUNT|BATCH_CRC32|TOTAL_CHUNKS
Every other section in that same v3 (every index other than WRAPPER_SECTION_INDEX, and every
section when ARCHIVE_COUNT is 0) signs the plain v0 section canonical with no archive tail.
There is no separate wrapper-level signature list for the archive on a v3: it rides the named
section’s own signatures instead of a signature list of its own, which is what “the archive
co-sign rides the bundle’s existing sign round” means on the wire. The
CHECKPOINT_COMMITMENT_ACTIVATION root-suffix rule two paragraphs up applies to a v3 section
exactly as to a v0 section, evaluated at the section’s own SECTION_SNAPSHOT_BLOCK.
Publisher-attestation canonical (XANCPUB, v0 / v1)
Each ASIG_n on a v0 covers the UTF-8 bytes of the bundle reward tuple:
XANCPUB|anchor_bundle|SNAPSHOT_BLOCK|SNAPSHOT_BLOCK|PUBLISHER|ANCHOR_REWARD_AMOUNT
The six positional fields are the shipped layout, kept so the slashing judge finds
snapshot_block at the same index for every XANCPUB family. Field 2 is the round reference,
which for a bundle IS the snapshot block, hence the repeat: a bundle spans several chains and
several checkpoint sequences, so the block is the only round key all its sections share. When
the byte budget splits a cycle, every physical bundle for the same
(NETWORK, SNAPSHOT_BLOCK) repeats these same canonical bytes and the same signature set. The
split therefore creates no additional XANCPUB attestation.
ANCHOR_REWARD_AMOUNT is the frozen consensus constant 10.00000000 (read from the
ANCHOR_REWARD_ACTIVATION twin module, NEVER taken from the wire; changing it is itself a
flag-day). PUBLISHER is lowercase hex. At/above the EQUIV_HEADER flag-day the bytes are wrapped
once in the uniform equivocation header, with a distinct XANCPUB|bundle|... round id so this
attestation forms its own equivocation family, disjoint from the archive family (a validator
that signs both a checkpoint canonical and this reward attestation in the same round is never
falsely slashable):
EQUIV|XCHECKPOINT|XANCPUB|bundle|NETWORK|SNAPSHOT_BLOCK|0||XANCPUB|anchor_bundle|SNAPSHOT_BLOCK|SNAPSHOT_BLOCK|PUBLISHER|ANCHOR_REWARD_AMOUNT
The v1 archive attestation uses the same shape keyed on the archive batch, with the
frozen ARCHIVE_REWARD_AMOUNT (10.00000000, from the same twin module) and an
XANCPUB|archive|... round id disjoint from the bundle round id (the two attestation families
can never equivocation-collide):
XANCPUB|anchor_archive|MATCH_BATCH_SEQ|SNAPSHOT_BLOCK|PUBLISHER|ARCHIVE_REWARD_AMOUNT
and at/above the EQUIV_HEADER flag-day:
EQUIV|XCHECKPOINT|XANCPUB|archive|NETWORK|MATCH_BATCH_SEQ|SNAPSHOT_BLOCK|0||XANCPUB|anchor_archive|MATCH_BATCH_SEQ|SNAPSHOT_BLOCK|PUBLISHER|ARCHIVE_REWARD_AMOUNT
These bytes are byte-identical across the hub producer (StateAnchorPublisher.attestationCanonical),
the indexer verifier (actions/anchor/index.js rewardCanonical) and this spec; a divergence forks the
derived reward row. An ASIG_n counts only if its pubkey is in the SAME oracle_publish snapshot at
SNAPSHOT_BLOCK used for the root quorum and the Ed25519 signature verifies.
A v3’s PUBLISHER/ATTEST_SIG_COUNT tail always signs the anchor_bundle tuple above, never
the anchor_archive one, whether or not it carries an archive section: one election covers the
whole folded cycle, so there is exactly one attestation family to sign, not two. See
Version 3 only for the reward-type retirement this implies.
Archive JSON (v1/v2 payload, after gunzip)
A single JSON object with fixed key order (required: BATCH_CRC32 is computed over these
exact bytes):
{
"v": 1,
"network": "mainnet",
"batch_seq": 42,
"matches": [ { ...full cross_chain_matches row... } ],
"calls": [ { ...cross_chain_calls relay row... } ],
"rewards": [ { "validator_pubkey": "...", "source": "1Stake...", "round_number": 900120, "reward_type": "anchor_bundle", "amount": "10.00000000", "block_index": 900120 } ],
"bridge_transfers": [ { ...full bridge_transfers row... } ],
"policy_snapshots": [ { ...full policy_snapshots row... } ],
"state_checkpoints": [ { ...full state_checkpoints row... } ],
"price_snapshots": [ { ...full price_snapshots row... } ],
"price_tombstones": [ { "round_number": 900120, "coin_pair": "BTC/USD" } ],
"capability_snapshots": [ { "snapshot_block": 900120, "capability": "cross_chain", "signing_pubkey": "...", "amount": "..." } ]
}
matches[]rows carry every wire-relevantcross_chain_matchescolumn:match_id,snapshot_block,network, both legs (a_*/b_*includingkind/filled_before),effective_time,validator_signatures(the raw JSON string, verbatim), andstatus(finalizedorretracted). Hub-side audit columns (batch_root,anchor_txid) are excluded.bridge_transfers[]is sorted bytransfer_idascending. Fixed row key order:id, transfer_id, snapshot_block, network, src_chain, src_action_index, src_address, dest_chain, dest_address, tick, decimals, amount, effective_time, admit_block_btc, admit_block_ltc, admit_block_doge, finalizing_view, validator_signatures, status.policy_snapshots[]is sorted bysnapshot_idascending. Fixed row key order:id, snapshot_id, snapshot_block, network, origin_chain, tick, policy_seq, origin_block, policy_hash, allow_list, block_list, sleeping, effective_time, admit_block_btc, admit_block_ltc, admit_block_doge, finalizing_view, validator_signatures, status. A follower and recovery recomputepolicy_hashfromallow_list,block_listandsleeping; the recomputed hash, archived hash and signed canonical must agree.state_checkpoints[]is sorted by(chain, network, checkpoint_seq)ascending. Fixed row key order:id, chain, network, block_index, block_hash, ledger_hash, actions_hash, contract_hash, checkpoint_seq, snapshot_block, state_root, state_root_version, block_merkle_root, block_merkle_version, validator_signatures.price_snapshots[]is sorted by(round_number, coin_pair)ascending. Fixed row key order:id, round_number, coin_pair, price, reference_block, reference_chain, block_timestamp, validator_count, consensus_round, consensus_proof, status, source_chain, source_action_index, batch_block_time, admit_block_btc, admit_block_ltc, admit_block_doge. Before co-signing, a hub signature-verifies each group whoseconsensus_proofis a non-empty signature array against the archivedpricecapability group atreference_block. For an object-form batch proof or an empty proof array, the hub instead requires every row to byte-match a row it holds. Recovery signature-verifies both non-empty signature-array groups and object-form batch proofs; a batch proof is checked over its complete signed round range against thepricegroup at itsbtc_block_height. An empty-arrayskippedrow has no per-row signatures to verify, so recovery shape-checks it and relies on the archive wrapper quorum. Adisputedrow follows the rule for the proof shape it carries.price_tombstones[]is sorted by(round_number, coin_pair)ascending. Fixed row key order:round_number, coin_pair. A tombstone deletes that key during recovery; a later archive may restore it with a republished round.- The five keys above are additive, appear after
rewardsand beforecapability_snapshotsin exactly the order shown, and are emitted only when non-empty. Recovery treats any missing key as an empty list, preserving the exact bytes and meaning of archives published before the keys existed. - Archived rows exclude
push_generation,btc_chain_id,created_at,state_checkpoints.anchor_txidand every hub-side archive bookkeeping column. Integer columns are JSON numbers; nullable canonical fields remain either their stored value ornull. capability_snapshots[]carries the complete capability group for every referenced block:cross_chainfor each match, bridge transfer and policy snapshotsnapshot_block;oracle_publishfor each state checkpointsnapshot_blockand the wrapper checkpoint’sSNAPSHOT_BLOCK; andpricefor each non-empty signature-array price round’sreference_blockand each object-form batch proof’sbtc_block_height. Completeness is checked before a hub co-signs. The rows are included because historicalmin_stakegovernance values are not on-chain, so archiving them makes signature re-verification self-contained during recovery. Recovery additionally cross-checks archived pubkeys against on-chain BTC stakes (a fabricated snapshot row cannot survive, staking is on-chain), so the chain remains the root of trust.rewards[]carries the anchor-publish reward rows (reward_typeanchor_bundle/anchor_archiveonly) that have not yet ridden an archive. These are the onevalidator_rewardsrail a chain parse cannot re-derive (attest_feerows are derived deterministically from ATTEST actions, no consensus rail mintsoracle_roundrows today (see COLLECT), and neither type is ever archived: recovery rejects an archive that claims them). Reward rows carry no per-row signatures; every co-signing hub instead re-derives each field before signing: the pubkey must be in its ownoracle_publishresolution atblock_index, the amount must equal its configured publish reward, andsourcemust match its own block-scoped indexer resolution of the earn-time staking address (pinned into the archive because recovery restores rewards into an EMPTY BTC DB, and a later re-stake of the pubkey must not move the credit).block_indexis the quorum-agreedSNAPSHOT_BLOCKof the rewarded checkpoint, so every hub records identical row bytes.- All amounts are decimal strings (full precision, as stored).
- A match retracted after it was archived is re-published in a later batch with
status:"retracted". Recovery applies latest-status-wins ordered bybatch_seq. callsandrewardsare also additive keys: archives published before each existed simply omit them, and recovery treats a missing key as an empty list.
Rules
All versions
- Valid only where
COIN = DOGE, indexers on other chains mark the action invalid. - Mined below the network’s
ANCHOR_ACTIVATIONheight (see Activation), an anchor of ANY version isinvalid: ANCHOR before activation. At or above it, a version byte other than 0, 1 or 2 isinvalid: VERSION (unknown), unless the network is also at or above its ownANCHOR_FOLD_ACTIVATIONheight, in which case 3 is valid too (see Version 3 only). - No XCHAIN fee and no native-coin protocol fee (validator protocol action, same fee treatment
as
PRICEv0). The publisher pays only the DOGE miner fee.
Version 0 / 1
These rules apply verbatim to each chain section of a v3 (a v3 section is a v0 section), with
one addition for the section a v3’s WRAPPER_SECTION_INDEX names; see
Version 3 only.
CHAINmust be one ofBTC/LTC/DOGE;NETWORKmust equal the indexer’s own network.- Each
PUBKEY_nis checked against theoracle_publishcapability snapshot at its signature’s snapshot block (a BTC height; non-BTC indexers resolve it from the hub-mirroredcapability_snapshotstable, exactly as cross-chain settlement resolvescross_chain). For a v0 or v3 section that block is the section’s ownSECTION_SNAPSHOT_BLOCK. - Each
SIG_nmust Ed25519-verify against the canonical message. - Valid signatures must reach the snapshot set’s federation quorum, and which rule that is
depends on the section’s own snapshot block:
- At or above
STAKE_WEIGHTED_QUORUM_ACTIVATIONthe quorum is STAKE-WEIGHTED and SOURCE-DEDUPLICATED. Each valid signer’s pubkey resolves to its stake source in the snapshot; sources are counted at most once however many of their keys sign, and their summed staketallymust satisfy3 x tally > 2 x S, whereSis the total stake of the snapshot set summed over distinct sources. A source whose snapshot weight is missing fails closed. Three equally weighted sources therefore need all three signatures; two are not enough. The predicate ismeetsStakeThresholdinprotocol/reference-impl/consensus/stake_weighted_quorum.js. - Below activation the quorum is the legacy signer COUNT
max(2f+1, ceil((N+1)/2)),f = floor((N-1)/3): PBFT2f+1floored at a simple majority, so N=3 requires 2 and single-validator sets require 1. The floor is what stops bare2f+1degenerating to a quorum of 1 at N=3.
- At or above
CHECKPOINT_SEQmust be ≥ any previously accepted seq for (CHAIN,NETWORK), replays of older checkpoints are recorded but flaggedstale, nevervalid. Equal-seq records are accepted: an exact replay is signature-bound to identical content (harmless duplicate). The same ≥ rule applies toMATCH_BATCH_SEQon v1 and on a v3 that carries an archive section. The checkpoint replay watermark counts v0/v1/v3 together, per chain.- From
ANCHOR_CHECKPOINT_SEQ_BIND_ACTIVATION, evaluated against the ANCHOR’s own DOGE block height, with its status on Flag-Day Values, every v0 section, every v3 fold section, and every v1 head must carry aCHECKPOINT_SEQequal to its own snapshot block (SECTION_SNAPSHOT_BLOCKon a section,SNAPSHOT_BLOCKon a v1 head). Both must be canonical safe integers: decimal digits, no leading zero, and at mostNumber.MAX_SAFE_INTEGER. A failing record is invalid withCHECKPOINT_SEQ (not a canonical safe integer),SNAPSHOT_BLOCK (not a canonical safe integer), orCHECKPOINT_SEQ (does not match SNAPSHOT_BLOCK). At or above the gate, theCHECKPOINT_SEQandMATCH_BATCH_SEQreplay watermarks count only records stored valid, so a refused or stale record never raises them. Anchors mined before the activation keep the earlier acceptance.
Version 0 only
SECTION_COUNTmust be at least 1 and must equal the number of sections actually present.- From
ANCHOR_BUNDLE_ORDER_ACTIVATION, evaluated against the ANCHOR’s own DOGE block height, sections MUST beCHAIN-ascending and each section’s(PUBKEY, SIG)pairs MUST bePUBKEY-ascending; see Flag-Day Values. Equal adjacent values satisfy the ordering comparison, so ties are allowed, although a repeated chain still fails the separate duplicate-chain rule. A descending chain fails asSECTION i CHAIN (not ascending), and a descending pubkey fails asSECTION i PUBKEY (not ascending) at index k. Below the gate, historical bundles retain the earlier order acceptance. SNAPSHOT_BLOCKmust equal the MAX of the sections’SECTION_SNAPSHOT_BLOCK.- Every section must carry roots:
STATE_ROOTandBLOCK_MERKLE_ROOTmust be 64-hex and the two version bytes must be integers. Both roots are inside the signed canonical, so a swapped root fails that section’s signature check. - Each section is verified independently against its own canonical, rebuilt with the header
NETWORKand the section’s ownSECTION_SNAPSHOT_BLOCK. The stored network on every section row is the header’s. - One bad section invalidates the whole bundle (
invalid: SECTION n <reason>) and no reward is written. The publisher signed for all of the sections, and the stale-seq guard is strictly-less, so the only way a section can be stale is replay or forgery, never a lagging chain. PUBLISHERmust be 64-hex. The attestation list (APUBKEY_n/ASIG_n) is verified as a SECOND quorum over theXANCPUBcanonical against theoracle_publishsnapshot at the bundle’sSNAPSHOT_BLOCK, reaching the same threshold as the section quorum above: stake-weighted and source-deduped at/aboveSTAKE_WEIGHTED_QUORUM_ACTIVATION, otherwise the legacymax(2f+1, ceil((N+1)/2))signer count.- One reward per
(NETWORK, SNAPSHOT_BLOCK)cycle, not one per section or physical bundle: a COLLECT-spendablevalidator_rewardsrow keyed by the network’s(SNAPSHOT_BLOCK, anchor_bundle), amount = the frozenANCHOR_REWARD_AMOUNT, never the wire, credited only when every section’s quorum passed, the attestation quorum is met, andPUBLISHERis in the snapshot set. A failed, short, or forged attestation never invalidates the anchor: the checkpoints still record asvalidand only the reward is skipped, deterministically across the fleet. A failover double-publish converges to the smallest-pubkey winner, so the COLLECT rail stays single-winner. A byte-budget split repeats the same attestation on each physical bundle and deduplicates to this one row. - The trusted, unauthenticated
pushvalidatorrewardsreward push is retired foranchor_bundle: every indexer DERIVES the reward from these bytes instead.
Version 1 only
-
From
ARCHIVE_MATCH_COUNT_ACTIVATION, evaluated against the v1 head’s DOGE block height,MATCH_COUNTmust equal the decompressed archive’smatches.length; see Flag-Day Values. For a single-chunk head the comparison runs immediately after the CRC check, and a mismatch isinvalid: MATCH_COUNT (archive mismatch). For a multi-chunk archive the comparison runs after successful reassembly, and a mismatch marks the reassembled batchinvalid_archive. Below the gate, historical heads retain the earlier CRC-only archive check. -
BATCH_CRC32must match the CRC32 of the uncompressed JSON (checked at reassembly when chunked). -
MATCH_BATCH_SEQmust be ≥ any previously accepted batch seq for the network. -
PUBLISHERis always present, and the attestation list (APUBKEY_n/ASIG_n) follows the v0 rules verbatim, over the archiveXANCPUBcanonical: a SECOND quorum against theoracle_publishsnapshot atSNAPSHOT_BLOCK.ATTEST_SIG_COUNTMAY be 0, which means the attestation round degraded, not that the anchor is malformed: the checkpoint and archive still indexvalid, and only the reward is skipped. -
When the attestation quorum is met, the credited row is keyed
(MATCH_BATCH_SEQ, anchor_archive), amount = the frozenARCHIVE_REWARD_AMOUNT, never the wire. Reward derivation is additionally gated by theARCHIVE_REWARD_ACTIVATIONflag-day (per network, onSNAPSHOT_BLOCK): below it, a v1 stores its checkpoint and archive asvalidexactly as above it does, but never derives ananchor_archivereward even with a full attestation. A failed, short, forged, or below-flag-day attestation never invalidates the archive anchor; only the reward is skipped. -
The
pushvalidatorrewardspush is retired foranchor_archive: every indexer DERIVES the archive reward from these bytes instead (closing the last insider-with-key forge surface).
Version 2 only
MATCH_BATCH_SEQmust reference a previously indexed v1 withTOTAL_CHUNKS> 1 (out-of-order arrival within the same block is tolerated; the batch assembles when all chunks are present).CHUNK_INDEXmust be in[1, TOTAL_CHUNKS-1]and not a duplicate.- The chunk’s source address must equal the head’s: “authenticated by its parent v1” is enforced, so only the publisher whose batch it is can fill a slot.
- Carries no signatures; a v2 is meaningful only joined to its authenticated v1. A chunk
whose publisher has no head for the seq yet is stored
orphan, and the head-side check picks it up when that head lands. - A batch is judged only once every index
1..TOTAL_CHUNKS-1is present in the head publisher’s chunk set. The reassembled bytes are then checked against the head’sBATCH_CRC32(and, fromARCHIVE_MATCH_COUNT_ACTIVATION, itsMATCH_COUNT); a mismatch flags the batchinvalid_archive, and recovery ignores a batch flagged that way. - A batch that never assembles is never stamped. Its head keeps its
validorunverifiedstatus, its early chunks stayorphan, and recovery reports it as an incomplete batch and skips it, so a query forinvalid_archivedoes not find it. ThegetarchiveanchorRPC’schunks_presentandchunks_completefields report which chunk indexes a head has on-chain, for a publisher resuming a partial publish.
Archive batch identity
MATCH_BATCH_SEQ is not unique: an equal seq is accepted (re-broadcast, failover
double-publish), so more than one head can carry it. On every network an archive batch is
identified by (MATCH_BATCH_SEQ, head source address), not by the seq alone:
- a chunk’s parent is the earliest head for that seq authored by the same address,
TOTAL_CHUNKS, slot occupancy andBATCH_CRC32reassembly are all evaluated within that publisher’s own batch, and- a chunk whose publisher has no head for the seq is an orphan.
Keying the batch on the seq alone would let anyone deny a batch by broadcasting a junk head
at the next seq: its TOTAL_CHUNKS would invalidate every legitimate chunk, and its address
would become the only one whose chunks count. A publisher publishing one head per seq sees
the same result under either key.
Version 3 only
SECTION_COUNTmust be at least 1. Zero is never legal in v3: it describes an unsigned empty fold rather than a checkpoint bundle. At or aboveANCHOR_EMPTY_FOLD_REJECT_ACTIVATION, an empty fold isinvalid: SECTION_COUNT (empty fold). Nonempty chain sections follow the v0 rules verbatim (CHAIN-ascending order, no duplicate chain,PUBKEY-ascending pairs within a section, roots required,SNAPSHOT_BLOCKequal to the MAX of the sections’SECTION_SNAPSHOT_BLOCK). A bad checkpoint section still invalidates the whole action (invalid: SECTION n <reason>), exactly as for a v0.ARCHIVE_COUNTmust be 0 or 1. Any other value, or a value that disagrees with whether an archive section is actually present on the wire, isinvalid: ARCHIVE_COUNT. A v3 withARCHIVE_COUNT0 carries no archive fields at all and is a plain folded checkpoint bundle; this is the normal outcome when the archive co-signers miss their sub-deadline, and it never delays or invalidates the checkpoint sections.WRAPPER_SECTION_INDEXis required and checked whenARCHIVE_COUNTis 1. It must be a valid 0-based index into this same v3’s ownSECTION_COUNTsections (0 <= WRAPPER_SECTION_INDEX < SECTION_COUNT); out of range isinvalid: WRAPPER_SECTION_INDEX. The named section’s(PUBKEY, SIG)pairs are verified against the EXTENDED canonical (its own v0-shaped checkpoint canonical with the archive fields appended; see Canonical signing message) rather than the plain checkpoint canonical every other section in the bundle signs. A named section whose signatures fail the extended canonical fails that section’s verification (invalid: SECTION n <reason>), which under the pre-ARCHIVE_SECTION_VERDICT_STATE_HASH_ACTIVATIONrule below takes the whole action with it, and at/after it invalidates only that section (a checkpoint section, not the archive) exactly as any other bad checkpoint section would.- When
ARCHIVE_COUNTis 1,MATCH_COUNT,BATCH_CRC32andTOTAL_CHUNKSfollow the v1 rules verbatim:MATCH_COUNTmust equalmatches.lengthafter decompression (checked at reassembly when chunked),BATCH_CRC32must match the CRC32 of the uncompressed JSON, and overflow rides v2 continuation chunks tied byMATCH_BATCH_SEQto this v3 exactly as to a v1 head (including the archive batch identity rule above). - Verdict scope is gated by
ARCHIVE_SECTION_VERDICT_STATE_HASH_ACTIVATION, evaluated at the sameSNAPSHOT_BLOCKasANCHOR_FOLD_ACTIVATION. Below it, a bad archive section (a reassembled archive that fails its CRC orMATCH_COUNTcheck, or aWRAPPER_SECTION_INDEXsignature that fails the extended canonical) invalidates the WHOLE v3 action, checkpoint sections included: the v0 one-bad-section rule extended to treat the archive as one more section. AT OR ABOVE it,setAnchorArchiveStatusstamps ONLY the archive row (selected bymatch_batch_seq IS NOT NULL AND version <> 2); every checkpoint section keeps whatever verdict its own signatures earned, so a late chunk CRC failure can never retroactively invalidate a checkpoint a light client already consumed. A bad CHECKPOINT section always invalidates the whole action in both eras; only the archive’s OWN failures are, or are not, section-scoped. An orphaned or missing continuation produces no verdict in either era: the batch never assembles (see Version 2 only). - One reward for the whole
(NETWORK, SNAPSHOT_BLOCK)cycle, whatever the split count orARCHIVE_COUNTis. ThePUBLISHERand attestation tail sign the sameXANCPUB|anchor_bundle|...tuple a v0 bundle signs (see Publisher-attestation canonical), reaching the same quorum threshold as the section quorum above; a credited row is keyed(SNAPSHOT_BLOCK, anchor_bundle), exactly as for a v0, whether or not an archive section rode along or the cycle required multiple physical bundles.anchor_archiveretires as a reward type atANCHOR_FOLD_ACTIVATIONwhenANCHOR_ARCHIVE_FOLD_TERM_ACTIVATIONis also active, but only where both gates are active on the BTC snapshot and DOGE landing planes described in Archive reward termination. No v3, folded or not, ever mints ananchor_archiverow, because one election now covers the whole action. History below the active term boundary is unaffected and stays readable, andARCHIVE_REWARD_AMOUNTstays frozen for those legacy rows. A network that leaves either gate unarmed keeps deriving and provinganchor_archivethrough v1 exactly as before.
Effects
- Persists into
anchor_actions, keyed(action_index, section_index)and rolled back on reorg like any data table. A v1/v2 is one row atsection_index0; a v0 writes one row per section, all sharing the bundle’saction_index, each carrying its own chain, block index, checkpoint seq, roots and signatures, so every per-chain reader is unchanged. A v3 needs no schema change: it writesSECTION_COUNTchain rows exactly like a v0’s, plus, whenARCHIVE_COUNTis 1, one further archive row atsection_index = SECTION_COUNT. The row attributes distinguish the family (chain IS NOT NULLfor a chain row,match_batch_seq IS NOT NULL AND version <> 2for an archive row), never the version byte alone, since a folded action is both at once. - A
validv0/v1/v3 records the checkpoint; the indexer’s mirroredstate_checkpointscopy is the live source for verification APIs, whileanchor_actionsis the permanent on-chain record. - No ledger effect. ANCHOR never credits, debits, escrows, or alters token state. A bad or missing anchor can never corrupt balances; the worst failure mode is a missing audit/recovery record.
Publisher
- Published by the hub’s
StateAnchorPublisher. One election per(NETWORK, SNAPSHOT_BLOCK)cycle: the cycle’s pending checkpoints for a network are grouped into one logical bundle, split into multiple physical bundles only when required by the byte budget, and elect a single publisher from theoracle_publishcapability snapshot at the cycle’sSNAPSHOT_BLOCK, ordered bySHA256(XANCV7|NETWORK|SNAPSHOT_BLOCK ‖ pubkey)ascending (the attestation responsible-set idiom; the internal round-id tag staysXANCV7even though the wire’s checkpoint-bundle version byte is now0, because the tag is not on chain and permuting it would reorder every hub’s failover rank mid-rollout). One validator therefore pays for the whole cycle, including every physical bundle in a split, instead of a different one winning each chain. Rank 0 publishes from its own funded DOGE wallet; each further rank unlocks afterANCHOR_ELECTION_TOLERANCE_BLOCKSmore BTC blocks elapse without a publish (deterministic failover ladder; a gossipedXANC_BUNDLE_DONEback-fill carries the txid and the section list, so peers stamp every section and nobody re-anchors a cycle someone already paid for). The v1/v2 archive round elects a single leader the same way (its own internal round-id tag staysXANCV1), keyed per election block. A single-validator federation degenerates to today’s serialized single-wallet behavior.
flowchart TD
A["Pending checkpoints for one network<br>(all chains, this cycle)"] --> B["Elect ONE publisher: oracle_publish snapshot at the cycle's snapshot_block,<br>ordered by SHA256(XANCV7 key ‖ pubkey) ascending"]
B --> C["Rank 0 publishes the cycle's v0 bundle or split bundles<br>from its own funded DOGE wallet"]
B -.->|"same election, keyed per election block"| I["v1/v2 archive round<br>elects a single leader"]
C --> D{"XANC_BUNDLE_DONE gossiped<br>before next rank unlocks?"}
D -->|"yes"| E["Peers stand down and stamp<br>every section, no re-anchor"]
D -->|"no, after ANCHOR_ELECTION_TOLERANCE_BLOCKS<br>more BTC blocks"| F["Rank 1 publishes"]
F --> G{"XANC_BUNDLE_DONE gossiped?"}
G -->|"yes"| E
G -->|"no, after ANCHOR_ELECTION_TOLERANCE_BLOCKS<br>more BTC blocks"| H["Rank 2+ unlocks<br>(ladder continues)"]
- Each successful cycle records an
anchor_bundle(round = the cycle’ssnapshot_block) oranchor_archive(round =batch_seq) reward ofANCHOR_REWARD_PER_PUBLISHXCHAIN (default 10) on thevalidator_rewardsrail, collectable on BTC viaCOLLECTlike oracle-round rewards. A split cycle earns one anchor_bundle reward and one XANCPUB attestation per (network, SNAPSHOT_BLOCK), not one of each per physical bundle. - P2SH encoding via the standard encoder pipeline.
- Default cadence: one v0 cycle per network plus pending v1/v2 archive batches per anchor
interval (
ANCHOR_INTERVAL_MS, default daily), or early whenANCHOR_MATCH_BATCH_SIZEmatches are pending. Checkpoint signing happens more often (hourly, mirror-only, no chain writes); the anchor commits the latest signed checkpoint of every chain at publish time. Operators can also trigger an immediate flush via the hub’s authenticatedanchorflushJSON-RPC method. - A chain missing from a bundle is normal, not an error. It means either that its newest eligible checkpoint is already anchored, or that its checkpoint round did not run this cycle (a lagging indexer). Either way it rides the next bundle, and its absence never delays one.
Where the publisher constants come from
None of these is consensus data: they are per-hub operator knobs, and two hubs running
different values still produce mutually verifiable anchors. What follows is the derivation of
each magnitude, so a tuner can tell what is load-bearing from what is merely a round number.
The arithmetic is pinned by xchain-hub/test/unit/anchor/publisher/state_anchor_publisher_constant_derivations.test.js.
ANCHOR_CHUNK_MAX_BYTES (6000). The hard ceiling is MAX_ACTION_DATA_LENGTH = 8192
compiled bytes (protocol/constants.js). The decoder is the arbiter and silently drops any
action above it, so an oversize anchor is lost on every node rather than rejected loudly. Chunk
0 never travels alone: it sits inside the v1 head beside the checkpoint prefix (four 64-hex
hashes plus the chain/network/seq/index fields, about 322 bytes at mainnet heights) and the
signature lists, which cost 194 bytes per (PUBKEY, SIG) pair. The v1 head always carries the
PUBLISHER + ATTEST_SIG_COUNT tail, roughly 67 bytes plus another 194 bytes per attesting
signer (the attestation count may be 0 when the round degrades). So 8192 - 6000 - 322 leaves
about 1870 bytes of head budget, which is about nine signature pairs on a v1 with no
attestations, or four wrapper plus four attestation pairs at full quorum. That reserve is the
reason for 6000 rather than a figure nearer 8000. It constrains chunk 0 only (a v2 continuation
carries about 30 bytes of overhead and could hold far more), but a single uniform slice keeps
the splitter trivial. This is the knob to lower as the federation grows: a v1 with a 5+5
quorum needs ANCHOR_CHUNK_MAX_BYTES at or below about 5860, a 7+7 quorum about 5080. Raising
it saves v2 transactions but overflows the head first, and the encoder rejects the oversize v1.
The v0 bundle budget (8189 bytes). Not a knob: it is the same 8192-byte ceiling minus the
3-byte OP_RETURN push prefix the encoder adds, so the wire text IS the compiled size. A section
costs about 375 bytes of header and roots plus 194 bytes per (PUBKEY, SIG) pair, and the
publisher tail about 67 bytes plus 194 per attesting pair. At equal signer counts in sections
and tail that budget holds 6 chains at 4 signers, 5 chains at 5 signers, and 3 chains at 7
signers. A cycle that would overflow splits chain-ascending into as many bundles as fit rather
than dropping a chain, because the decoder silently drops an oversize action instead of
rejecting it loudly. This is the arithmetic to re-check when the federation grows.
ANCHOR_MATCH_BATCH_SIZE (200) and ANCHOR_MAX_BATCH (1000). The first is a latency
trigger, not a size cap: 200 pending rows flush an archive early instead of waiting out
ANCHOR_INTERVAL_MS, which bounds how much settled cross-chain state exists only in hub
databases. The second is the per-cycle SQL LIMIT and therefore the DOGE spend bound. Archived
rows are dominated by validator signatures and do not compress: roughly 0.55 KB of gzip+base64
per settled match, so 1000 rows is about 550 KB, about 93 chunks, about 93 DOGE transactions in
one cycle, while 200 rows is about 19. Both trade cost against archive latency and neither
changes what the archive means; too large spends more DOGE per cycle, too small drains the
backlog more slowly.
ANCHOR_ELECTION_TOLERANCE_BLOCKS (36). The unit is BTC blocks, not wall clock, precisely
so every hub computes the same rank unlock without clock synchronisation. 36 BTC blocks is about
6 hours at the 10-minute target, so each failover rank waits about 6 hours of elected-publisher
silence. The ordering is the load-bearing property:
signing round (120s) + DOGE burial (60 confs, ~1h) << 36 blocks (~6h) << ANCHOR_INTERVAL_MS (24h)
The left inequality keeps a healthy but slow rank-0 publisher from being overtaken, so the
federation never pays DOGE twice for the same checkpoint, and it keeps the on-chain
confirmation wait in the XANC_BUNDLE_DONE path well inside a single rank. The right inequality
means ranks 1 to 3 unlock at about 6, 12 and 18 hours, so up to three backups still get a slot
inside one publishing cycle and a dead rank 0 cannot cost a whole day of anchoring. Anything in
roughly 6 to 144 blocks (1 to 24 hours) preserves both bounds: below the DOGE burial window the
ladder burns DOGE on duplicate anchors, above about 144 a dead leader stalls a cycle. Neither
direction is a divergence risk, because concurrently unlocked publishers build byte-identical
archives; the cost of getting it wrong is DOGE or delay, never a fork. The same value bounds how
far a peer’s claimed election block may sit from the receiver’s own BTC tip when co-signing,
which is anti-spam only.
Recovery procedure (full-parse)
- Sync DOGE through the decoder/indexer from genesis:
anchor_actionspopulates from the chain alone. - Run
xchain-indexer/bin/recovery.js --skip-stake-verification --i-understand-unverified: reassembles chunked batches byMATCH_BATCH_SEQ, gunzips, verifiesBATCH_CRC32, verifies each archived row’s signatures against the archivedcapability_snapshots, and rebuilds these seven quorum-class hub-mirror tables:cross_chain_matches,cross_chain_calls,capability_snapshots,bridge_transfers,policy_snapshots,state_checkpoints, andprice_snapshots. Latest-status-wins applies where rows can change, andprice_tombstones[]removes retracted price keys. Recovery also restores archivedrewards[]rows into the BTC indexer DB’svalidator_rewards(seeding the id maps is safe pre-reindex, they are append-only get-or-create). Recovery rebuildsstate_checkpointsfrom the archive’sstate_checkpoints[], which carries every archived row rather than only the stride-eligible rows selected for v0 sections. The v0 sections themselves remain on chain inanchor_actions. - Reindex BTC/LTC/DOGE from genesis against the recovered tables. The reindex derives
bridge_settlementsandxbridgesfrom the rebuilt hub-mirror rows rather than recovery writing those derived tables directly. Cross-chain settlements, XCALL injections,attest_feerewards (nooracle_roundrows are minted today), and historical COLLECT claims all re-derive identically; finalblockshash triples must match the anchored checkpoints.
flowchart TD
S1["Step 1: Sync DOGE via decoder/indexer from genesis<br>anchor_actions populates from the chain alone"]
S2["Step 2: Run recovery.js with --skip-stake-verification --i-understand-unverified<br>reassemble chunked batches, verify CRC32 and signatures,<br>restore rewards into the BTC indexer DB's validator_rewards"]
S3["Step 3: Reindex BTC/LTC/DOGE from genesis<br>against the recovered tables"]
S1 --> S2
S2 -->|"must complete first, COLLECT validation reads validator_rewards at parse time"| S3
Ordering is load-bearing: the reward restore (step 2) MUST complete before the BTC reindex
(step 3); COLLECT validation reads validator_rewards synchronously at parse time, so a
reindex that reaches a historical COLLECT before its anchor rewards are restored replays it
invalid: no unclaimed rewards and the recovered ledger diverges. The stake cross-check is ON by
default and requires BTC_INDEXER_DB_NAME; against the empty pre-reindex BTC DB it would fail
every batch, so the writing reward-restore pass explicitly opts out with
--skip-stake-verification --i-understand-unverified (a bare --skip-stake-verification is forced
to a dry run). AFTER the BTC reindex, run a verifying pass with --dry-run (stake cross-check
default-on) to confirm every archived validator set is backed by real on-chain stake.
Notes
SNAPSHOT_BLOCKis distinct fromBLOCK_INDEX:BLOCK_INDEXis the checkpointed height onCHAIN;SNAPSHOT_BLOCK(andSECTION_SNAPSHOT_BLOCK) is always a BTC height (capability staking is BTC-only).- The handler reads
BLOCK_INDEX/SNAPSHOT_BLOCKfrom the wire payload. Not from the DOGE block the ANCHOR lands in. - Checkpoints for a reorged height are simply re-signed and re-anchored for the canonical
chain; the superseding record has a higher
CHECKPOINT_SEQ. - Retired version history. The original one-chain-per-anchor checkpoint wires were versions
0, 3, 4 and 5; version 7 later replaced all four as the single checkpoint-bundle wire, with
version 6 as its archive-attestation counterpart to the original tail-less version 1. That
whole version set (0, 1 without a tail, 3, 4, 5, 6, 7) is retired by the
ANCHOR_ACTIVATIONrule above, not by an unknown-version rejection: every one of those anchors was mined below its network’s activation height, so it indexesinvalid: ANCHOR before activationregardless of which of those version bytes it carries. The version set then restarts clean at the activation height with this document’s 0 (checkpoint bundle), 1 (archive head, tail always appended) and 2 (continuation, unchanged); a version-0 wire mined below activation is never confused with the new checkpoint-bundle format, because it fails on height before format dispatch ever runs. No publisher emits the retired wires and no indexer parses them as anything but a pre-activation record. Beyond the restarted 0 and 1, the only retired number reused is 3, by the v3 fold:ANCHOR_FOLD_ACTIVATIONalways sits at or aboveANCHOR_ACTIVATION, so a retired version-3 wire still fails on height before format dispatch. Retired 4 to 7 are not reused.
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.