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

@ghostlogic/ghostseal

v1.0.0-alpha.0

Published

Ghostseal v1: canonical hashing, HMAC seal, Ed25519 sign, and chain link primitives for GhostLogic.

Downloads

27

Readme

@ghostlogic/ghostseal

Node TypeScript parity package for the GhostLogic Ghostseal v1 spec. Cross-impl byte-equal with ghostseal-py against the shared conformance corpus (120 vectors, tests/corpus/v1/vectors.jsonl).

Requirements

  • Node.js >= 20 (LTS through 2026-04). Node 18 hit EOL 2025-04 and is not supported.
  • TypeScript 5.4+ if you consume the source. Compiled dist/ ships ES2022 + ESM only.

Install

Phase 2 is not yet published to npm. To consume locally:

git clone https://github.com/ghostlogic/ghostseal-node
cd ghostseal-node
npm install
npm run build

Then link from your project, or depend on the local path.

Public surface (mirrors ghostseal-py)

import {
  // §4 canonical serialization
  canonicalBytes,
  NotCanonicalizable,

  // §3.2 / §5.1 content hash
  contentSha256,

  // §3.3 batch identifier
  computeBatchId,

  // §5.2 HMAC seal
  hmacSeal,
  hmacVerify,

  // §3.5 / §5.3 Ed25519
  ed25519Generate,
  ed25519Sign,
  ed25519Verify,

  // §6 chain linkage
  CHAIN_ALGORITHM_ID,
  ChainLink,
  chainLink,
  chainVerify,

  // §9 + §4.4 key validity
  KeyValidityWindow,
  isValidAt,
  validateCanonicalTimestamp,
} from '@ghostlogic/ghostseal';

Names are camelCase mirrors of the Python snake_case equivalents (canonicalBytescanonical_bytes, etc.).

Usage

Canonical encoding and content hash

import { canonicalBytes, contentSha256 } from '@ghostlogic/ghostseal';

const bytes = canonicalBytes({ event: 'login', user: 'adam' });
// → Uint8Array of UTF-8 JSON, deterministic per spec §4.

const hash = contentSha256({ event: 'login', user: 'adam' });
// → lowercase 64-char hex sha256 of the canonical bytes.

HMAC seal

import { hmacSeal, hmacVerify } from '@ghostlogic/ghostseal';
import { randomBytes } from 'node:crypto';

const key = randomBytes(32);
const payload = canonicalBytes({ id: 'evt-123', n: 42 });
const sig = hmacSeal(payload, key);          // 64-char hex
const ok  = hmacVerify(payload, sig, key);   // true

Ed25519 signature

import { ed25519Generate, ed25519Sign, ed25519Verify } from '@ghostlogic/ghostseal';

const { privateKey, publicKey } = ed25519Generate(); // 32 + 32 raw bytes
const sig = ed25519Sign(canonicalBytes({ a: 1 }), privateKey);
const ok  = ed25519Verify(canonicalBytes({ a: 1 }), sig, publicKey);

Chain linkage

import { chainLink, chainVerify } from '@ghostlogic/ghostseal';

const a = chainLink(null, canonicalBytes({ event: 1 }));        // genesis
const b = chainLink(a.currentSealId, canonicalBytes({ event: 2 }));
const c = chainLink(b.currentSealId, canonicalBytes({ event: 3 }));
chainVerify([a, b, c]); // true

Node-specific tightening relative to ghostseal-py

The two impls produce byte-equal output for the same logical input (proven across all 120 corpus vectors). Node tightens the input contract in a handful of places where JS coercion or under-spec would silently corrupt the canonical form:

| Surface | Python accepts | Node rejects | |------------------|----------------|------------------------------------------------------------------------------| | canonicalBytes | floats already rejected | also undefined, sparse arrays, Map/Set/WeakMap/WeakSet, Date, ArrayBuffer, foreign typed arrays, functions, symbols, class instances, strings with unpaired UTF-16 surrogates | | Integers | Python int (arbitrary precision) | Number only when Number.isSafeInteger(n); use bigint for \|n\| > 2^53-1 | | computeBatchId | any string | rejects "" and any control char in U+0000–U+001F (see §4.6.1 spec delta below) |

Errors (Error and any subclass, including NotCanonicalizable itself) are never canonical inputs — canonicalBytes(new Error()) throws NotCanonicalizable with typeName="Error", enforced before any other type dispatch so errors cannot leak into the signing domain.

Conformance

Run the v1 corpus against the local impl:

npm test

All 120 vectors produce byte-equal canonical_bytes_sha256, content_sha256, and batch_id outputs with ghostseal-py.

Downstream consumers

Phase 2 unblocks node-agent-watchdog (planned per node-agent.md) — the Node parity of the GhostLogic Agent Watchdog forensic forwarder. All canonical-serialization, hashing, sealing, and signing calls in node-agent-watchdog will route through this package, with byte-equality with logicd's emission as the load-bearing guarantee (item 106).

Authority

In order, when impls disagree:

  1. Spec §4 intentghostlogic-spec/ghostseal-v1-spec.md (human contract).
  2. Conformance corpustests/corpus/v1/vectors.jsonl (ground truth).
  3. Python referenceghostseal-py (implementation guide, not truth).
  4. Node implementation — this package.

See PROGRESS.md for Phase 2 build history, observed spec deltas, and spec follow-ups.

Authors

GhostLogic / Adam Thomas ([email protected]).

License

TBD.