Implementing the MMR receipts profile over a live log
Notes from building receipts to draft-ietf-scitt-receipts-mmr-profile-00 (formerly draft-bryce-cose-receipts-mmr-profile-04) and a Transparency Service to draft-ietf-scitt-scrapi-11. Offered in the hope they save other implementers time. Corrections welcome.
Cross-checks
Known-answer vectors, including complete signed receipts, are at /scitt/vectors.json.
1. Consistency checking does real work on its own
We changed an early entry and rebuilt the whole tree honestly from scratch, as a dishonest operator would. A verifier holding the earlier accumulator rejected the next receipt of consistency at the step where consistency paths must agree on the new peak (section 7.1.1), before the signature was checked. The shape requirements are not just hygiene.
2. Choose the leaf form deliberately (section 11.2)
The profile does not domain-separate leaves from interior nodes. We use
leaf = H(0x00 || tag || position (8 bytes BE) || entry digest)
which binds the position (so an empty inclusion path still fixes the index) and has a fixed pre-image length that can never equal an interior pre-image (8 + 32 + 32 bytes).
3. Bound proof sizes in verifiers
With 64-bit indices no valid inclusion path is longer than 63 elements, and consistency paths have exactly the lengths 7.1.1 implies. Our verifiers reject longer paths and more than 64 proofs per receipt before doing any hashing.
4. "Freezing" a busy log is unnecessary
Nodes are append-only and never change, so every complete MMR size is a snapshot. We generate the inclusion path against the current complete size while appends continue; the node it leads to is permanent even after a later peak buries it, so the receipt keeps verifying (sections 4 and 11.1).
5. Low-entropy entries can be confirmed by guessing
If an entry is a yes/no decision or similar, its leaf can be confirmed by hashing guesses. Where that matters, put a per-entry salt or nonce in the leaf pre-image (see the RFC 9943 privacy considerations).
6. The peak check in 5.1
A verifier holding a trusted size and accumulator "can additionally check that the proven node is the accumulator peak for the index at that size". The draft does not yet define the algorithm; univocity's peak_index does it and might usefully join section 9.
7. Key identifiers
Our receipts carry kid (label 4) as the RFC 9679 COSE Key Thumbprint of the service key, as SCRAPI recommends, and the key set is served at /.well-known/scitt-keys.
Where to test
Live Transparency Service: sebbi.pro/scitt · spec /x/scitt/spec · self-check /x/scitt/selfcheck · chain receipts /x/mmr/spec
vds 3 and tree-size-2 -65933 are the draft's requested and private-use values, used provisionally until IANA assigns them.