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

@algovoi/substrate

v0.3.1

Published

AlgoVoi agentic-payments substrate -- JCS canonicalisation, action_ref, composite trust-query, compliance receipts, audit chain

Readme

@algovoi/substrate (TypeScript)

AlgoVoi agentic-payments substrate reference implementation.

JCS RFC 8785 canonicalisation, actionRef atomic primitive, composite trust-query algorithm, compliance receipt shape, and audit chain primitives that compose the substrate underneath x402, AP2, A2A, and MPP receipts.

The substrate runs in production at https://api.algovoi.co.uk/compliance. This package is the AlgoVoi-authored TypeScript reference implementation; cross-validated byte-for-byte against four other JCS implementations (Python rfc8785, Go gowebpki/jcs, Java cyberphone, Rust serde_jcs) on 53 conformance vectors and 3 composite-trust-query vectors.

Install

npm install @algovoi/substrate

Quickstart

import {
  canonicalize,
  sha256Jcs,
  actionRef,
  compositeTrustQueryHash,
  buildComplianceReceipt,
  appendToChain,
  verifyAuditChain,
} from '@algovoi/substrate';

// Canonicalise to RFC 8785 JCS string.
canonicalize({ b: 1, a: 2 }); // -> '{"a":2,"b":1}'

// action_ref atomic primitive:
// SHA-256(JCS({agent_id, action_type, scope, timestamp_ms}))
const ref = actionRef({
  agent_id: 'agent-x',
  action_type: 'payment',
  scope: 'bilateral',
  timestamp_ms: 1716460800000,
});

// Composite trust-query (PR #2440 in x402-foundation/x402).
const compositeHash = compositeTrustQueryHash([
  { source_id: 'trust-a', score: 80, sig: 'sig-bytes' },
  { source_id: 'trust-b', score: 75, sig: 'sig-bytes' },
]);

// Compliance receipt (AlgoVoi production schema).
const receipt = buildComplianceReceipt({
  payer_ref: 'sha256:abc123',
  screen_result: 'ALLOW',
  screen_timestamp_ms: 1716460800000,
  screen_provider_did: 'did:web:api.algovoi.co.uk',
  jurisdiction_flags: ['UK', 'EU'],
});

// Audit chain: monotonic per-row hash chain.
const row0 = appendToChain(receipt, null);
const row1 = appendToChain({ event: 'next' }, row0);
verifyAuditChain([row0, row1]);

Substrate discipline

This package enforces the AlgoVoi-authored substrate-discipline rules formalised in IETF Internet-Draft draft-hopley-x402-canonicalisation-jcs-v1 (Independent Submission, Informational; sole AlgoVoi authorship) and proposed for inclusion in x402-foundation/x402 via PR #2453 (replaces closed #2436):

  • Rule 1. timestamp_ms is an epoch-millisecond integer. Floats, ISO 8601 strings, and negative values are rejected at the source-side.
  • Rule 4. Type validation happens before canonicalisation. Schema-level fields that should be integers reject floats hard, not silent-cast.
  • canon_version pin. Receipts carry canon_version: "jcs-rfc8785-v1" as an in-band format-version pin for year-five auditability.
  • Array element order preserved. ["UK","EU"] and ["EU","UK"] hash differently per RFC 8785 §3.2.3 -- producer-side ordering is load-bearing.

The categorical screen result (ALLOW / REFER / DENY) is enforced as a closed set.

Cross-impl validation

This TypeScript package is byte-for-byte equivalent to the Python sibling (algovoi-substrate on PyPI). The substrate has been validated across five implementations:

Substrate matrix: https://gist.github.com/chopmob-cloud/b327814c4e17ed9fc7b4f29c8bda523c

Composite trust-query matrix: https://gist.github.com/chopmob-cloud/f2e9f0877b7d9fff70c8eca46e4ce636

Tests

npm install
npm test

Production reference

The reference exhibit for this substrate is AlgoVoi's /compliance/attestation audit chain, live at https://api.algovoi.co.uk/compliance/attestation. The migration boundary (receipts before / after 2026-05-21) is observable directly from the chain.

Spec references

Conformance to the canonicalisation discipline

This package emits receipts pinned to canon_version: jcs-rfc8785-v1 in-band. Downstream verifiers (algovoi-audit-verifier and any conformant third-party verifier) read the pin to select the canonicalisation rule applied at emission.

The pin is the load-bearing primitive for the Substrate Adopters Registry: adopters anchoring to this discipline pin the same canon_version value in their own publicly-citable artefacts. AlgoVoi maintains the registry as a neutral observer; this package is recorded there as the AlgoVoi reference implementation.

Substrate adopters

AlgoVoi is recorded in the Substrate Adopters Registry as the substrate author (v1 and v2). Parties anchoring their own services or specifications to canon_version: jcs-rfc8785-v1 are recorded in the registry via the submission process. AlgoVoi validates submissions against the artefact's canonical bytes and adds qualifying entries.

Licence

Apache 2.0. See LICENSE.

Author

AlgoVoi (Christopher Hopley, GitHub chopmob-cloud).