Attest · Concept
Chain of custody
The chain of custody is the append-only timeline of each attested asset, that records who captured, edited, escalated or exported it and when.
When to use it
Read the chain when you need to show an investigator or a court how an asset was handled. Export it, with every hash, as an evidence bundle that anyone can re-check offline.
How it works
- Attesting an asset writes a
captureevent for the device. - Later events append to it: an
editby a tool, anescalationby an adjuster, anexportedevent when you export evidence. - Each verification result returns the chain as
chain, oldest first, and the escalation PDF prints it.
- capturedevice:<id>
- edit / escalationtool:<name>, adjuster:<id>
- exportedevidence bundle
Key fields
| Field | Type | Description |
|---|---|---|
event_ | string | capture, edit, escalation or exported. |
timestamp | string | When it happened (RFC 3339). |
actor | string | Who: device:<id>, tool:<name> or adjuster:<id>. |
summary | string | A short description. |
Export the evidence
POST / builds a ZIP for one claim:
| File | Contents |
|---|---|
attestations/ | Each asset's signed bundle and verification result |
custody. | The chain-of-custody events |
content-hashes. | The media hashes; the media bytes stay with you |
manifest. | Every file with its hash, and a manifest_ over the list |
verify-bundle. | A dependency-free script that re-checks every hash offline |
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -s -X POST $PROVENANCE_API/v1/attest/claims/CLM-SANDBOX-FRAUD/export \
-H "Authorization: Bearer $PROVENANCE_KEY" | tee export.json
import { Provenance } from "@provenanceauth/sdk";
const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const exported = await prov.attest.claims.export("CLM-SANDBOX-FRAUD");
import os
from provenanceauth import Provenance
prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
exported = prov.attest.claims.export("CLM-SANDBOX-FRAUD")
{
"id": "exp_01M5Q1PNHR9XVEVR97ZDCFBFXJ",
"object": "export",
"claim_id": "CLM-SANDBOX-FRAUD",
"status": "ready",
"manifest_hash": "f40f0e0ea6d919c3c8e7d234affbbddbb26772ad7a48e6e834c5a626a4eb9919",
"timestamp": { "status": "not_configured", "reason": "…" },
"file_count": 9,
"download_url": "/v1/exports/exp_01M5Q1PNHR9XVEVR97ZDCFBFXJ/download",
"expires_at": "2026-10-25T13:30:47.736Z"
}
Download the ZIP within 24 hours and run its check:
export EXPORT_ID=$(jq -r .id export.json)
curl -s $PROVENANCE_API/v1/exports/$EXPORT_ID/download -H "Authorization: Bearer $PROVENANCE_KEY" -o evidence.zip
python3 -m zipfile -e evidence.zip evidence && node evidence/verify-bundle.mjs
import { writeFileSync } from "node:fs";
const zip = await fetch(`${process.env.PROVENANCE_API}${exported.downloadUrl}`, { headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` } });
writeFileSync("evidence.zip", Buffer.from(await zip.arrayBuffer()));
// unzip, then: node evidence/verify-bundle.mjs
import httpx, zipfile
zip_bytes = httpx.get(os.environ["PROVENANCE_API"] + exported["download_url"], headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}).content
open("evidence.zip", "wb").write(zip_bytes)
zipfile.ZipFile("evidence.zip").extractall("evidence") # then: node evidence/verify-bundle.mjs
The check prints BUNDLE VERIFICATION PASSED — every hash matches the manifest., and fails with exit code 1 if any file changed. With a timestamp authority configured on the server, the export also carries an RFC 3161 timestamp of the manifest hash, proving the evidence existed at that time; without one, timestamp.status is not_configured.
Limitations: the bundle holds hashes of the media, not the media; keep the originals to show the hashes match.