Skip to main content
Events are the atomic units of a machine’s financial history. The EventRegistry stores them ; the scoring pipeline reads them to compute credit ratings.

Two event types

Both SDKs export these as constants:

MachineEvent schema

Every event stored in the EventRegistry follows this structure: The expose the stored struct as MachineEvent (with dataHash / data_hash as a 32-byte keccak256). The SDK input type SubmitEventParams takes rawData / raw_data bytes instead; the SDK computes the hash for you before the call.

Cross-chain revenue accounting

sourceChainId and sourceTxHash together form a cross-chain audit trail. When a machine earns revenue on , the proxy submits the event to the EventRegistry on with sourceChainId = 8453 and the Base transaction hash. Any verifier can look up the on the source chain and confirm the event happened.

Data integrity via dataHash

Raw event data stays with the project (in their database, behind their API). The dataHash stored onchain is keccak256(raw_data), computed by the SDK before submission. This keeps costs at 32 bytes per event regardless of payload size, while anyone can fetch the raw data from the project’s data_api (set in the machine’s ) and verify keccak256(fetched_data) == dataHash.

Authorization

EventRegistry reads IdentityRegistry to verify submit authority. msg.sender must be one of: All three paths produce identical on-chain records: the machineId in the stored event always identifies the machine, regardless of who submitted.

Validation

The JS SDK exports validateSubmitEventParams, which checks all nine fields before any interaction:
Key validation rules:
  • eventType must be 0 or 1
  • value must be a non-negative integer (subunit, per ISO 4217 minor units)
  • trustLevel must be 0, 1, or 2
  • sourceChainId must be a supported chain (0, 3338, or 8453)
  • When trustLevel is 1 (on-chain verifiable), sourceTxHash is required
  • rawData must be non-empty when provided (null is allowed, empty array is not)
  • currency on revenue events must match ^[A-Z0-9]{3,10}$; on activity events it must be ""
  • timestamp must be a positive integer; the EventRegistry contract additionally rejects timestamp > block.timestamp (FutureTimestamp revert)
  • metadata is capped at 4096 bytes on-chain (MetadataTooLarge revert above the limit)