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

@virtonetwork/authenticators-substrate

v1.2.3

Published

An Authenticator compatible with KreivoPassSigner that uses substrate-style signatures

Readme

Substrate Authenticator

📚 Documentation

A TypeScript helper that wires substrate-style signatures to the @virtonetwork/signer stack. It exposes a single class, Substrate, that fulfils the Authenticator<number> interface used by PassSigner.

Setup

First, ensure you have the necessary packages installed:

npm install @virtonetwork/authenticators-substrate @virtonetwork/signer

To initialize a SubstrateKey authenticator, you need a username, a signer (e.g., from a browser extension or keyring), and a block hash challenger.

import { SubstrateKey } from '@virtonetwork/authenticators-substrate';
import { blockHashChallenger, KreivoPassSigner } from '@virtonetwork/signer';
import { createClient } from 'polkadot-api';
import { getWsProvider } from 'polkadot-api/ws-provider';

const SIGNER = createEd25519Signer();
const USERNAME = '[email protected]';

const client = createClient(getWsProvider('wss://kreivo.io'));
const sk = await new SubstrateKey(
  USERNAME,
  SIGNER,
  blockHashChallenger(client),
).setup();

Registration

The registration process involves two steps:

[!NOTE] Registration usually happens server-side. A federated registration service receives the attestation payload from the client and submits the transaction, paying the fees to register the Pass user.

Generating the attestation payload using SubstrateKey.register(blockNumber).

const finalized = await client.getFinalizedBlock();
const keyRegistration = await sk.register(finalized.number);

// We send the keyRegistration to the server
fetch('/api/register', {
  method: 'POST',
  body: JSON.stringify(keyRegistration),
});

Then, submitting the transaction onchain, via api.tx.Pass.register with the generated payload.

import { kreivo } from '@polkadot-api/descriptors';
const api = client.getTypedApi(kreivo);

const tx = api.tx.Pass.register({
  user: Binary.fromBytes(sk.hashedUserId),
  attestation: {
    type: 'SubstrateKey',
    value: {
      message: {
        context: keyRegistration.message.context,
        challenge: keyRegistration.message.challenge,
        authority_id: keyRegistration.message.authority_id,
      },
      public: ss58Encode(keyRegistration.public.asHex()),
      signature: keyRegistration.signature,
    },
  },
});

const txHash = await tx.signAndSubmit(SERVICE);

Authentication

Once registered, the SubstrateKey can be used to sign transactions on behalf of the user using KreivoPassSigner. The signer's address is a sub-account derived from the collection and device.

[!TIP] Device Permissions & Delegation: SubstrateKey authenticators can also authorize a server to perform actions on the user's behalf (such as adding devices, recovering access, or performing background tasks) through the device permissions model.

const kreivoPassSigner = new KreivoPassSigner(sk);
const accountId = ss58Encode(kreivoPassSigner.publicKey, 2);
const remark = Binary.fromText('Hello, Kreivo!');
const tx = api.tx.System.remark_with_event({ remark });

const txHash = await tx.signAndSubmit(kreivoPassSigner);