Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/security / / verifyAuditAgainstCheckpoint

Function: verifyAuditAgainstCheckpoint()

ts
function verifyAuditAgainstCheckpoint(
   db, 
   checkpoint, 
   opts): Promise<
  | {
  current: AuditTreeHead;
  ok: true;
}
  | {
  current?: AuditTreeHead;
  ok: false;
  reason: "bad-signature" | "inconsistent-log";
}>;

Defined in: packages/security/src/audit/merkle.ts:432

Full anchored verification: the checkpoint's signature is valid against the pinned key AND the current log is an append-only extension of the checkpointed head (consistency proof computed and verified over the live database).

Parameters

ParameterType
dbAuditDb
checkpointSignedAuditCheckpoint
opts{ publicKeyPem: string; }
opts.publicKeyPemstring

Returns

Promise< | { current: AuditTreeHead; ok: true; } | { current?: AuditTreeHead; ok: false; reason: "bad-signature" | "inconsistent-log"; }>

Stable