Verify Hash Chain Integrity
Hash Chain Status Fields
| Field | Type | Description |
|---|---|---|
verified | Boolean! | Chain integrity verified |
lastVerifiedAt | String! | Last verification timestamp |
totalEvents | Int! | Total events in chain |
brokenAt | String | Timestamp where chain broke |
error | String | Error message (if broken) |
Step Integrity Fields
| Field | Type | Description |
|---|---|---|
verified | Boolean! | Step integrity verified |
hash | String | Step hash |
prevHash | String | Previous step hash |
error | String | Error message (if invalid) |
How Hash Chains Work
- First Step: Hash = HMAC-SHA256(prevHash:threadID:stepID:stepName:idempotencyKey:timestamp)
- Subsequent Steps: Each step’s hash includes the previous step’s hash
- Verification: Recalculate hashes and compare with stored values
- Tamper Detection: Any modification breaks the chain
Use Cases
| Use Case | Description |
|---|---|
| Audit Trail | Verify execution history hasn’t been tampered with |
| Detect Tampering | Identify where integrity was compromised |
| Step Verification | Verify individual step integrity |
| Compliance | Prove execution order for regulatory requirements |