forexiz
FIG. 09·4
Forexiz · Merkle commitments
Trust · Commitments · Live

Every fill,
every batch,
on Arbitrum.

ForexizCommitments is a strict-monotonic Merkle root publisher. Per-batch metadata: root, startTs, endTs, leafCount, archiveCid. The verifyAgainstBatch view settles any inclusion question.

Contractv1
0x66B78e5E54f0CB9e0C71BAc44372E8585f4d795B
Algo
OZ MerkleProof
Order
sorted-pair
Odd
dup last
Strict
monotonic
§ 02 · Live ledger
On-chain · Arbitrum One
Placeholder · awaiting svc envForexizCommitments · 0x66B7…795B
Latest batchSeq/ strict-monotonic
Published
Total batches
Total leaves
Algo
OZ MerkleProof
Pair order
sorted-pair

Live counter activates when NEXT_PUBLIC_COMMITMENT_API_URL is set. Until then, query the contract directly:

§ 03 · Leaf format
Canonical · centralized in fillLeafHash()

What gets
hashed.

One canonical leaf format, used by the on-chainverifyAgainstBatchview, the off-chain proof generator, and any third-party verifier. Same byte string for a given fill, no matter who serializes it.

fillLeafHash() · canonicalSolidity 0.8.27
leaf = keccak256(abi.encode(
  fillId,        // bytes32
  account,       // address
  symbol,        // bytes32
  side,          // uint8 (0=long, 1=short)
  size,          // int256
  fillPrice,     // uint256 (18-dec)
  feeBps,        // uint16
  filledAt,      // uint64 (unix seconds)
  signerKeyId    // bytes32 (key fingerprint)
))
§ 04 · Inclusion proof
4 leaves · 2 mid · 1 root

A Merkle proof
in three frames.

To prove leaf L02 is in the tree, you supply two siblings: L03 (its pair partner) and H00 (the other mid-hash). The verifier hashes L02 with L03 to get H01, then H01 with H00 to get a root candidate, and compares against ROOT.

Storage: O(log n) bytes per proof.
Verifier: pure view function, ~3k gas.
BatchSeq #0042 · 4-leaf treeHighlighted: proof for L02
ROOT · root
0x9ab1…fe0d
H00 · h00
0x4a3c…12fe
H01 · h01
0x8d2f…a017
L00 · leaf
fill_…7fa1
L01 · leaf
fill_…3c9e
L02 · leaf
fill_…2bd0
L03 · leaf
fill_…f486
Leaf
L02
Sibling
L03
Sibling
H00

verify(L02, [L03, H00], ROOT) → true

§ 05 · Lifecycle
Fill → batch → root → verify

From fill to proof

01

Fill happens

Matching engine settles a fill. signer-service issues an Ed25519-signed FillReceipt with a fillId.

02

Leaf hash

commitment-service hashes the canonical fill payload via fillLeafHash(). The leaf is added to the current batch tree.

03

Batch close

On the per-window close (or forced-close on shutdown), the OZ-compatible Merkle tree is built (sorted-pair, dup-on-odd).

04

Root publish

commitment-publisher posts publishBatch(root, startTs, endTs, leafCount, archiveCid) to the on-chain ForexizCommitments contract.

05

User verifies

Anyone can call verifyAgainstBatch(seq, leaf, proof) on-chain — or paste the proof in the verifier here.

§ 06 · Verify in your browser
Same algorithm as on-chain

Try the
verifier.

Paste a leaf, a Merkle root, and the proof array. The verifier reproduces the on-chainMerkleProof.verifycheck entirely client-side. Sample data is pre-filled; click Verify to see the ✓ result.

Algorithm: OpenZeppelin MerkleProof.verify (sorted-pair, dup-on-odd). Identical to the on-chain verifyAgainstBatch path in ForexizCommitments.