Class: ChainVerifier
Defined in: packages/agentos/src/core/provenance/verification/ChainVerifier.ts:18
Constructors
Constructor
new ChainVerifier():
ChainVerifier
Returns
ChainVerifier
Methods
isValid()
staticisValid(events,publicKeyBase64?):Promise<boolean>
Defined in: packages/agentos/src/core/provenance/verification/ChainVerifier.ts:196
Quick integrity check - returns true/false without detailed errors.
Parameters
events
publicKeyBase64?
string
Returns
Promise<boolean>
verify()
staticverify(events,publicKeyBase64?,hashAlgorithm?):Promise<VerificationResult>
Defined in: packages/agentos/src/core/provenance/verification/ChainVerifier.ts:36
Verify an ordered array of signed events for chain integrity.
Checks performed:
- Sequence continuity (monotonically increasing, no gaps)
- Hash linkage (each event's prevHash matches the prior event's hash)
- Payload hash integrity (recomputed hash matches stored payloadHash)
- Event hash integrity (recomputed hash matches stored hash)
- Ed25519 signature verification (if signatures present)
- Timestamp monotonicity (non-decreasing)
Parameters
events
Ordered array of SignedEvent objects (sorted by sequence ASC).
publicKeyBase64?
string
Optional public key for signature verification. If omitted, uses each event's signerPublicKey field.
hashAlgorithm?
"sha256" = 'sha256'
Hash algorithm used (default: 'sha256').
Returns
Promise<VerificationResult>
VerificationResult with validity status and any errors found.
verifySubChain()
staticverifySubChain(events,expectedStartPrevHash,publicKeyBase64?):Promise<VerificationResult>
Defined in: packages/agentos/src/core/provenance/verification/ChainVerifier.ts:208
Verify a sub-chain (range of events) within a larger chain. The first event's prevHash is trusted as a starting point.
Parameters
events
expectedStartPrevHash
string
publicKeyBase64?
string
Returns
Promise<VerificationResult>