Skip to main content
This tutorial checks a record your own device already stored. The same steps work on a file you received after buying a listing. You need Foundry’s cast, and the two files under ~/.kinetic/records/. If those files are missing, the device has not stored an operation yet. Attest one from Telegram, or follow the vending machine tutorial, then come back. /status also links the latest attestation transactions.

Hash the line the device signed

operations.jsonl is one canonical JSON object per line. The newline between lines is a separator. It is not part of the signed bytes.
sed prints the line and the command substitution drops the trailing newline, so cast keccak hashes the same bytes monad_attest signed. The result is the paramsHash. The sibling file holds the request hash for that same line:
Line 1 of one file belongs to line 1 of the other. A blank line, a repeated request hash, or a different number of lines is a file the device will refuse to list.

Read the validation

Replace 0xREQUEST_HASH with the hash from operation-requests.txt. The return is:
All of these should hold:
0x6e46d149b7d3396b42E874765Cf5a1bb26BD5bA5, the Kinetic attestor. Another validator is a different scheme.
The agent id from /status. A row for a different agent is someone else’s machine.
100. That is the attestor’s verified response.
Equal to the cast keccak output. This is the check that the line was not edited after signing.
kinetic-action.
Change one character of LINE and hash it again. responseHash will not match. That is the whole verification.

Check a listing you do not hold yet

Before payment, the data file is not public. The manifest is. The verify route reads it and runs getValidationStatus for every row:
The JSON includes total and the first eight rows, each with paramsHash and requestHash. Run the cast call above on any of those request hashes. After you pay and unlock, hash each line of the data file and compare it to paramsHash, which you already compared to responseHash.
A matching hash proves the device key signed that line. It does not prove a motor moved or a sensor was right. What an attestation proves is the limit of this check.
Sample listings on the marketplace are previews. Their verify response is marked preview: true and is not a chain check. Use a listing whose verify response has "preview": false, or use your own records, for this tutorial.