Expand description
Proof-gated vector writes with Merkle-accumulating witness logs.
Provides cryptographic write admission gates for vector stores. Every
admitted write produces a WriteReceipt that commits the gate’s current
chain state. Receipts can be stored alongside vector index entries and
verified offline without re-querying the write source.
§Gate variants
| Gate | Per-write cost | Guarantee | Use case |
|---|---|---|---|
NullGate | ~0 ns | None (baseline throughput) | Development / test |
HashChainGate | ~200 ns | Sequential tamper-evidence | Agent audit logs |
MerkleGate | ~300 ns | MMR membership proofs + tamper-ev | RAG provenance |
§Example
use ruvector_proof_gate::{HashChainGate, WriteGate, WritePayload};
let mut gate = HashChainGate::new();
let payload = WritePayload::new(0, vec![0.1, 0.2, 0.3]);
let receipt = gate.admit(&payload).unwrap();
assert!(gate.verify_receipt(&receipt));
println!("root: {:?}", gate.chain_root());Structs§
- Hash
Chain Gate - Sequential SHA-256 hash chain.
- Merkle
Gate - Merkle Mountain Range (MMR) accumulator.
- Null
Gate - No-op gate that admits every payload with zero cryptographic overhead. Used exclusively to establish a throughput ceiling for comparison.
- Write
Payload - A vector write payload: the unit of admission through a WriteGate.
- Write
Receipt - Cryptographic receipt returned by a WriteGate for each admitted payload.
Enums§
- Gate
Error - Errors returned when a gate rejects an admission.
- Gate
Variant - Which gate variant produced a receipt.
Traits§
- Write
Gate - Core admission gate trait for vector writes.
Functions§
- synthetic_
payloads - Generate a deterministic synthetic dataset for benchmarks.