Set L2 Verification Example
A complete inclusion check, end to end. The goal is to confirm an event is in the anchored history using only the chain and a proof path — nothing that requires trusting the sequencer.Inputs
1. Retrieve the batch commitment
Read the commitment for the batch covering your event’s sequence number. This gives you theevents_root — the value everything else is checked against.
2. Get the Merkle proof
3. Recompute the root locally
Trees are SHA-256, but every hash is domain-separated — a baresha256(a || b) will not
reproduce the root. The constants come from VES v1.0:
A leaf is not simply the hash of the payload. It commits to the stream identity and position too:
4. Compare
Then check continuity
Inclusion proves your event is present. It does not prove nothing else was removed. Each commitment chains viaprev_state_root, so walk that chain in
strict mode when you need the history
to be complete rather than merely containing your event.
Then check compliance
For encrypted payloads, inclusion says the event exists but nothing about whether a policy held. That’s what compliance proofs are for.Related
- Set L2 Verification — all three checks
- Set L2 Architecture — the commitment structure