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

x402-hedera-receipts

v0.1.1

Published

Verifiable receipts for x402 on Hedera. Signed offers, price schedules and meter readings, anchored to HCS, so an overcharge is arithmetic anyone can check.

Readme

x402-hedera-receipts

Verifiable receipts for x402 on Hedera. Signed offers, price schedules and meter readings, anchored to HCS — so an overcharge is arithmetic anyone can check.

x402's upto scheme lets a seller decide, after the work, how much to charge. Nothing in x402 makes that decision checkable: the canonical offer-receipt payloads carry no meter reading, so an upto receipt is unverifiable by construction. This package makes it evidence.

What it does

The seller signs four documents and anchors them to a Hedera Consensus Service topic:

  • before the work — the canonical x402 offer (commits the ceiling) and a price schedule (commits the unit price the canonical offer has no field for)
  • after the work — the canonical receipt, and a meter reading carrying the token count and a hash of what was delivered

Then anyone can audit any settlement using only the public Mirror Node — no key, no account, no cooperation from the seller:

captured_amount  ≠  units × unit_price_from_the_signed_offer     ⇒  provable fraud

At $0.0001 a message, Hedera is the only chain where a per-call receipt costs less than the call.

The CLI — audit anything, trusting nobody

npx x402-hedera-receipts audit --topic 0.0.9557142
npx x402-hedera-receipts audit --topic 0.0.9557142 --tx 0.0.X@169...  # one settlement, in full

Reads the public Hedera Mirror Node and the chain. It has no key, no account, and no access to any server. Delete every machine the seller owns and it returns the same verdict.

Library

import { auditSettlement, buildLedger, auditSettlementLogic } from 'x402-hedera-receipts';

// audit one settlement from HCS + the chain
const verdict = await auditSettlement(bundle, 'hedera:testnet');
//   → { ok, violations: ['arithmetic_fraud', ...], checks, captured, claimed, units, unitPrice }

// score every seller on a topic, purely from public data
const ledger = await buildLedger({ receiptsTopicId: '0.0.9557142', network: 'hedera:testnet' });

// the verdict as a PURE function of what the chain already told us — no I/O, unit-testable
const v = auditSettlementLogic(bundle, sellerPublicKey, onChainCapture);

Key resolution needs no infrastructure. A receipt's kid is did:hedera:testnet:0.0.X#key-1, and the Mirror Node serves the account's public key. The seller signs receipts with the same key it holds funds with — it cannot disown a signature without disowning the account being paid.

What it proves — and what it does not

Proves: the seller signed these numbers; the terms on HCS are the terms the buyer signed on-chain; the charge equals units × the signed unit price; the chain took exactly what the receipt admits; nothing exceeded the ceiling.

Does not prove: that the token count itself is truthful. The seller counts the tokens; a consistent liar passes every check. What changes is that the count is now signed, timestamped, and bound to a hash of what was delivered — the buyer holds the response, can recount, and then holds the seller's signature on a false number. That is the difference between a dispute and a complaint.

Bonded disputes (HIP-991)

createDisputeTopic / postDispute file an accusation on a fee-gated HCS topic, so making a claim costs a bond charged by consensus — a rival cannot flood the reputation ledger for free. There is no equivalent on any other chain.

License

Apache-2.0