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

@sonate/verify-sdk

v2.1.1

Published

Client-side SDK for verifying SONATE trust receipts

Readme

@sonate/verify-sdk

npm version license

Client-side SDK for verifying SONATE Trust Receipts. Works in Node.js and browsers — zero backend calls required.

Install

npm install @sonate/verify-sdk

Quick Start

import { verify, fetchPublicKey } from '@sonate/verify-sdk';

// Fetch the SONATE public key (or provide your own)
const publicKey = await fetchPublicKey();

// Verify a receipt
const result = await verify(receipt, publicKey);

if (result.valid) {
  console.log('All checks passed');
  console.log('Trust score:', result.trustScore);
} else {
  console.error('Verification failed:', result.errors);
}

API

verify(receipt, publicKey)

Full verification with detailed check results.

const result = await verify(receipt, publicKey);

// result.valid — overall pass/fail
// result.checks.structure — required fields present
// result.checks.signature — Ed25519 signature valid
// result.checks.chain — hash chain intact
// result.checks.timestamp — timestamp reasonable
// result.trustScore — extracted from telemetry (0-100)
// result.errors — array of error messages

quickVerify(receipt, publicKey)

Boolean-only verification for simple pass/fail checks.

const isValid = await quickVerify(receipt, publicKey);

verifyBatch(receipts, publicKey)

Verify multiple receipts at once.

const { total, valid, invalid, results } = await verifyBatch(receipts, publicKey);

fetchPublicKey(url?)

Fetch a SONATE public key from a backend endpoint.

// Default: fetches from SONATE platform
const key = await fetchPublicKey();

// Custom endpoint
const key = await fetchPublicKey('https://your-server.com/api/public-key');

canonicalize(obj)

Deterministic JSON serialization via RFC 8785 (JSON Canonicalization Scheme) — it delegates to the json-canonicalize library, with undefined values stripped first. This is the exact canonical form SONATE platform receipts are signed and chained over, so the verifier reproduces it byte-for-byte.

import { canonicalize } from '@sonate/verify-sdk';

const canonical = canonicalize({ b: 2, a: 1 });
// '{"a":1,"b":2}'

Note: The SDK, the platform receipt generator, and @sonate/trust-receipts all canonicalize the same way (RFC 8785), so a receipt produced by any of them verifies here without a canonicalization mismatch.

Verification Checks

| Check | What it verifies | |-------|-----------------| | Structure | Receipt has the required id and signature fields (V2 format) | | Hash | id matches SHA-256 of the canonical receipt payload — the content hasn't been altered | | Signature | Ed25519 signature over the canonical receipt content | | Chain | chain_hash matches SHA-256(canonical_content + previous_hash) | | Timestamp | Not in the future (5-min skew), not older than maxAgeMs (default 1 year) |

Scope: these checks prove a receipt is authentic and untampered — it was signed by the holder of the key and nothing has been changed since. They do not re-derive the trust score; result.trustScore is read from the signed payload (authentic as issued).

Browser Support

The SDK uses Web Crypto API in browsers and falls back to Node.js crypto module. Ed25519 operations use @noble/ed25519 for cross-platform compatibility.

<script type="module">
  import { verify, fetchPublicKey } from '@sonate/verify-sdk';

  const publicKey = await fetchPublicKey();
  const result = await verify(receiptFromAPI, publicKey);
  console.log('Valid:', result.valid);
</script>

Receipt Format

The SDK verifies V2 Trust Receipts:

interface TrustReceipt {
  id: string;              // SHA-256 of canonical content
  version: '2.0.0' | '2.2.0';
  timestamp: string;       // ISO 8601
  session_id: string;
  agent_did: string;       // did:web:...
  human_did: string;
  mode: 'constitutional' | 'directive';
  interaction: {
    prompt?: string;        // Raw content (when included)
    response?: string;
    prompt_hash?: string;   // SHA-256 hash (privacy-preserving)
    response_hash?: string;
    model: string;
  };
  chain: {
    previous_hash: string;
    chain_hash: string;
  };
  signature: {
    algorithm: 'Ed25519';
    value: string;          // Hex-encoded
    key_version: string;
  };
}

FAQ

What is a Trust Receipt?

A cryptographically signed, hash-chained record of an AI interaction. It proves a canonical representation of the payload, the governance result, chain linkage to prior receipts, and the signer identity. Anyone can verify a receipt independently with this SDK — no vendor trust required.

How is this different from logs?

Logs are mutable, vendor-controlled, and not independently verifiable. A Trust Receipt is signed with Ed25519, canonicalized deterministically, and chained to prior receipts so tampering with any field causes verification to fail. Logs describe what was said. Receipts prove it.

Can I verify a receipt without using the SONATE platform?

Yes — that's the point. This SDK is MIT licensed and runs verification entirely client-side (zero backend calls). If you needed our servers to confirm a receipt, it would just be another log. You supply the receipt and a public key; verification is local.

Does verifying a receipt prove the AI's trust score is correct?

No. Verification proves the receipt is authentic and untampered (signature, hash, chain, timestamp). The trust/telemetry scores are read from the signed payload as issued — this SDK does not re-run the governance kernel or re-derive scores. Independent re-computation of the decision is a separate, server-side capability.

What is the relationship between SYMBI and SONATE?

SONATE is the production trust infrastructure — signed receipts, governance, audit evidence. SYMBI is the experimental access and participation layer that explores public-facing interaction with the system. The two are intentionally separate. SONATE is monetised via SaaS; SYMBI is not a financial product.

What is open and what is proprietary?

The Trust Receipt schema is open and this verify SDK is MIT licensed. The SONATE platform — orchestration, detection, scoring kernel, dashboards, hosted services — is proprietary to Yseeku Pty Ltd. Independent verification stays open by design.

Related Packages

License

MIT