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

@enc-protocol/plugin-dm-ratchet

v0.9.0

Published

EnvelopeEncryptFn/DecryptFn for ENC Ratchet_DM: secp256k1 per-pair epoch + per-message HKDF-SHA256 chain ratchet + XChaCha20-Poly1305. The ratchet is GENERATED from Lean Enc.Core.Plugins.RatchetPair (impl-spec → sdk/core/dm-ratchet.js) and composes the fo

Readme

@enc-protocol/plugin-dm-ratchet

EnvelopeEncryptFn / EnvelopeDecryptFn for the ENC protocol's Ratchet_DM: secp256k1 per-pair epoch + per-message HKDF-SHA256 chain ratchet + XChaCha20-Poly1305. Wire-compatible with impl-zk / impl-wasm / impl-node.

NOT the generic X25519/X3DH/ChaCha20 demo in plugin-envelope-dm — that is a different cryptographic construction and a different wire format.

Provenance (Tier B — generated + verified)

The ratchet (ratchetMessageKey / dmRatchetEncrypt / dmRatchetDecrypt) is generated from the Lean model Enc.Core.Plugins.RatchetPair (impl-spec → sdk/core/dm-ratchet.js) and kept byte-identical here. It composes ONLY the formally-verified crypto primitives from @enc-protocol/core/crypto.js (HKDF-SHA256 deriveKey, XChaCha20-Poly1305 encrypt/decrypt). The conformance test pins ratchetMessageKey byte-for-byte against the spec algorithm (the same one in impl-super/shared/dm-spec-crypto.ts it replaces).

ratchet_seed = HKDF(epoch_secret, "enc:dm:ratchet:init")
chain[i+1]   = HKDF(chain[i],     "enc:dm:ratchet:advance")
message_key  = HKDF(chain[i],     "enc:dm:ratchet:message")
ciphertext   = base64( nonce(24) || XChaCha20-Poly1305(message_key, plaintext) )

The seam: crypto here, epoch state in the app

Per-pair epoch establishment and sender-seq tracking are application state, so makeDmRatchet({ getEpochSecret }) takes a host resolver:

import { makeDmRatchet } from '@enc-protocol/plugin-dm-ratchet'
const { encrypt, decrypt } = makeDmRatchet({ getEpochSecret: (peerPub) => app.epochSecretFor(peerPub) })
registry.register('EnvelopeEncryptFn', encrypt)
registry.register('EnvelopeDecryptFn', decrypt)

Crypto → this plugin; epoch/session bookkeeping → the app.