Skip to content

Installation

Package Manager

sh
npm install nostr-core
sh
pnpm add nostr-core
sh
yarn add nostr-core

Requirements

  • Node.js 18+ or any runtime with Web Crypto and WebSocket support (Deno, Bun, Cloudflare Workers)
  • ESM only - nostr-core ships as an ES module. Your project must use "type": "module" in package.json or use .mjs file extensions.

Dependencies

nostr-core has four runtime dependencies, all from the audited noble / scure family:

PackagePurpose
@noble/curvessecp256k1 / schnorr signatures
@noble/hashesSHA-256, HMAC, HKDF
@noble/ciphersAES-CBC, ChaCha20
@scure/baseBase64, bech32 encoding

No framework dependencies. No native addons.

Verify Installation

ts
import { NWC, generateSecretKey, getPublicKey } from 'nostr-core'

const sk = generateSecretKey()
console.log('Public key:', getPublicKey(sk))

If the above prints a 64-character hex string, you're ready to go.

Released under the MIT License.