Repository navigation
spec(vindex): count-bound value_root, freshness, pruning hook, and spec hardening - #207
Merged
mhutchinson merged 5 commits intoDec 2, 2026
Conversation
mhutchinson
force-pushed
the
feat/vindex-spec-improvements
branch
from
December 1, 2026 11:26
4e32a37 to
4bea7a2
Compare
Replace the bare RFC 6962 Merkle Tree Hash stored as each key's 32-byte
value_root in the MPT with a domain-separated, count-bound commitment:
value_root = SHA-256(0x02 || uint64_be(count) || value_mth)
An RFC 6962 MTH without a leaf count does not uniquely bind preceding
when verifying partial ranges against unexpanded compact range hashes
(for example, preceding=1 vs preceding=2^20 before a single trailing
leaf share the same popcount and right-spine merge shape). Binding
count into value_root:
- Prevents /values count spoofing on Page 1 and enforces cross-page
count continuity uniformly via NextPage() wrapping
(preceding, fold(compact_range)) with 0x02.
- Allows mpt_root in the witnessed Output Log to directly authenticate
pruned base-state compact-range snapshots without requiring separate
note signatures (incompatible with ML-DSA-44 log keys).
- Keeps MPT values fixed at 32 bytes with zero wire-format changes to
/keys or /values.
…ication Clarify two trust boundaries in Verifying the state commitment: - Document that index == output_size - 1 does not prove checkpoint recency or input log freshness, and recommend freshness checks (witness cosignature timestamps against replay, monotonic output_size/input_size for stateful monitors, and comparing input_size against an independent input log checkpoint to detect a stalled indexer). - Replace the conditional 'MUST ..., unless ...' phrasing for input log checkpoint consistency with a clear MUST/SHOULD split that explicitly states the reliance on independent auditors and entry retrieval integrity when skipping input log consistency checks.
mhutchinson
force-pushed
the
feat/vindex-spec-improvements
branch
from
December 1, 2026 11:54
4bea7a2 to
1b7f56f
Compare
…ive invariants
Tighten tlog-vindex specification and align Go validation:
- input-origin: cap at 1..255 bytes (wire.ValidateInputOrigin) and note
explicitly that internal spaces are permitted for legacy input logs
such as sum.golang.org ('go.sum database tree'), whereas
<output-log-origin> follows c2sp.org/tlog-checkpoint@v1.1.0 and
c2sp.org/tlog-cosignature@v1.1.0.
- split_bit: tighten upper bound from 8192 to 8191 in spec, READMEs,
and mpt.validateProofWireBounds (bit 8192 is unreachable for
1..1024-byte non-NUL canonical keys).
- Normative invariants: explicitly require monotonically non-decreasing
input-size across output log entries, contiguous suffix semantics on
/values responses, and canonical path_key + 32-byte path_val checks
in non-inclusion verification.
- HTTP interface: require 400 Bad Request on duplicate/unknown query
parameters, literal '+' characters (aligned in walkRFC3986Query), and
malformed percent-encoding; document optional gzip compression via
Accept-Encoding; standardize prose references to c2sp.org/tlog-*.
Pre-empt common C2SP review questions in tlog-vindex.md without changing normative behavior: - Document torchwood/mpt hash/wire compatibility for key padding and length-prefixed values, and note the MPT stays inline until a second C2SP consumer needs it. - Note that unpaginated /keys?prefix= does not preclude future paginated range/subtree extensions without changing mpt_root. - Add Design Rationale for 0x21..0x7E (1..1024 byte) canonical keys, including injective encoding guidance for arbitrary inputs. - Explain CDN coalescing of hot-key Page 1 /values requests via the short /keys TTL alongside long-lived continuation pages. - Replace the pre-1.0 Design Log note on map-fn with out-of-band binding to <output-log-origin> (matching tlog-cosignature) and make operator blame explicit for unsubstantiated input-root conflicts.
Specify minimal forward-compatible pruning semantics for /values while deferring the late-joining base-state snapshot format to a follow-up: - In ### values: require no pruning without an ecosystem retention policy; where pruned to horizon P (from <= P <= input_size), require 200 OK for before >= P (retaining each key's highest occurrence < P for gapless boundary verification), allow 410 Gone for from < before < P, and preserve 404 Not Found for before <= from. - In ## Design Rationale: explain why from stays immutable and how value-log + output-log pruning avoid origin/key/witness rotation, with count-bound value_root enabling future mpt_root-authenticated base-state snapshots. - In vindex/client: map HTTP 410 Gone on /values to typed ErrPruned (distinct from ErrVerificationFailed on 404).
mhutchinson
force-pushed
the
feat/vindex-spec-improvements
branch
from
December 1, 2026 15:37
1b7f56f to
25c6c79
Compare
patflynn
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-lock-in hardening of
c2sp.org/tlog-vindex(vindex/docs/tlog-vindex.md) and aligned Go implementation/tests across 5 self-contained commits:value_root(feat(vindex): bind value log leaf count into value_root):value_root = SHA-256(0x02 || uint64_be(count) || value_mth)./valuesprecedingcount spoofing, enforces cross-page count continuity uniformly viaNextPage(), and allowsmpt_rootto directly authenticate future pruned base-state snapshots without extra note signatures (compatible with ML-DSA-44 log keys).input-roottrust boundary (docs(vindex): clarify state commitment freshness and input-root verification):MUST/SHOULDsplit for input log checkpoint consistency.spec(vindex): tighten input-origin, split_bit, HTTP query, and normative invariants):input-originat 1..255 printable ASCII bytes (permitting spaces/+for legacy logs likego.sum database tree) and enforcec2sp.org/tlog-cosignature@v1.1.0rules on<output-log-origin>(wire.ValidateOutputOrigin).split_bitupper bound to0 <= b <= 8191, require400 Bad Requeston duplicate/unknown query params, literal+, and malformed%escapes (plushammerconformance probes), document optionalgzipnegotiation, and standardizec2sp.org/tlog-*prose references.docs(vindex): expand Design Rationale and HTTP caching notes):torchwood/mptwire compatibility, future paginated prefix extensibility, canonical key syntax trade-offs, CDN coalescing of hot-key Page 1/valuesrequests, out-of-band mapping semantics bound to<output-log-origin>, and explicit operator blame on unsubstantiatedinput-rootconflicts.spec(vindex): add 410 Gone pruning hook and ErrPruned client sentinel):410 Gone+ anchor-leaf retention semantics in### values,404vs410client verification rules,### Pruningrationale (deferring base-state snapshot format to a follow-up), and typedclient.ErrPruned.