Expand description
BLAKE3 verified-slice possession proofs for the storage-commitment audit (ADR-0002 round 2, V2-685).
The audit’s round 2 used to make a challenged peer return the complete original bytes of the sampled chunks (up to two 4 MiB chunks per response), at 5.8 to 6.2 MB per response measured in production. What that cost the fleet per day moved with the audit rate, not the response size, so frequency caps could move the daily total but never the cost of an individual audit. This module replaces the response shape instead: one opened 1 KiB block is a few KB rather than a full chunk, about 427x smaller, and that holds whatever the rate does.
Two axes move in opposite directions, and it is worth separating them. The
freshness construction gets strictly stronger: the nonce now enters every
block leaf, closing a preprocessing gap in the old flat nonced_hash. The
coverage gets weaker: round 2 samples blocks instead of checking every
byte. See “What a pass does and does not prove” below — that trade is the
whole design, not a footnote to it.
§Why two chains
A chunk’s address is BLAKE3(content) (its content hash), and BLAKE3 is
internally a Merkle tree over 1 KiB blocks, so a Bao verified slice proves
that a given block is the real content at a given offset against the address
the auditor already knows — content authenticity, for free, no full chunk.
But authenticity alone is checkable from purely public data (the address is
public), so a node that stores nothing could pass it by fetching the block on
demand from an honest holder. To bind possession at commitment time the
responder also commits, per leaf in round 1, a fresh nonced block tree:
a Merkle root over the same 1 KiB blocks whose leaves are keyed BLAKE3
hashes, keyed_BLAKE3(key=f(nonce ‖ peer ‖ key), block_index ‖ len ‖ block).
The nonce is fed as the BLAKE3 key, not a message prefix, so it mixes
into every chunk compression of every block leaf: there is no
nonce-independent chaining value a responder can precompute across audits.
(A plain BLAKE3(nonce ‖ … ‖ block) prefix would leave the block’s tail in a
second, nonce-free BLAKE3 chunk whose CV is precomputable, letting a node
store ~10.7% less than each block and still reconstruct the leaf for any
fresh nonce — a smaller version of the old flat-nonced_hash gap.) Building
the correct nonced_root therefore requires all of a chunk’s bytes at
round-1 commit time, and the auditor picks which block to open with fresh
randomness after the roots are committed (cut-and-choose): a responder
cannot connect a real, after-the-fact-fetched block to a garbage committed
root without a preimage break.
In round 2 the auditor verifies both chains over the same block bytes:
the Bao chain against the address (authenticity) and the nonced chain against
the round-1 nonced_root (possession). Either failing is a confirmed cheat.
§What a pass does and does not prove
This is a sampling check, and the strength claim should be read as such.
The auditor holds none of the audited bytes, so it cannot tell a correct
nonced_root from a responder-chosen one. A peer holding a fraction p of a
chunk’s blocks can commit a root built from real leaves for the blocks it
kept and arbitrary leaves for the rest, and it passes whenever every fresh
draw lands on a kept block. Per audit that is roughly p^leaves over the
3..=5 sampled leaves; the mandatory final-block opening pins the claimed
length but adds no detection, since a partial holder simply keeps the final
block.
So a pass means “held the sampled blocks at commit time”, and repeated audits drive the probability of sustained under-storage down geometrically rather than catching it outright on the first try. The full-byte round 2 this replaces caught any missing byte of a sampled chunk with certainty — that is the difference, and it is inherent: verifying every byte means moving every byte.
For p^leaves to describe detection rather than merely a pass, declining
to answer must not be cheaper than answering. The responder sees the drawn
blocks before it replies, so an unanswered round 2 following a valid round-1
proof revokes the holder credit for the commitment under audit (see
storage_commitment_audit::round2_revokes_pinned_credit). It stays in the
graced timeout lane and costs no trust, so an honest dropped reply is
harmless; what it removes is the option of holding credit while never
completing a possession check.
Be precise about the comparison, in both directions:
- Against a node under-storing in bulk — the realistic case, a node dropping data to save disk — detection is close to what the full-byte audit gave, at roughly 1/430 of the egress (measured about 427x on a same-network control cohort: 14.49 KB against 6.19 MB). A 990-node run caught a 256 MB in-place corruption on the first audit that reached the node.
- Against a fine-grained partial deleter, one shaving a little off every chunk, this is strictly weaker per audit than serving every byte. The compensating lever is audit frequency, which is exactly what the cost reduction buys: the old shape made frequent auditing unaffordable.
If a threat model ever needs sharper per-audit detection, the knob is openings per leaf, at linear egress cost.
Structs§
- Chunk
Opener - Reusable per-chunk responder state for building round-2 openings.
Constants§
- AUDIT_
BLOCK_ SIZE - Block size for slice audits: one BLAKE3 chunk (1 KiB). A block is the unit both the Bao authenticity proof and the nonced possession tree open on.
Functions§
- block_
count - Number of 1 KiB blocks covering
content_lenbytes. - block_
range - Byte range
[start, end)of blockindexwithincontent_lenbytes. - extract_
block_ slice - Extract a Bao verified slice for block
indexofcontent(responder, round 2). The slice carries the block bytes plus the O(log n) BLAKE3 parent hashes that verify it against the chunk address. - extract_
block_ slice_ with_ outboard - Extract a Bao verified slice for block
indexreusing a prebuiltoutboard. - nonced_
block_ root - Compute the nonced block-tree root over a chunk’s
content(responder, round 1). Requires every byte of the chunk, under the fresh nonce. - nonced_
block_ siblings - Sibling hashes on the path from block
indexup to the nonced root, bottom-up (leaf level first).Noneifindexis out of range for the tree. - nonced_
tree_ depth - Canonical sibling-chain length for a
block_count-leaf nonced tree. - verify_
block_ slice - Verify a Bao slice for block
indexagainst the chunkaddress(BLAKE3(content)), returning the verified block bytes (auditor, round 2). - verify_
nonced_ block - Verify a nonced block opening (auditor, round 2): recompute the block leaf
from the served bytes and fold it with
siblingsto the committednonced_root.