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

@inversealtruism/csd-siwc

v0.1.15

Published

Sign in with CSD (SIWC) — audience-bound, replay-resistant wallet auth for Compute Substrate (CAIP-122 / EIP-4361 style). Build / parse / digest / verify.

Downloads

822

Readme

@inversealtruism/csd-siwc

Sign in with CSD: an EIP-4361 / CAIP-122 analogue for the Compute Substrate. A relying party (RP) asks a wallet to sign a canonical, human-readable message bound to the RP's domain, a single-use nonce, and the chain id; the RP then verifies the signature server-side and derives the account only from the recovered key (never from a client-supplied address field).

import { buildSiwcMessage, signSiwc, verifySiwc, generateNonce, rfc3339, CSD_CHAIN_MAINNET } from "@inversealtruism/csd-siwc";

// RP issues a nonce, wallet builds + signs:
const fields = { domain: "app.example", account, uri: "https://app.example/login", version: "1",
  chainId: CSD_CHAIN_MAINNET, nonce, issuedAt: rfc3339(Date.now()), expirationTime: rfc3339(Date.now() + 600_000) };
const { message, sig64, pub33 } = signSiwc(fields, priv);

// RP verifies (fail-closed). `account` is the PROVEN signer.
const r = verifySiwc({ message, sig64, pub33 }, { domain: "app.example", nonce, chainId: CSD_CHAIN_MAINNET });
if (r.ok) grantSession(r.account);

Security model

  • Domain-separated digest: sha256d(tagged_hash("CSD-SIWC-v1", utf8(message))) is disjoint from the tx sighash (CSD_SIG_V1) and the legacy login digest, so a sign-in signature can never be replayed as a transaction or a legacy login.
  • Canonical round-trip gate: verifySiwc re-builds the parsed fields and rejects unless the bytes match, closing line-injection / field-smuggling. Field values reject all line terminators (incl. U+2028/2029/0085).
  • Time bounds: timestamps MUST carry an explicit timezone (RFC3339 Z/offset; a zoneless time is rejected to avoid per-server-TZ divergence). issuedAt must be ≤ now + futureSkew (default 120s, tolerating normal NTP drift; set futureSkewMs to tighten/loosen) and not older than ~1h; expirationTime is required.
  • Nonce + audience: single-use nonce and per-RP domain binding are the RP's responsibility (the library is stateless and binds audience via the message bytes).

Cross-language parity (digest + canonical message) is pinned by conformance/siwc_ref.py (a Python reference) and conformance/crosscheck-siwc.mjs. License: MIT.