Proof Chaining
Chain Proofs Together
Section titled “Chain Proofs Together”import { verify } from '@brivora/verify';
const verifier = await verify.createVerifier();const chain = verify.createChain(verifier);
// Each call adds to the chainconst r1 = await verify.govern(fn1, { governance: 'minimal', verifier, chain });const r2 = await verify.govern(fn2, { governance: 'minimal', verifier, chain });
// Verify the entire chainconst chainResult = await verify.checkChain( [r1.proof, r2.proof], verifier.publicKey);console.log(chainResult.valid); // trueconsole.log(chainResult.chain_integrity); // trueHow It Works
Section titled “How It Works”Each proof contains a previous_proof field linking it to the prior proof in the chain. This creates a hash-linked chain similar to a blockchain:
Proof 1 → Proof 2 → Proof 3 → ... ↑ root ↑ prev=hash(1) ↑ prev=hash(2)Chain verification:
- Verify each proof’s signature individually
- Verify each proof’s
previous_proofhash matches the prior proof - Verify the chain is complete (no gaps)
If any proof in the chain is tampered with, all subsequent proofs become invalid because their previous_proof hashes won’t match.