Verify a compute usage receipt
verify_receiptVerify a signed ComputeLedger receipt is authentic and untampered, so you can trust its usage data before relying on it; returns valid with a reason if invalid.
Instructions
Independently checks whether a single signed ComputeLedger receipt is authentic and untampered, without needing to trust whoever issued it. Call this whenever you're handed a receipt (from record_usage, computeledger record, or a third party) and need to confirm it's cryptographically valid before trusting the usage numbers inside it. No prerequisites: it needs nothing on local disk beyond the receipt object itself, and does not require the signer's private key.
Side effects: read-only, no ledger writes, no file access beyond the in-memory argument, no network calls. Fully idempotent, the same receipt always verifies the same way. It never raises on an invalid receipt, instead it returns a normal result with is_error=true, so check the 'valid' field rather than relying on an exception.
Parameters: receipt (dict) - the full signed receipt object as produced by record_usage or computeledger record (must include version, hash, signature, and the other receipt fields). Equivalent CLI: computeledger verify receipt.json --json.
Returns {"valid": true} on success, or {"valid": false, "reason": "<invalid_signature|hash_mismatch|unsupported_version|malformed_receipt>"} on failure, so callers can distinguish exactly why a receipt failed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| receipt | Yes | A signed ComputeLedger receipt object, as produced by record_usage or `computeledger record` |