PQGrind Docs

State digest

Note

not yet available. This page is the proposed format; it is pending freeze and no indexer computes it yet.

Purpose

Two indexers agree if and only if their digests agree at every height. Publishing the digest per block lets anyone compare without exchanging the whole ledger.

Proposed format

After applying block h:

entries ← sorted list over U of:
              txid (32 bytes, display order)
            ‖ vout (4 bytes, big-endian)
            ‖ count (4 bytes, big-endian)            # number of ranges
            ‖ for each range: a (8 bytes BE) ‖ b (8 bytes BE)
          sorted by (txid, vout)

ledger_hash ← SHA256( concat(entries) )

digest(h)   ← SHA256(  "PQSB-STATE-v1"
                     ‖ h        (4 bytes BE)
                     ‖ hash(h)  (32 bytes, display order)
                     ‖ mints    (8 bytes BE)
                     ‖ burned   (8 bytes BE)
                     ‖ ledger_hash
                     ‖ digest(h − 1) )               # digest(H_start − 1) = 32 zero bytes

Chaining digest(h − 1) makes a single value at the tip commit to the whole history.

Open questions

  • Whether to include rejected candidates (with codes) in the digest. Including them catches disagreements in rejection reasons earlier.
  • Byte order of txid inside the digest (display order proposed, to match explorers).
  • Whether to publish every block or every n blocks.