Reorganizations
Rule
State is a function of the best chain. When the best chain changes, an indexer MUST produce the state it would have produced had it only ever seen the new chain.
Reference behaviour
on each poll:
node_tip ← node.getbestblockhash()
if state.tip.height ≥ 0 and node.getblockhash(state.tip.height) ≠ state.tip.hash:
state ← EMPTY # discard everything
for h in state.tip.height + 1 … node.height:
APPLY_BLOCK(node.getblock(h), h)
Full replay is simple and deterministic; it costs time proportional to the chain since H_start. A per-block undo log would be faster and must give the same result.
Effects on mints
| Event | Result |
|---|---|
| A mint's block is replaced and the mint is not re-included | the mint and its units disappear; transfers that spent them disappear too |
| The mint is re-included in a later block | it is judged again with that block's D and the new count of earlier mints; it may now fail condition 3, 7 or 9 |
| A competing mint is included earlier on the new chain | ordering changes can move the schedule boundary and M_max cut-off |
Minters bear these risks. Bitcoin's own advice applies: wait for confirmations.
Reporting depth
How many confirmations an indexer reports before calling a mint "final" is pending freeze. The API currently reports raw confirmations; a final flag is not yet available.