ATTESTRAS
Protocol and independent checks

Check the mechanics without trusting us.

The spec, the test vectors and the client files are public. Recompute a receipt hash and a request signature on your own machine in about a minute.

Downloads

FileSHA-256
Protocol spec (Markdown)d18a58add5fd3a5d654e2d7eeb3447d06bddb686134db8da4462ff4ac18b2e04
Test vectors (JSON)663c4bad5b0a5636bbe79dcde75a015d605adce3db50edd0cf562e880297681d
Python client4ec3dbbbf1b073dc0bc135898034c1d34d9fd9a52b512ea7b787fcacb6efb662
Node clientc7ad2070e6eff141585966f32192cc90de9a0e6d92a52054e4e3716838e98f3e
OpenAPI documentGenerated by the server

Confirm a download: curl -fsS https://attestras.vercel.app/sdk/attestras.py | sha256sum. The clients are short and dependency-free so you can read them before you run them. They are provided for use with ATTESTRAS under the licence in the release package; we do not call them open source.

Walkthrough: reproduce a hash and a signature

You need curl, python3 and openssl. Nothing here touches a real account: the vectors use a published test secret.

1. Fetch the vectors

Terminal
curl -fsS https://attestras.vercel.app/protocol/test-vectors.json -o vectors.json

2. Recompute the receipt hash in Python

Canonical JSON is sorted keys, no whitespace, UTF-8. The receipt hash is its SHA-256. Expected output: hash matches: True.

Terminal
python3 - <<'PY'
import hashlib, json
v = json.load(open("vectors.json"))["receipt_hash"]["plain-ascii"]
canon = json.dumps(v["record"], sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode()
print("hash matches:", hashlib.sha256(canon).hexdigest() == v["sha256"], v["sha256"])
PY

3. Recompute it again with OpenSSL

A second, independent tool over the same canonical bytes. The digest printed must equal the sha256 in the vectors file.

Terminal
python3 -c 'import json;print(json.load(open("vectors.json"))["receipt_hash"]["plain-ascii"]["canonical_utf8"],end="")' | openssl dgst -sha256

4. Recompute a request signature

The HMAC preimage frames each field with a 4-byte length. Expected output: both lines True.

Terminal
python3 - <<'PY'
import hashlib, hmac, json
s = json.load(open("vectors.json"))["request_signature"]
frame = lambda b: len(b).to_bytes(4, "big") + b
fields = [b"pg-hmac-sha256-v1", s["timestamp"].encode(), s["request_id"].encode(), s["source_system_id"].encode(), s["key_id"].encode(), s["body"].encode()]
pre = b"PGSIG\x01" + b"".join(frame(f) for f in fields)
print("preimage matches:", pre.hex() == s["preimage_hex"])
print("signature matches:", hmac.new(s["secret"].encode(), pre, hashlib.sha256).hexdigest() == s["signature"])
PY

The sample on the home page does steps 2 and 3 in your browser and prints the same openssl command for the bytes it hashed.

5. Recompute one of your own live receipts

If you hold an API key, you can fetch the full stored record for any receipt you made and recompute its hash on your machine. Only the key's own tenant can read it; everyone else gets the same 404.

Terminal, with your key in the environment
python3 attestras.py check pg_YOUR_PROOF_ID

Expected last line: MATCH. The Node client does the same with node attestras.mjs check.

What you cannot reproduce yet

A third party cannot recompute a live receipt's hash. It covers the whole stored record, including two values the server adds (the ingest time and the tenant-scoped actor hash), and the public verifier returns only seven fields. Only the owner can export the record. The checks above show the rules are what we say, and the owner check shows our database returns a record that hashes to the receipt; neither shows a record was not swapped before you looked. That gap is exactly what independent timestamping narrows, and why we list it as the weakest point on the trust page.

Optional independent timestamps

When enabled, a scheduled job hashes new receipt hashes into a Merkle tree and sends only its 32-byte root to public OpenTimestamps calendars. Every receipt keeps its own standard .ots file. Once a calendar has a Bitcoin attestation, anyone can check the proof with the open-source ots client; we do not verify Bitcoin for you, and no record content leaves the service. Anchoring is built but off in this deployment. It is not live, and no receipt is timestamped this way yet.