Skip to main content

Module projection

Module projection 

Source
Available on crate feature projection only.
Expand description

Projectable self-authenticating records with projection soundness. Merkle membership proofs for projectable binary records.

verify binds the proof’s disclosed fields to a trusted external anchor. verify_query also requires exactly the caller’s field IDs; missing fields are rejected, not proven absent. verify_untrusted checks consistency only.

Security assumes BLAKE3 collision resistance, a trusted anchor, and a canonical source record. Hashes are not mathematical injective functions. Omitted payloads and their current storage contents are not inspected by a partial verifier. Payload semantics remain the application’s responsibility.

Field framing is field_id: u32 LE, length: u32 LE, then opaque bytes, with strictly increasing IDs. Domain-separated leaf and parent hashes bind the fields; a domain-separated outer hash binds the schema version.

For n fields and k disclosed fields, proofs contain O(k log(n/k) + k) sibling hashes. Verification also reads the disclosed payload and uses BTreeMap bookkeeping. Proof construction scans the record and builds an O(n)-space tree; these are not constant-memory or sublinear construction APIs.

Structs§

Projection
A projection query: an ordered set of field identifiers.
ProjectionLimits
Resource policy applied before allocation or parsing of projection data.
ProjectionProof
A self-contained projection proof (witness) for a query.
ProofLeaf
One field extracted by a proof, before type-specific decoding.
ProofSibling
One sibling hash needed to reconstruct the Merkle root.
Record
A parsed, validated self-authenticating record.
RecordBuilder
Canonical builder for self-authenticating records.
VerifiedField
A field whose authenticity and value were verified against the anchor.

Enums§

ProjectionError
Errors produced by the projection format.

Constants§

DEFAULT_MAX_FIELDS
Default maximum number of fields in one record.
DEFAULT_MAX_PAYLOAD_LEN
Default maximum payload length of one field.
DEFAULT_MAX_RECORD_LEN
Default maximum serialized record length.

Functions§

prove
Parses and proves in one step.
schema_root
Schema-binding root: H(SCHEMA_DOMAIN ‖ schema_version ‖ merkle_root).
verify
Verifies a proof against a trusted anchor and returns the queried fields.
verify_query
Verifies membership against a trusted anchor and requires exactly the caller’s requested field IDs. A missing field is rejected: this format carries membership proofs, not authenticated absence proofs.
verify_untrusted
Verifies a proof for internal consistency only.

Type Aliases§

FieldId
Stable application field identifier inside one record.