merkle batching - XibalbaTechSol/integrity-core GitHub Wiki
title: Merkle Batching & Anchoring Convention created: 2026-07-07 updated: 2026-09-15 type: concept tags: [cryptography, layer-2] confidence: high source_files:
- docs/INTERFACE_CONTRACT.md
Table of contents
Overview
Batches of approved BCC commitments are anchored on-chain as a
single Merkle root, verified by StateAnchor.sol in contracts.
- Hash function: keccak256 (not SHA-256) โ cheap and native in the EVM, since the root is verified on-chain.
- Leaf:
keccak256(abi.encodePacked(leafData)). - Parent: sort the pair of child hashes ascending before concatenating โ
keccak256(a < b ? a,b : b,a)โ the standard OpenZeppelinMerkleProofconvention. This lets on-chain verification useMerkleProof.verifydirectly instead of a bespoke verifier.
This is the one hashing convention every package touching Merkle
trees/proofs (contracts, integrity-oracle, bcc_middleware) must share
exactly โ a mismatch here silently breaks proof verification. See
Interface Contract ยง4.4.