Merkle Construction
The evidence chain in a BrivoraProof is a Merkle tree constructed from governance evaluation artifacts. This page specifies the exact construction algorithm.
Leaf nodes
Section titled “Leaf nodes”Leaves are computed in this order:
- Hash of governance pack (name + version + rules)
- Hash of system state observation
- Hash of pre-evaluation results
- Hash of execution metadata
- Hash of post-evaluation results
- Hash of fidelity score
- Hash of evaluation result (
'PASS'|'FAIL'|'PARTIAL')
Each leaf is the SHA-3-256 hash of the canonical CBOR encoding of the corresponding data.
Construction algorithm
Section titled “Construction algorithm”- Hash function: SHA-3-256
- Tree type: Binary, left-to-right
- Padding: If odd number of nodes at any level, the last node is duplicated
- Internal node:
SHA3-256(left || right)where||is concatenation - Root: Single hash at the top of the tree
Example
Section titled “Example”For 7 leaves (L1 through L7):
Level 0 (leaves): L1 L2 L3 L4 L5 L6 L7 L7*Level 1: H12 H34 H56 H77Level 2: H1234 H5677Level 3 (root): H12345677* L7 is duplicated to make an even count.
Verification
Section titled “Verification”To verify a Merkle root:
- Recompute each leaf hash from the raw evidence data
- Reconstruct the tree bottom-up
- Compare the computed root with the proof’s
merkle_rootfield - If they match, the evidence chain has not been tampered with