README.md raw

Nostr Protocol Skill

A comprehensive Claude skill for working with the Nostr protocol and implementing Nostr clients and relays.

Overview

This skill provides expert-level knowledge of the Nostr protocol, including:

Contents

SKILL.md

The main skill file containing:

Reference Files

references/nips-overview.md

Comprehensive documentation of all standard NIPs including:

references/event-kinds.md

Complete reference for all Nostr event kinds:

references/common-mistakes.md

Detailed guide on implementation pitfalls:

When to Use

Use this skill when:

Key Features

Complete NIP Coverage

All standard NIPs documented with:

Cryptographic Operations

Detailed guidance on:

WebSocket Protocol

Complete reference for:

Event Lifecycle

Understanding of:

Best Practices

Comprehensive guidance on:

Quick Start Examples

Publishing a Note

const event = {
  pubkey: userPublicKey,
  created_at: Math.floor(Date.now() / 1000),
  kind: 1,
  tags: [],
  content: "Hello Nostr!"
}
event.id = calculateId(event)
event.sig = signEvent(event, privateKey)
ws.send(JSON.stringify(["EVENT", event]))

Subscribing to Events

const filter = {
  kinds: [1],
  authors: [followedPubkey],
  limit: 50
}
ws.send(JSON.stringify(["REQ", "sub-id", filter]))

Replying to a Note

const reply = {
  kind: 1,
  tags: [
    ["e", originalEventId, "", "root"],
    ["p", originalAuthorPubkey]
  ],
  content: "Great post!"
}

Official Resources

Skill Maintenance

This skill is based on the official Nostr NIPs repository. As new NIPs are proposed and implemented, this skill should be updated to reflect the latest standards and best practices.

License

Based on public Nostr protocol specifications (MIT License).