How to check a whole workspace offline
Download an audit export for the workspace or your account-level chain. It includes every receipt, the public keys and the chain head. Check each receipt's signature with the included keys and walk the prevHash links from the first receipt to chainHead. Nothing needs to call ClearRun.
Last updated
Steps
Export the workspace
curl -s "https://api.clearrun.net/api/audit/export?workspaceId=WORKSPACE_ID" \ -H "Authorization: Bearer $CLEARRUN_API_KEY" -o clearrun-audit.jsonNeeds a Business or Enterprise workspace. Leave out
workspaceIdto get every chain you own as an object with"scope": "account"and abundlesarray, and check each bundle the same way. See How to export a workspace's receipts (GET /api/audit/export).Check every signature
For each entry in
receipts, run the same signature check as for one receipt, using the key in the bundle'sjwkswhosekidmatcheskeyId.Walk the chain
Start at the receipt whose
prevHashequals the bundle'sgenesis. From each receipt, the next one is the receipt whoseprevHashequals itsreceiptHash. Every receipt must be reached, with none left over, and the lastreceiptHashmust equalchainHead. Also check eachreceiptHash: it is the SHA-256 of the 11 signed fields plussignature, as sorted-key JSON.Check verdicts
For each entry, the SHA-256 of the
publicVerdict(as sorted-key JSON) must equal the receipt'sverdictHash. On1.1.0receipts that verdict is the coarse result plus a digest of the named signals. On1.0.0receipts it is the whole stored verdict.
Keep the file
The bundle is a point-in-time copy. Store it where you keep other records.