Expand description
Tamper-evident, append-only lineage commitments for tensor provenance, plus a zero-knowledge binding to verified linear-transformation proofs.
Companion to super::tensor_provenance (which tracks the parent→child DAG).
This module adds the integrity layer the audit calls for:
- Immutable, append-only lineage DAG. Each node is content-addressed by a
BLAKE3 commitment over
domain ++ parent_commitment ++ operation ++ params ++ data_bits. Any post-hoc edit to an ancestor’s data/operation changes that node’s commitment and therefore every descendant’s — so tampering anywhere in the lineage is detectable (verify_lineage). The DAG is append-only: the only way to extend it is to derive a new child; there is no in-place mutation path. - zk-transformation binding.
transformation_commitmentbinds(input, output, operation)cryptographically — the public witness. For a linear tensor map (provey = W·xwithout revealingW), the actual zero-knowledge proof is the real arkworks Groth16private_matrix_multiply(crate::zk_proofs/linear_algebra). General per-op zk-SNARKs over arbitrary tensor ops are a recorded boundary (each op needs its own R1CS circuit).
Heap note: like tensor_provenance, this is the cold, host-side provenance
layer (it walks a HashMap-backed graph and allocates small scratch Vecs for
sorting). It is off the zero-heap hot path — the hot numerical kernels are in
ode_advanced / ode_solver, which allocate nothing.
Structs§
- Lineage
Commitment - A 32-byte BLAKE3 commitment content-addressing a tensor state within its lineage.
Functions§
- commit_
state - Content-address a single tensor
stategiven its parent’s commitment (orNonefor a genesis/root state). The commitment binds the parent, the operation + its params (in deterministic key order), and the full data bits. - integrity_
root - A Merkle-style integrity root over a set of leaf commitments (e.g. all current head states): a single 32-byte digest witnessing the whole provenance frontier. Order-independent (commitments are sorted first).
- lineage_
commitment - Fold the lineage commitment for
state_idfrom the root down to the node. ReturnsNoneif the chain is broken (a referenced ancestor is missing). - transformation_
commitment - Bind an input state, an output state, and the operation that produced it into a
public 32-byte commitment — the witness a zero-knowledge transformation proof is
checked against. (For linear maps, the ZK proof itself is the real Groth16
private_matrix_multiply; this is the public binding it commits to.) - verify_
lineage - Verify that
state_id’s lineage reproducesexpected— i.e. nothing in the chain (data, operation, params, or structure) was altered after the commitment was taken.