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

@onchained/verify

v0.2.2

Published

Independently recover and verify an Onchained NFT from Ethereum JSON-RPC

Readme

@onchained/verify

Recover and independently verify an Onchained preservation from its Remount, Twin, or original ERC-721 contract and token ID. The token does not need an active mode. No gateway, indexer, Onchained API, private key, or historical log archive is used.

npx @onchained/verify <contract> <tokenId>

The contract may be:

  • a live or restored Onchained Remount;
  • a live or removed Onchained Twin; or
  • the original ERC-721 contract, including a preserved token that never used either mode.

For an original token, the verifier first checks for an active Remount or Twin and verifies its pinned package. When no mode is active, it derives the token's canonical subject ID, reads the newest-first package list from PreservationDirectoryV1, surveys every admitted recognizer, reports every compatible candidate, and verifies the newest usable preservation. Package discovery does not depend on a factory.

With no RPC option, the command assumes Ethereum mainnet and fails over across three public RPC endpoints. The current Ethereum mainnet deployment is built in. Supply --rpc to use your own provider. A custom RPC may point to another EVM chain. The verifier reads and reports the chain ID returned by the RPC.

On another unlisted chain, provide the published directory explicitly with --directory.

ONCHAINED_RPC_URL may replace --rpc. The package intentionally does not support the superseded factory-era test deployment or its backingsOf/event- scan discovery path.

To save all recovered inputs and a machine-readable report:

npx @onchained/verify <contract> <tokenId> \
  --directory 0xPreservationDirectoryV1 \
  --out ./onchained-verification

The command:

  1. authenticates the supplied or built-in directory;
  2. validates its frozen recognizer membership and backing kinds;
  3. derives each selected recognizer's capture and manifest registries;
  4. recovers the exact tokenURI, package, metadata, image, and evidence bytes;
  5. re-runs CID, UnixFS DAG/path, Arweave transaction/item/path proofs locally;
  6. checks an active Remount or Twin's canonical factory binding and renderer;
  7. reports Twin ownership synchronization state; and
  8. reports HTTPS relationships as testimony, never cryptographic proof.

Large files automatically fall back from readFile to paged readStoredRange calls and local FastLZ decompression.

Restore IPFS pins

The restoration command verifies the preservation, reconstructs the original IPFS blocks, and writes one CARv1 file per IPFS-backed asset:

npx @onchained/verify restore-ipfs <contract> <tokenId> \
  --directory 0xPreservationDirectoryV1 \
  --out ./onchained-restoration

The CAR files and restoration details are written under ./onchained-restoration/ipfs/. Add --pin to import the CAR files and pin their blocks with a running local Kubo node. Use --ipfs-bin <path> when the Kubo executable is not named ipfs or is outside PATH.

Direct-CID and multiblock-file CARs contain the complete file DAG and receive a recursive root pin. A directory-path CAR is sparse. It contains the exact directory and HAMT nodes traversed by the original URI plus the complete terminal file DAG. The command directly pins those path nodes and recursively pins the terminal file. This keeps the preserved rootCID/path resolvable. Unrelated sibling subtrees are outside the preservation and cannot be restored.

Options

--rpc <url>               custom JSON-RPC endpoint
--directory <address>     PreservationDirectoryV1 on an unlisted chain
--out <directory>         save report, source bytes, and evidence
--pin                     import restored CARs and pin them with local Kubo
--ipfs-bin <path>         Kubo CLI executable used by --pin (default: ipfs)
--json                    print the complete JSON report
--verbose                 show RPC and protocol identifiers
--color                   always use terminal colors
--no-color                disable terminal colors
--require-cryptographic   fail if any relationship is HTTPS testimony
--page-bytes <number>     ranged-read page size (default 16384)
--timeout-ms <number>     RPC timeout (default 60000)

Library API

import { verifyOnchainedNft } from "@onchained/verify";

const report = await verifyOnchainedNft({
  contract: "0xOriginalOrModeContract",
  tokenId: 5030n,
  rpcUrl: "https://your-rpc.example",
});

A caller may instead supply a viem-compatible client. Verification and CAR export use read-only Ethereum calls. The optional --pin action changes only the configured local Kubo node.

What a pass means

PASS means the on-chain identity/linkage checks and every available source proof passed. An offline proof does not relabel an on-chain ATTESTATION as a VERIFICATION.

PASS_WITH_TESTIMONY means all checkable facts passed, but at least one asset uses HTTPS. No historical proof can establish what an HTTPS origin served.

The default terminal report is a concise user summary. It uses color when standard output is a terminal and honors NO_COLOR. Use --verbose for RPC, recognizer, observation, and discovery details. Use --json for the complete machine-readable report.

Development

npm install
npm test
npm run build
npm pack --dry-run

Before publishing, run the CLI from the checkout:

node dist/cli.js <contract> <tokenId> \
  --rpc https://your-rpc.example

The opt-in live suite can exercise the published Ethereum mainnet deployment:

ONCHAINED_LIVE_TESTS=1 \
ONCHAINED_LIVE_RPC_URL=https://0xrpc.io/eth \
ONCHAINED_LIVE_CASES='[{"contract":"0xfb21114b01468c3d8a9874b874493a0200809B63","tokenId":"3096","chainId":1,"families":[7,7],"verdict":"PASS_WITH_TESTIMONY"}]' \
npm run test:live

Set ONCHAINED_LIVE_DIRECTORY when the fixture uses an unlisted deployment.