Be first in. Get early access

Tenhatch Checks

All documentation

Receipts

Every check that answers comes with a receipt signed by Tenhatch Checks. Keep it with the business's records: it shows which check ran, when, under which rule and with what answer, and anyone can verify it with the published public key, without asking us.

What a receipt holds

{
  "receipt": {
    "v": 1,
    "id": "rcpt_…",
    "issuer": "checks.tenhatch.com",
    "keyId": "…",
    "check": "sms-opt-out",
    "checkVersion": "2",
    "at": "…",
    "inputSha256": "…",
    "resultSha256": "…",
    "answer": "opt_out",
    "dataAsOf": null,
    "rules": [{ "id": "us-fcc-47-cfr-64-1200-a-10", "lastChecked": "…" }],
    "credits": 0
  },
  "signature": "…"
}
  • inputSha256 and resultSha256 are SHA-256 fingerprints of the input as read and of the result. The input itself (the text, the invoice, the supplier's name) is never in the receipt and never stored.
  • dataAsOf gives the date of the data the check read: each FDA source's copy for the supplier check, the day the fuel tax rates or the deposit rules were last checked.
  • rules names each rule and the day its words were last checked.

The published format, with every field, a JSON Schema and a test vector, is at https://checks.tenhatch.com/.well-known/tenhatch-checks-receipt.json.

Look a receipt up

GET https://checks.tenhatch.com/api/v1/receipts/<id> shows the receipt, its signature and whether the signature is valid. It needs no key and shows no account details.

Verify a receipt you hold

Send it back, with the input if you want to show what it was for:

POST /api/v1/receipts/verify
Content-Type: application/json

{"receipt": { … }, "signature": "…", "input": {"text": "STOP"}}

The answer says whether the signature is valid, whether the input matches the receipt (inputMatches) and whether Tenhatch Checks holds the same receipt (onRecord). Send the input exactly as the check's answer returned it.

Verify it yourself

  1. Write the canonical JSON of receipt: object keys sorted by code point at every level, no spaces or line breaks, arrays in their order.
  2. Find the key whose kid equals the receipt's keyId at https://checks.tenhatch.com/.well-known/tenhatch-checks-keys.json (current and retired keys are both listed, so old receipts keep verifying after a key changes).
  3. Check the Ed25519 signature (base64url, no padding) over the canonical JSON's UTF-8 bytes with that key.
  4. To show a receipt was made for an input you hold, compare the SHA-256 of the input's canonical JSON with inputSha256.

The format document's testVector is a receipt signed by a test key that never signs real receipts: if your verifier accepts it with the test key, it is ready.

How long receipts are kept

Receipts are kept while Tenhatch Checks runs, also after an account is closed (they hold no personal data), so whoever holds one can still verify it.