Verifying Proofs
How to independently verify proof hashes using the PacSpace verification utilities.
PacSpace provides everything you need to independently verify proof hashes. When you receive a delta.verified webhook, the payload includes the proof data required for verification.
What You Receive
Every delta.verified webhook includes a proof object:
{
"proof": {
"proofHash": "0x8f3a9b...",
"contentHash": "0x2d4e7f...",
"itemHashes": ["0x2d4e7f...", "0x9f1a..."],
"previousProofHash": "0x1c7b2e..."
}
}
| Field | Description |
|---|---|
proofHash | Cryptographic proof covering the verified delta |
contentHash | Hash of your individual delta payload |
itemHashes | Content hashes for items included in the verification |
previousProofHash | Proof hash of the preceding delta (forms the verification chain) |
Verification Steps
1. Confirm your content hash
Verify that your contentHash appears in the itemHashes array. This proves your delta was included in the verification.
const { contentHash, itemHashes } = webhookData.proof;
assert(
itemHashes.includes(contentHash),
'Content hash not found in verification set'
);
2. Confirm the proof hash
Compare the proofHash from the webhook against the value you received when you originally submitted the delta (via the receiptId field in the emit response). If they match, the verification is confirmed.
const { proofHash } = webhookData.proof;
assert(
proofHash === storedReceiptId,
'Proof hash does not match original receipt'
);
3. Validate the chain link
If you stored the previous delta's proof hash, confirm it matches previousProofHash to verify chain continuity. A mismatch means the chain was broken.
const { previousProofHash } = webhookData.proof;
assert(
previousProofHash === storedPreviousProofHash,
'Chain broken — previous proof hash does not match'
);
Full Verification Example
function verifyReceipt(receipt, storedPreviousHash) {
const { contentHash, proofHash, itemHashes, previousProofHash } = receipt.proof;
// 1. Verify content hash is in the verification set
if (!itemHashes.includes(contentHash)) {
return { verified: false, reason: 'Content hash not found in itemHashes' };
}
// 2. Validate chain link if previous hash is available
if (storedPreviousHash && previousProofHash !== storedPreviousHash) {
return { verified: false, reason: 'Chain link broken — previousProofHash mismatch' };
}
return { verified: true };
}
// Usage with a delta.verified webhook payload
const result = verifyReceipt(webhookData, myStoredPreviousHash);
console.log(result); // { verified: true }
Verification Summary
| Check | What it proves |
|---|---|
| Content hash presence | Your delta was included in the verification |
| Proof hash comparison | The committed proof matches your original receipt |
| Chain link validation | No deltas were inserted, removed, or reordered |
Next Steps
- Proof Hashes — Understand the three properties of proof hashes
- Webhook Payloads — Full schema for the
delta.verifiedevent