Storage modes and checkpoints

Status: on Arctic. Nothing is pruned yet: Arctic's checkpoint list holds only its genesis block. Pruned nodes serving each other is planned.

A node checks every Zuring proof when its block arrives. After that, it doesn't need to keep the proof to stay a full node. state.storage_mode chooses what it keeps:

ModeKeepsCan't serve
archiveeverything—
standard, the defaultevery transaction; but for blocks at or below the latest checkpoint, only the digests of their Zuring witnesses (Δ and the proof)those blocks and transactions in raw form
prunedas standard, and it also deletes old raw transaction bytes outside a retention windowraw history outside the window

Pruning is one-way: a node won't reopen its database in a mode that keeps more. To go back, sync again from genesis.

What a pruned transaction keeps

A pruned Styx transaction keeps its txid, its authorizing digest, its signature hashes, its weight and its lookup entries. Only Δ and the proof go, each replaced by its 32-byte digest. A payment on an open channel shrinks from 9,464 bytes to 856. Wallets sync and spend through a pruned node as through an archive.

Serving pruned history

  • A node advertises only the blocks it holds in full. A peer that asks for a pruned block gets notfound, and fetches it from an archive.
  • getblock and getrawtransaction at verbosity 0 refuse pruned blocks and transactions. At higher verbosity, a transaction reports witnessPruned.
  • An archive keeps everything, so anyone can check pruned history without trusting checkpoints. Arctic's operator runs as one.

Checkpoints

A checkpoint list names block hashes that a new node syncs up to by hash, without checking their proofs or signatures; it validates every block above the last one in full. Arctic's list, checkpoints.txt, is taken more than 1,000 blocks below the tip, with a checkpoint at least every 400 blocks. The zakura-checkpoints tool extends it.

Checkpoints change how a node syncs, not which blocks are valid. A node that syncs by checkpoint trusts the list for the history below it, and an archive is how anyone can check that history.