Queries and x402
Renters never send code and never see rows. They pick an aggregate from a fixed list and pay for it over x402 in USDG.
Aggregates
| Name | Reads | Returns |
|---|---|---|
commute-minutes-by-weekday | Dashcam rides | Median ride minutes per weekday |
typing-speed-by-hour | Typing rhythm | Mean characters per minute per hour |
weekday-spending | Receipts | Mean receipt total per weekday |
dream-length | Dream journals | Mean words per entry |
The floor
A query must have at least 25 plates in scope, or it is refused before anything is charged. Inside the answer, any group built from fewer than 25 plates is dropped and counted as suppressed. Outputs are numbers only and capped at 4 KB.
Paying over x402
POST /q with {"aggregate": "..."}. Without payment it answers 402 with one accepts entry: scheme exact, network eip155:4663, asset USDG, payee the Meter, and the price in micro-USDG. Sign a ReceiveWithAuthorization for exactly that amount and send it base64-encoded in X-PAYMENT. While no enclave runs, /q answers 503 with the quote and charges nothing.
curl -s -X POST https://proofofdata.app/q -H 'content-type: application/json' \
-d '{"aggregate":"weekday-spending"}'Receipts
The enclave signs an EIP-712 Receipt(queryId, renter, enclaveId, platesRead, kind, price, outputHash). The facilitator settles it on the Meter every hour with your authorization. outputHash is the SHA-256 of the output with sorted keys, so anyone holding the output can check it.
Where the money goes
70% to the uploaders whose plates the query read, 15% to the Armour (of which 5% of revenue goes to the enclave's operator), 15% to the burn reserve. Armour calls pay 100% to the uploaders.