Constructors

Methods

  • Verify an ordered array of signed events for chain integrity.

    Checks performed:

    1. Sequence continuity (monotonically increasing, no gaps)
    2. Hash linkage (each event's prevHash matches the prior event's hash)
    3. Payload hash integrity (recomputed hash matches stored payloadHash)
    4. Event hash integrity (recomputed hash matches stored hash)
    5. Ed25519 signature verification (if signatures present)
    6. Timestamp monotonicity (non-decreasing)

    Parameters

    • events: SignedEvent[]

      Ordered array of SignedEvent objects (sorted by sequence ASC).

    • Optional 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.