<!-- Canonical: https://mnemontron.com/verify-a-receipt -->
# How to verify a Mnemontron receipt

A Mnemontron receipt proves which evidence an answer cited. To verify one, check its Ed25519 signature against the instance's public keys, confirm it is within its validity window, and compare the cited content hashes with the evidence you hold. This guide walks through each step. For what Mnemontron is, start at the [home page](/).

## Key takeaways

- Search, contents, query and agent task responses each include a receipt.
- A receipt is a compact JSON Web Signature (`alg: EdDSA`) over the list of citations.
- The signature, type and validity window can be checked offline; replay detection needs the verification API.

## What a receipt contains

- `typ`: always `mnemontron.receipt/v1`.
- `iss` and `kid`: the issuing instance and a thumbprint of the signing key.
- `iat`, `nbf` and `exp`: issue time, not-before time and expiry. Receipts expire one hour after issue by default.
- `jti` and `nonce`: a unique id used for replay detection.
- `task`: `search`, `contents`, `query` or `verify`.
- `query_sha256`: the SHA-256 hash of the query, when there was one.
- `citations`: the evidence id, content hash, version and URL of each cited source.
- `jwks_uri`: where the instance publishes its public keys.

## Steps

1. **Save the receipt.** Keep the compact JWS from the `receipt` field of the response.
2. **Fetch the public keys.** Download the key set from the instance's `/.well-known/jwks.json`. Rotated keys stay in the set, so older receipts still verify.
3. **Check the signature.** Find the key whose id matches the receipt's `kid` and verify the EdDSA signature. Any edit to the payload makes this fail.
4. **Check the type and validity window.** Confirm `typ` is `mnemontron.receipt/v1` and that the current time is between `nbf` and `exp`.
5. **Check the citations.** Compare each cited content hash and version with the evidence you hold, and compare `query_sha256` with the SHA-256 of the query you asked.
6. **Check for replay.** Submit the receipt to the instance's verification API. The first presentation returns `replay: false`; any later presentation of the same receipt returns `replay: true`, and an expired receipt is rejected.

## Offline and online verification

Mnemontron ships a verification script that performs steps 2 to 4 offline against a saved key set or a key set URL, and exits with an error on a bad signature, a wrong type or an expired receipt. Offline verification cannot see which receipts have already been presented, so replay detection is available only through the API.

Agents can apply the same checks to the instance's A2A agent card, which is signed with the same keys.

## Related

- [Glossary](/glossary): definitions of signed receipts, replay detection and the evidence chain.
- [Security model](/security): how receipts fit with encryption, tenant isolation and the audit log.
- [FAQ](/faq): short answers about citations, verification and data protection.
