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 asMachineEvent (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 exportsvalidateSubmitEventParams, which checks all nine fields before any interaction:
eventTypemust be 0 or 1valuemust be a non-negative integer (subunit, per ISO 4217 minor units)trustLevelmust be 0, 1, or 2sourceChainIdmust be a supported chain (0, 3338, or 8453)- When
trustLevelis 1 (on-chain verifiable),sourceTxHashis required rawDatamust be non-empty when provided (null is allowed, empty array is not)currencyon revenue events must match^[A-Z0-9]{3,10}$; on activity events it must be""timestampmust be a positive integer; the EventRegistry contract additionally rejectstimestamp > block.timestamp(FutureTimestamprevert)metadatais capped at 4096 bytes on-chain (MetadataTooLargerevert above the limit)
Cross-links
- JS SDK
validateSubmitEventParamsdocuments every validation rule - JS SDK
computeDataHashdocuments the hashing utility - Machine Credit Rating shows how events feed into a machine’s credit history

