Skip to main content
The Hash Chain is a cryptographic verification system that ensures the integrity and ordering of steps in a thread. Each step contains a hash that links to the previous step, creating an immutable audit trail.

Hash Properties

  • Tamper-proof - Any modification breaks the chain
  • Ordered - Ensures steps execute in correct sequence
  • Verifiable - Chain integrity can be checked
Each step contains:
  • hash - Current step’s cryptographic hash
  • prevHash - Previous step’s hash (null for first step)

Chain Verification

// Verify hash chain integrity
const archivedThread = await connection.getThread('thread-uuid');
const steps = await archivedThread.steps();

for (const step of steps) {
  if (step.verified) {
    console.log(`${step.stepName}: Verified ✓`);
  } else {
    console.error(`${step.stepName}: Chain broken`);
  }
}

Benefits

  • Integrity - Detects any modification to step data
  • Ordering - Ensures steps execute in correct sequence
  • Audit Trail - Immutable record of execution
  • Trust - Cryptographic proof of execution

Use Cases

  • Compliance - Regulated industries need audit trails
  • Dispute Resolution - Prove what actually happened
  • Security - Detect unauthorized modifications
  • Debugging - Identify where execution went wrong