attest Docs

Guides

Verify a receipt independently

Check a receipt's hash and signature yourself, without trusting attest's servers.

What you check #

A receipt is verified in three independent steps. None of them requires calling attest's verification servers:

  1. Integrity. SHA-256 of the exact payload string equals hash.
  2. Signature. signature is a valid RSA-SHA256 signature over the UTF-8 bytes of the hash hex string, under attest's public key.
  3. Signer. The public key's fingerprint matches the one you confirmed with attest through a separate, authenticated channel.

A receipt from a POST /v1/events response has payload, hash, and signature at the top level. In a file downloaded from the dashboard, the same three values are under proof.

Get the receipt #

Each event accepted through POST /v1/events returns a signed receipt (payload, hash, signature) that the caller can verify with attest's published key. It is the entry in the response's receipts array. A duplicate returns the receipt of the original acceptance. See Receipt fields.

As an alternative, open a record in the dashboard under Activity and choose Download Proof JSON. You get attest-proof.json in the attest-proof-export-v1 format, which holds the same payload, hash, and signature under proof. The examples below that read attest-proof.json use that file.

Verify a receipt from a response #

This example sends an event, keeps the receipt from the POST /v1/events response, fetches the public key, and checks the hash and the signature with openssl. It prints Hash OK, then Verified OK, and exits non-zero if either check fails. If you run it again, the event is a duplicate and the response returns the original receipt, which verifies the same way.

Example · Shell
curl -s -X POST https://attestinfra.com/v1/events \
  -H "Authorization: Bearer $ATTEST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"eventType": "ai.agent.tool_call", "eventId": "job_receipt_7f3c9a12"}' \
  | jq '.receipts[0]' > receipt.json

curl -s https://attestinfra.com/.well-known/attest-signing-key \
  | jq -r .public_key > attest-signing-key.pem

expected=$(jq -r .hash receipt.json)
actual=$(jq -j .payload receipt.json | openssl dgst -sha256 -r | cut -d ' ' -f 1)
if [ "$actual" = "$expected" ]; then echo "Hash OK"; else echo "Hash mismatch"; exit 1; fi

jq -j .hash receipt.json > hash.txt
jq -r .signature receipt.json | base64 -d > signature.bin
openssl dgst -sha256 -verify attest-signing-key.pem -signature signature.bin hash.txt
Output · Shell
Hash OK
Verified OK

Verify in code #

This script checks a downloaded attest-proof.json and uses only Node.js built-ins. For a receipt from a response, read payload, hash, and signature from the receipt instead of from proof. It fetches the current public key from GET /.well-known/attest-signing-key. For a stronger check, pin the key or fingerprint you confirmed out of band instead of fetching it.

Example · JavaScript
import { readFileSync } from "node:fs";
import { createHash, verify } from "node:crypto";

const receipt = JSON.parse(readFileSync("attest-proof.json", "utf8"));
const { payload, hash, signature } = receipt.proof;

const signer = await (await fetch("https://attestinfra.com/.well-known/attest-signing-key")).json();

const hashMatches = createHash("sha256").update(payload, "utf8").digest("hex") === hash;
const signatureValid = verify(
  "RSA-SHA256",
  Buffer.from(hash, "utf8"),
  signer.public_key,
  Buffer.from(signature, "base64"),
);

console.log({ hashMatches, signatureValid, fingerprint: signer.fingerprint });
if (!hashMatches || !signatureValid) process.exit(1);
Output · Console
{
  hashMatches: true,
  signatureValid: true,
  fingerprint: 'sha256:552054128c0ca6f3fe6b6ef38e062f22593705e2e10a648a20418434f53b5e12'
}

Verify with OpenSSL #

The same check for a downloaded attest-proof.json, with jq, sha256sum, and openssl. Compare the first line of output with proof.hash. The last line must read Verified OK.

Example · Shell
curl -s https://attestinfra.com/.well-known/attest-signing-key \
  | jq -r .public_key > attest-signing-key.pem

jq -j .proof.payload attest-proof.json | sha256sum
jq -r .proof.hash attest-proof.json

jq -j .proof.hash attest-proof.json > hash.txt
jq -r .proof.signature attest-proof.json | base64 -d > signature.bin
openssl dgst -sha256 -verify attest-signing-key.pem -signature signature.bin hash.txt

Use the proof inspector #

attest publishes a self-contained HTML verifier that runs entirely in your browser, with no account and no network calls. Download it, check its digest against the published checksum, then open it locally and load attest-proof.json.

Request · Shell
curl -sO https://attestinfra.com/proof-verifier/attest-proof-inspector-v1.html
curl -s https://attestinfra.com/proof-verifier/attest-proof-inspector-v1.sha256 | sha256sum -c
Output · Shell
attest-proof-inspector-v1.html: OK

What a valid receipt proves #

A valid receipt shows that the holder of attest's signing key signed exactly this payload. Read its limits plainly:

  • Integrity only. The receipt proves that the signed payload has not changed. It does not show that the payload's contents are true.
  • Not independent provenance. A public key fetched from attest is not independent proof of who signed. Confirm the fingerprint through a separate, authenticated channel.
  • Not completeness or sequence. A single receipt does not prove that you hold every receipt, or the order in which events happened.
  • Only the payload is signed. Fields outside payload, such as status, verified_at, signer, and the export's metadata, are not signed and are not evidence on their own.

See What attest does not attest.