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

@orangecheck/chat-core

v0.2.8

Published

Verify OC Chat's public artifacts: channel descriptors and posts, directory listings and did:oc session devices. See https://github.com/orangecheck/oc-chat-protocol.

Readme

@orangecheck/chat-core

Verify the public artifacts of OC Chat (0.4.0), a mode of OC Lock: channel descriptors and their governance chain (kind 30110), channel posts and the write gate (kind 30111), directory handles (kind 30114) and did:oc session devices.

Every read a verdict needs is passed in: relay queries, device records, the auth host's keys, chain state and a BIP-322 verifier. The same rules run in a browser, in a relay's write gate and in a terminal. @orangecheck/chat-core/io has an Esplora reader for the utxo-floor write proof.

This package verifies. It does not build, sign or publish events, and it does not open direct messages.

Install

npm i @orangecheck/chat-core

Usage

import { verifySignature } from '@orangecheck/bip322';
import { readChannelVersions, recordReads, resolveChannelChain } from '@orangecheck/chat-core';

const verifyBip322 = ({ address, message, signature }) => verifySignature(address, message, signature);
const reads = recordReads(lookupDeviceRecords, { hostKeys: loadAuthHostKeys, verifyBip322 });
const { events } = await readChannelVersions(channelId, { query, everBoundKeys: reads.everBoundKeys });
const channel = await resolveChannelChain(events, channelId, { ...reads, hostKeys: loadAuthHostKeys, verifyBip322 });

lookupDeviceRecords(principal) returns the kind-30078 records under the principal's d-tag (deviceDtag(principal)) and, per relay asked, whether it finished answering (relayStatus). query(filter) makes one relay request, the filter sent as given (since and until included). A read that got no answer throws UnansweredReadError; a verifier never reads silence as "no".

Each read is paged with until to its end on every relay (nostr-core readPages), so a relay that caps a page below the 500 asked is read past its cap. Pass maxLimit: relayMaxLimit (from @orangecheck/nostr-core) to count a relay whose NIP-11 document declares a page under 100 as cut off.

floorMet says whether every read met the read floor (§8.7 below). A read anyone can publish into (the open read, the legacy d-tag, the walk back) that a bound or a second holding more than a page stopped is truncated, and meets the floor when each REQ it made did: the role holders' key reads find what it did not reach, and incomplete says when one of those stopped at its bound. Every other read meets the floor only on the relays read to its end, so a relay that stops partway through a role holder's key read leaves it unmet.

A directory relay that answered and was cut off leaves a handle E_DIR_UNRESOLVED. Only one that sent nothing is not answering, and only then is the public read the walk itself (§8.2.6).

Relay floor and write quorum (SPEC §8.7)

A record is on whichever relays its publisher reached, so an answer that rests on something not being there ("live", "bound now", "not bound", "no newer version") is drawn only from a read that met the floor: readFloor(asked), which is asked - WRITE_QUORUM + 1, at least 1. What a read returned needs one relay. A binding or revocation write counts as published only once WRITE_QUORUM (2) relays of the reference set readers ask hold it; a relay outside that set counts for nothing. For device records and revocations that set is DEVICE_RECORD_RELAYS, nostr-core's five DEFAULT_RELAYS that OC Lock and OC Vault count over (floor 4 of 5); for OC Chat's channel versions it is CHAT_RELAYS (floor 3 of 4). publishToQuorum writes to the given relays and the reference set, counts a reference relay on its OK or, given readBack, only once it serves the write back, and retries until then, or reports "not yet published". The two together are what make a revocation hold: the floor plus the quorum exceeds the relays asked, so a revocation is missed only when every relay that sent OK for it is silent in the same read, and that read does not meet the floor. Neither rule alone is enough. The floor also applies to the reads that find a channel's role holders' keys, so no key that signs a newer version is missed.

From a shell, oc chat verify in @orangecheck/cli runs these checks against live relays and the chain.

Conformance

The tests run the spec's vectors vc07, vc08 and vc14–vc20 from an oc-chat-protocol checkout (OC_CHAT_VECTORS_DIR). In CI a missing checkout fails the build. The directory walk itself is @orangecheck/lock-core/directory, which runs vc22–vc25.

Trust anchors

  • A did:oc session device is bound only by the vouch of the auth host, ochk.io, a named trust anchor. That tier is not offline-verifiable and carries no Bitcoin claim.
  • The reference deployment's directory relay is wss://relay.ochk.io (DIRECTORY_RELAYS), an availability anchor: it can withhold a claim, never reorder or forge one.

License

MIT