pub struct RangeFrame {
pub offset: u64,
pub length: u64,
pub bytes: String,
pub complete: bool,
pub total_length: Option<u64>,
pub chunk_lens: Option<Vec<u64>>,
pub chunk_index: Option<u64>,
pub inclusion_proof: Option<String>,
pub root: Option<HexId>,
pub range_proof: Option<Vec<String>>,
pub first_chunk_index: Option<u64>,
}Expand description
One range frame of a resource. The first frame (offset == 0) carries the
per-resource verification metadata; later frames carry only the window.
Fields§
§offset: u64The window start offset (echoed).
length: u64This window’s byte length.
bytes: StringThis window’s ciphertext, base64.
complete: boolWhether this frame ends the resource.
total_length: Option<u64>The full resource ciphertext length. First frame only.
chunk_lens: Option<Vec<u64>>Per-chunk ciphertext lengths of the full resource. First frame only.
chunk_index: Option<u64>This frame’s chunk index. First frame only (0).
inclusion_proof: Option<String>Whole-resource merkle proof, base64. First frame only.
root: Option<HexId>The chain-anchored root (64-hex). First frame only.
Advisory ECHO only. A verifier MUST NOT trust this value: it substitutes
its OWN URN-pinned root when folding range_proof
and rejects any frame whose proof does not reach that pinned root
(NC-9 fail-closed).
range_proof: Option<Vec<String>>Per-chunk merkle inclusion proofs for the chunks this frame covers, in
ascending chunk order — present on ANY frame, unlike the first-frame-only
whole-resource inclusion_proof.
Each entry is base64 of an opaque per-chunk merkle proof blob (the
canonical node emits dig_capsule::MerkleProof::encode). This crate is a
pure level-00 wire type and MUST NOT depend on the merkle primitive, so
the proof stays an opaque string here; the consumer decodes each blob and
folds its leaf → the client’s PINNED root (never the peer’s echoed
root) to verify the chunk.
The server expands a requested byte range to the covering whole-chunk
span, so a frame’s chunks align with chunk_lens;
range_proof.len() equals the number of chunks in this frame and pairs
index-for-index with first_chunk_index...
first_chunk_index: Option<u64>The chunk index of the first chunk in this frame (0-based, into the
resource’s chunk sequence described by chunk_lens).
With range_proof.len() this pins each entry of
range_proof to an absolute chunk index, giving the
full byte↔chunk↔proof mapping.
Trait Implementations§
Source§impl Clone for RangeFrame
impl Clone for RangeFrame
Source§fn clone(&self) -> RangeFrame
fn clone(&self) -> RangeFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more