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

@cognoshift/sanad-verify

v0.1.0

Published

Offline verification library for Sanad Sign attestations — Ed25519 + CycloneDX + SHA-256 hash chain. Zero dependencies, works in Node 18+.

Readme

@cognoshift/sanad-verify

Offline verification library for Sanad Sign attestations. Zero dependencies. Node 18+. Works anywhere (CI, auditor laptops, air-gapped environments).

Any Sanad Sign attestation can be verified with only the stored row — no network, no license key, no trust in Sanad servers. This package is 3 KB of Node's built-in crypto module plus the canonicalization rules.

Install

npm install @cognoshift/sanad-verify

Verify a single attestation

Given an attestation row fetched from GET /api/sign/registry/<id>:

const { verifyAttestation } = require("@cognoshift/sanad-verify");

const row = await fetch("https://sanad.cognoshift.in/api/sign/registry/<id>").then(r => r.json());

const result = verifyAttestation({
  sbom:       row.sbom,
  signature:  row.signature,
  public_key: row.public_key,
  sbom_hash:  row.sbom_hash,   // optional — recomputed anyway
});

console.log(result.valid);            // true | false
console.log(result.signature_valid);  // Ed25519 check
console.log(result.hash_match);       // claimed vs recomputed SHA-256
console.log(result.computed_hash);    // "a3f5..."

Replay the hash chain

Given all attestations for a tenant (ordered ascending by created_at, id):

const { verifyChain } = require("@cognoshift/sanad-verify");

const result = verifyChain({ attestations: rows });

console.log(result.valid);           // true when chain is intact
console.log(result.break_at);        // id of first broken row, or null
console.log(result.first_mismatch);  // detailed diagnostic

The genesis constant is SANAD_SIGN_GENESIS_2026 (exported as GENESIS). Every per-tenant chain starts from this value; if you operate a private deployment with a different genesis, pass it explicitly:

verifyChain({ attestations: rows, genesis: "MY_PRIVATE_GENESIS" });

How verification works

  1. Canonicalize the SBOM — recursively sort object keys, keep arrays in order. Matches RFC 8785 JCS for the subset we use.
  2. Hash the canonical string with SHA-256. This is the sbom_hash.
  3. Verify the Ed25519 signature over the hex-encoded sbom_hash, using the public key stored on the row (SPKI format, base64).
  4. Chain replay: for every row in a tenant's ledger, recompute SHA-256(event_hash || previous_chain_hash) and match against the stored chain_hash. previous_chain_hash is GENESIS for the first entry.

All four steps are deterministic and reproducible in any language. This library is the reference Node implementation.

Port to other languages

The verification protocol is open. A Go or Python implementation is ~40 lines — read the source for reference. Contributions welcome.

TypeScript

Types ship in the package. import { verifyAttestation, verifyChain } from "@cognoshift/sanad-verify"; works out of the box.

License

Apache-2.0 — use freely including in commercial audits.