Skip to main content

Set L2 Architecture

Set L2 anchors batch commitments and proof metadata on-chain, so a client can verify event inclusion and policy compliance without trusting the sequencer. The chain becomes the source of truth rather than the operator.

The flow

  1. The sequencer orders events and computes Merkle roots over payload hashes.
  2. The prover generates zero-knowledge compliance proofs over encrypted payloads.
  3. SetRegistry on-chain stores the batch commitment and proof hashes.
  4. A verifier recomputes the root locally and compares it against the on-chain commitment.
Because step 4 needs only the commitment and a proof, verification requires no cooperation from the sequencer.

Batch commitments

Each batch anchors a state transition, not just a set of events:
prev_state_root chaining is what makes gaps and forks detectable. Strict mode verification checks continuity across the chain of commitments, so a missing or rewritten batch fails verification rather than passing silently.
Merkle trees are SHA-256 with domain separation at every level β€” VES_LEAF_V1 for leaves, VES_NODE_V1 for internal nodes, and a VES_PAD_LEAF_V1 constant padding the tree to a power of two. A leaf commits to the stream identity and sequence number as well as the event, so a leaf cannot be replayed into a different position. The engine can produce an inclusion proof for any individual event.

Compliance proofs

When payloads are encrypted β€” an order amount, say β€” a policy still needs checking without revealing the data. That’s what the STARK prover produces:
policy_hash is the field that matters for audit. It proves the compliance check ran against a specific policy version, so a later policy change can’t be passed off as having applied retroactively.

Chain configuration

Multi-tenant isolation is per tenant and store, keyed by keccak256(tenantId, storeId). Merchants can sponsor user transactions through SetPaymaster.

Why anchor at all

This is the same principle as verified decisions and ICP receipts: the party relying on a claim can check it themselves.