Verifiable Event Sync (VES) System Overview
A complete zero-knowledge commerce infrastructure enabling AI agents to interact with cryptographic verification, STARK proofs, and on-chain anchoring.System Architecture
Data Flow
Step 1: AI Agent Creates Event
Step 2: Event Signing & Encryption (CLI)
The CLI performs VES v1.0 protocol operations:- Payload Hash:
SHA-256(domain_prefix || canonical_json(payload)) - Ed25519 Signature: Signs event envelope with agent’s private key
- HPKE Encryption: Encrypts payload for authorized recipients
- Cipher Hash:
SHA-256(domain_prefix || ciphertext)
Step 3: Sequencing (stateset-sequencer)
The sequencer:- Validates agent signature
- Assigns deterministic sequence number
- Adds event to Merkle tree
- Creates batch when threshold reached
Step 4: STARK Proof Generation (stateset-stark)
For each batch, generate a STARK proof:- Proof Size: ~36KB (individual), ~53KB (batch)
- Proving Time: ~20-25ms
- Verification Time: ~600µs
- Security Level: 128-bit
Step 5: On-Chain Anchoring (set/anchor → SetRegistry)
The anchor service submits to Set L2:Step 6: Verification by Other Agents
Any AI agent can verify:- Event Inclusion: Merkle proof against on-chain root
- Compliance: STARK proof verification
- State Transition: Verify prev_state → new_state
Repository Structure
| Repository | Path | Description |
|---|---|---|
| stateset-sequencer | /home/dom/icommerce-app/stateset-sequencer | VES protocol sequencer |
| stateset-stark | /home/dom/icommerce-app/stateset-stark | STARK prover/verifier |
| set | /home/dom/icommerce-app/set | L2 chain & anchor service |
| CLI | /home/dom/stateset-icommerce/cli | AI agent MCP server |
Crate Structure (stateset-stark)
CLI Commands
STARK Prover CLI
Sync CLI
Performance Metrics
| Operation | Time | Size |
|---|---|---|
| Individual Proof Generation | ~20ms | ~36KB |
| Batch Proof (8 events) | ~25ms | ~53KB |
| Proof Verification | ~600µs | - |
| Merkle Proof Verification | 1ms | 1KB |
Security Properties
- Privacy: Event payloads encrypted with HPKE
- Authenticity: Ed25519 signatures on all events
- Ordering: Deterministic sequencing prevents reordering
- Compliance: Zero-knowledge proofs for policy enforcement
- Finality: On-chain anchoring provides immutability
- Verifiability: Anyone can verify proofs without trusted setup
Running the Demo
run-ves-demo.sh for the full demonstration script.