QueryProof wire format
Reference for the serialized shape of bbg::QueryProof — the proof object a
BBG read returns and a light client verifies. This is the schema seed for the
soft3 SDK's query wire protocol.
Serialization is behind the serde cargo feature in both bbg and
cyber-lens (bbg = { features = ["serde"] } enables the whole chain:
bbg → lens → hemera). The format is pinned by golden-fixture tests:
bbg/rs/tests/serde_wire.rs and lens/core/tests/serde_roundtrip.rs.
A format change breaks those tests; it cannot drift silently.
shape
QueryProof serializes as a struct of four fields (JSON shown; any serde
format works):
commitment—lens::Commitment, a newtype overhemera::Hash; serializes as a fixed 32-tuple of bytes.opening—lens::Opening, externally tagged enum (standard serde):{"Tensor": {...}},{"Folding": {...}}, or{"Witness": {...}}. BBG opens cells via Brakedown, so bbg-produced proofs always carryTensor.value_bytes— little-endian u64 encoding of the opened cell value.point— the hypercube corner (LSB-first) of the opened cell. Canonical encoding: deserialization rejects any element ≥ p, so each point has exactly one valid wire form.
Opening variants
Tensor = Brakedown / Ikat / Porphyry, Folding = Binius, Witness = Assayer.
root binding
QueryProof.commitment is the dimension commitment — one of the 14 leaves of
BBG_root (BbgState::root_leaves()). A verifier that also holds the root
checks root_from_leaves(leaves) == BBG_root and that leaves.dims[dim]
matches commitment; the proof then binds the opened value all the way to the
state root. BBG_root itself is a Particle ([u8; 32]) — four Goldilocks
limbs, little-endian — and needs no special serde.