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

openproof-verify

v1.2.1

Published

Verify OpenProof cryptographic signatures on API responses. Replay protection, timestamp validation, and canonical JSON included.

Downloads

30

Readme

openproof-verify

Verify OpenProof cryptographic signatures on API responses.

OpenProof is an open protocol that adds ECDSA signatures to every API response — so any client can cryptographically prove that data came from the claimed source and has not been tampered with in transit.

Install

npm install openproof-verify
# recommended: also install ethers for full signature recovery
npm install openproof-verify ethers

Usage

const { verifyResponse } = require('openproof-verify')

const response = await fetch('https://your-api.com/v1/data')
const json = await response.json()

const result = verifyResponse(json)

if (result.valid) {
  console.log('✓ Response verified')
  console.log('  Signed by:', result.signer)
  console.log('  Signed at:', new Date(result.signed_at * 1000).toISOString())
} else {
  console.error('✗ Verification failed:', result.reason)
}

What OpenProof adds to an API response

Every OpenProof-compliant API includes a _trust envelope alongside the response data:

{
  "data": { "price": 2081.41, "symbol": "ETH" },
  "_trust": {
    "call_id":      "op_abc123def456",
    "endpoint":     "/v1/price/ETH",
    "payload_hash": "sha256:9f86d081...",
    "timestamp":    1711234567,
    "signer":       "0x41A024...",
    "signature":    "0x3ad7f1..."
  }
}

This proves:

  • The response came from the owner of 0x41A024...
  • The data field has not been modified since signing
  • The response was signed at timestamp (verified against a 5-minute window)

API

verifyResponse(response, options?)

Verify a full response object containing data and _trust.

verify(data, trust, options?)

Verify with explicit data and trust envelope objects.

verifyRemote(apiBaseUrl, data, trust)

Verify via the API's own /v1/verify/signature endpoint. Returns a Promise.

canonical(obj)

Serialize an object to deterministic canonical JSON (sorted keys, no whitespace).

clearReplayCache()

Clear the in-process replay protection cache. Useful in tests.

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | trustedSigners | string[] | undefined | Allowlist of signer addresses. If set, signature must come from one of these. | | maxAgeSeconds | number | 300 | Reject signatures older than N seconds. Set to 0 to disable. | | checkReplay | boolean | true | Reject duplicate call_id values (in-process cache). |

Security features

  • Replay protection — tracks call_id values in memory, rejects duplicates
  • Timestamp validation — rejects signatures older than 5 minutes by default
  • Future timestamp detection — rejects timestamps more than 30s in the future
  • Canonical JSON — deterministic serialization prevents hash manipulation
  • Input validation — validates all envelope fields before processing

Implementing OpenProof on your API

Any API can implement OpenProof. See the full protocol spec at openproof.io/spec or the SPEC.md.

Reference implementations:

License

MIT — free to use in any project, open or commercial.