@zanii/train
v0.2.0
Published
Training-data provenance: hash a training set into a sorted-Merkle manifest, then PROVE a named subject's data was absent from a real training run - a non-membership proof anyone can check offline. 'It was never used to train a model' becomes a yes, not a
Readme
@zanii/train
Training-data provenance & subject-absence proofs. The claim buyers actually want
is negative: "my data was never used to train your model." You can't prove that about
the whole world — but you can prove it about a declared run: commit the training set
to a sorted-Merkle manifest, then hand a data subject a non-membership proof their
ref is absent from it, checkable offline with no trust in the operator.
npm install @zanii/train @zanii/coreimport { buildManifest, manifestReceipt, proveAbsence, verifyAbsence } from '@zanii/train';
// the model operator commits the training set (refs are hashes/HMACs, never content):
const manifest = buildManifest({ runId: 'gpt-run-7', refs: memberRefs, createdAt: now });
await zanii.record(manifestReceipt(manifest)); // anchor it into the ledger
// a data subject asks "was my document in it?" — the operator answers with a proof:
const proof = proveAbsence(manifest, memberRefs, userRef); // throws if actually present
verifyAbsence(proof, manifest); // TRUE, verified by the subject, offlinePython: from zanii.train import build_manifest, prove_absence, verify_absence, ...
— byte-identical manifest roots (locked by a cross-language vector).
How the absence proof works
Sorted-set non-membership — the pattern the Zanii L1's SMT uses. Sort the member refs
and Merkle-commit the adjacency leaves (each member, and the gap to the next). To prove
x is absent, reveal the one gap (lo, hi) with lo < x < hi plus its inclusion
proof in the manifest: since the set is sorted and every gap is committed, a covering
gap that verifies means nothing sits between lo and hi — so x is not a member.
Membership (proveMembership) is the same machinery on a member leaf. Proofs use
@zanii/core's own inclusionProof/verifyInclusion, so they verify with the exact
primitive the ledger uses.
The limit, stated up front
This proves what was recorded in the manifest, not what a GPU secretly saw. An
absence proof is only as honest as the manifest is complete — pair it with an attested
enclave (@zanii/attest: the published image hash is the only code that touched the
data) so "absent from the manifest" also means "absent from the run." The manifest
commits refs, never content.
