nostr-relay-builder

Build a Nostr relay with Bun handling WebSocket connections and NIP-01 events.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/accolver/skill-maker --skill nostr-relay-builder
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nostr-relay-builder
Source: https://github.com/accolver/skill-maker/tree/main/nostr-relay-builder
Command: npx skills add https://github.com/accolver/skill-maker --skill nostr-relay-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implement or extend a Nostr relay to handle WebSocket connections, event validation, filtering, storage policies, subscriptions, and relay-side NIP support.

Core Features & Use Cases

  • WebSocket server that accepts connections and manages per-connection state
  • NIP-01 protocol support: event validation, filter matching, REQ/CLOSE handling, and real-time broadcasts
  • Kind-based storage rules: regular, replaceable, ephemeral, and addressable events
  • Subscription management per connection with per-subscription filters and per-connection scope
  • Progressive NIP support (NIP-11 info document, NIP-42 auth, NIP-45 COUNT, NIP-50 search) as enhancements
  • Real-world usage: deploy as a backend relay for Dapps that require relay-side validation and selective broadcasting

Quick Start

Set up a Bun-based WebSocket server and implement NIP-01 support end-to-end.

Frequently Asked Questions about nostr-relay-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Nostr relay with WebSocket support in Bun?▼

To build a Nostr relay with WebSocket support in Bun, you set up a WebSocket server that accepts connections, validates events by computing IDs via SHA-256 canonical serialization, verifies Schnorr signatures, and stores or broadcasts events based on kind rules.

How does Nostr relay event validation and subscription filtering work?▼

Nostr relay event validation works by computing IDs via SHA-256 of canonical serialization and verifying Schnorr signatures. Subscription filtering works through REQ messages with filters for ids, authors, kinds, and tags, delivering matching events followed by EOSE.

Can I implement NIP-11 relay info documents and NIP-42 authentication in a Nostr relay?▼

Yes, you can implement NIP-11 relay info documents by responding to HTTP GET requests with Accept: application/nostr+json, and progressively add NIP-42 authentication support alongside other enhancements like NIP-45 COUNT and NIP-50 search.

What are the storage rules for different Nostr event kinds in a relay?▼

Nostr relay storage rules categorize events as regular, replaceable, ephemeral, or addressable. The relay stores or broadcasts events according to these kind-based rules, managing per-connection state and subscriptions effectively.

Do I need Bun to set up a Nostr relay with WebSocket connections and event validation?▼

Bun is the runtime used to set up this Nostr relay with WebSocket connections and event validation. It manages the WebSocket server, per-connection subscriptions, and real-time broadcasts required by the NIP-01 protocol.