Expand description
The store SIZE and the SIZE PROOF (SPEC §4) — the download-gating core of this crate.
A store anchors its .dig SIZE on chain so a client can decide, BEFORE downloading, whether the
artifact is worth fetching. The anchored size is a coarse power-of-2 bucket, not an exact byte
count — the smallest representation that still conveys magnitude (NC-8, minimal on-chain
encoding): a single exponent k ∈ 0..=10 mapping to 2^k MB, 1 MB..1 GB.
SizeBucket is re-exported VERBATIM from dig_merkle::SizeBucket — the ONE canonical owner
of the ladder AND the byte→bucket mapping (SizeBucket::for_byte_len) — so the encoding lives
in a single place and the on-chain (dig-merkle metadata "sz") and client-side (this proof)
views can never drift.
The SIZE PROOF is the client-side check: given the bucket the store anchored on chain (NC-9) and
the real byte length of a downloaded .dig, SizeProof::verify decides ACCEPT or DISCARD. A
.dig whose real size does not fall in the anchored bucket is rejected — a dig-node MUST NOT
store or serve it (SPEC §4, the discard rule).
Structs§
- Size
Bucket - A
.digstore size quantised to a power-of-2 bucket: exponentk ∈ 0..=10↔2^k MiB(1 MB..1 GB). See the module docs for the full ladder and the canonical unit (1 MB = 1 MiB). - Size
Proof - The client-side SIZE PROOF check (SPEC §4).
Enums§
- Size
Verdict - The verdict of a
SizeProof::verifycheck: whether a downloaded.digmay be kept.