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

nosskey-sdk

v0.0.4

Published

SDK for Passkey-Derived Nostr Identity a.k.a. Nosskey

Readme

Overview and Purpose of Nosskey

Nosskey (a portmanteau of "Nostr" and "passkey") is a securely managing Nostr private keys and signing events using WebAuthn (passkey) technology. While secure management of private keys has been a challenge in the Nostr protocol, this SDK achieves both high security and excellent user experience by utilizing passkey technology.

This SDK inherits the concept from the previously developed nosskey, but represents a completely different approach thanks to a breakthrough made possible by utilizing the WebAuthn PRF extension.

This approach is planned to be proposed as a Nostr Implementation Possibility (NIP).

Benefits of Integrating Passkeys (WebAuthn) with Nostr

Traditional Nostr private key management methods, such as plaintext storage or password-protected format (NIP-49), have presented challenges in terms of security and convenience. Using WebAuthn offers the following benefits:

  • Phishing Resistance: Domain validation prevents authentication on fraudulent sites
  • Automatic Backup: Entrusting private key management to the platform's passkey synchronization function enables secure cloud backup
  • Cross-Device Support: OS passkey synchronization features provide the same experience across multiple devices

Key Features

  • 📲 Biometric Authentication: Integration with passkey authentication such as fingerprint and face recognition
  • 🔐 Phishing Resistance: Domain validation prevents unauthorized use on phishing sites
  • Fast Processing: Efficient implementation utilizing WebAuthn PRF extension
  • 🔄 Cross-Device Support: Available on multiple devices through OS passkey synchronization
  • 🔧 Flexible Approach: Supports both direct PRF value utilization and encryption/decryption methods

Installation

npm install nosskey-sdk

Basic Usage Examples

Creating a Passkey and Generating a New Nostr Key (Recommended Approach)

import { NosskeyManager } from 'nosskey-sdk';

const keyMgr = new NosskeyManager();

// Create a passkey (displays browser's passkey UI)
const credentialId = await keyMgr.createPasskey();

// Use PRF value directly as a Nostr key
const key = await keyMgr.directPrfToNostrKey(credentialId);
keyMgr.setCurrentKeyInfo(key);

// Get the public key
const publicKey = await keyMgr.getPublicKey();
console.log(`Public key: ${publicKey}`);

// Sign an event
const event = {
  kind: 1,
  content: 'Hello Nosskey!',
  tags: [],
  created_at: Math.floor(Date.now() / 1000)
};
const signedEvent = await keyMgr.signEvent(event);

Importing an Existing Key (Alternative Approach)

import { NosskeyManager } from 'nosskey-sdk';
import { hexToBytes } from 'nosskey-sdk';

const keyMgr = new NosskeyManager();

// Create a passkey
const credentialId = await keyMgr.createPasskey();

// Import an existing Nsec private key
const existingSecretKey = hexToBytes('7f...'); // 32-byte private key
const key = await keyMgr.importNostrKey(existingSecretKey, credentialId);
keyMgr.setCurrentKeyInfo(key);

Supported Environments

Nosskey SDK works in browser environments that support WebAuthn and the PRF extension. Passkey generation and authentication also require authenticators from compatible OS/devices. The main compatibility status is as follows:

  • Chrome and Chromium-based browsers: Supported in version 118 and later
  • Safari: Supported in macOS 14.0 (Sonoma) and later, iOS 17 and later
  • Firefox: Supports WebAuthn, but PRF extension support is limited

For detailed compatibility information, please refer to the PRF Support Tables.

Sample Application

Details of the sample application can be found in examples/svelte-app. This application provides a demo combining Passkey and Nostr using the features of the Nosskey SDK.

To see it in action, visit the online demo: https://nosskey.app.

License Information

This project is released under the MIT License. For details, please refer to the LICENSE file.

Detailed Documentation

For more detailed implementation and specifications, please refer to the following documents: