npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zarel-ai/audit-tsa

v1.0.0

Published

Offline RFC 3161 timestamp-token verifier + Merkle inclusion proofs for Zarel external audit anchoring (ADR-0115). Pins TSA roots; never touches the OS trust store.

Downloads

131

Readme

@zarel-ai/audit-tsa

Offline RFC 3161 timestamp-token verifier + Merkle inclusion proofs for Zarel's external audit anchoring (ADR-0115).

Zarel anchors each window of audit checkpoints to an independent RFC 3161 Timestamp Authority (TSA): it builds a Merkle tree over the window's checkpoints and gets the TSA to sign a timestamp token over the root. A third-party-attested genTime then replaces the operator's self-asserted clock. This package verifies those tokens and the per-checkpoint inclusion proofs, synchronously and offline.

What it proves: a specific hash (the Merkle root) existed before the TSA's attested genTime, witnessed by a third party — i.e. anti-backdating. What it does not prove: content veracity, completeness, or non-equivocation. The v1 verifier does structural validation (token + the chain embedded via certReq=true); it does not check revocation (CRL/OCSP) and is not "valid for years" on its own. Pair it with @zarel-ai/audit-chain for chain integrity.

Install

npm install @zarel-ai/audit-tsa

Dual ESM + CommonJS with type declarations. Node ≥ 18. The only runtime dependencies are the ASN.1/CMS parsers (asn1js, pkijs) — node:crypto has the signature primitives but not a CMS envelope parser.

Verify a timestamp token

verifyTimestampToken is offline and fail-closed. It takes the DER token, the Merkle root you recomputed from the bundle, and an explicit set of pinned TSA root certificates — never the OS trust store, never the bundle itself (the bundle cannot be its own trust anchor).

import { verifyTimestampToken } from '@zarel-ai/audit-tsa';

const verdict = verifyTimestampToken({
    token,         // Uint8Array — DER TimeStampToken from the bundle
    expectedRoot,  // Uint8Array — the Merkle root you recomputed yourself
    pinnedRoots,   // Uint8Array[] — TSA root certs (DER) you trust, supplied out-of-band
});

if (verdict.ok) {
    console.log(`✓ root attested at ${verdict.genTime}`);
} else {
    console.error(`✗ token verification failed: ${verdict.failure}`);
    process.exitCode = 1;
}

failure names the first failing check: no_pinned_root, malformed_token, cms_signature, chain_to_pinned_root, eku_timestamping, gentime_outside_validity, or imprint_mismatch.

Verify a checkpoint's inclusion in the anchored root

Each checkpoint ships a Merkle inclusion path (sibling hashes only — no other tenant's content). Recompute the root from the leaf and confirm it equals the anchored root before trusting the token over it.

import { verifyInclusion } from '@zarel-ai/audit-tsa';

const included = verifyInclusion(
    leaf,   // Uint8Array — this checkpoint's hash
    path,   // InclusionPath — sibling hashes + side ('L' | 'R')
    root,   // Uint8Array — the anchored Merkle root
);

License

Apache-2.0 © Zarel AI