nostr-client-patterns

Coordinate relay pools, subscription lifecycles, and event deduplication for Nostr clients.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill provides a complete blueprint and implementation patterns for building a robust Nostr client, including relay pool management, subscription lifecycles, event deduplication, optimistic publishing, and resilient reconnection.

Core Features & Use Cases

  • Relay pool management across multiple relays with per-relay state tracking, backoff and jitter, and per-connection lifecycle.
  • Multi-relay subscription lifecycle with per-relay EOSE coordination, replacement of subscriptions, and reconnect-aware resubscription using a since timestamp.
  • Deduplication and replacement handling for regular and replaceable events to ensure consistent UI state.
  • Optimistic publishing with per-relay OK handling, retry strategies, and timeout fallbacks, plus local cache for fast loads.
  • Reconnection handling that preserves state and ensures gap-free event delivery across relaunches.
  • Optional local caching strategies to speed up initial loads and reduce network usage.

Quick Start

Ask your agent to implement a Nostr client using the nostr-client-patterns blueprint, wiring in relay management, subscription lifecycles, and optimistic publishing.

Frequently Asked Questions about nostr-client-patterns

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

FAQPage Schema
How do I coordinate EOSE across multiple Nostr relays in a subscription?

Coordinating EOSE across multiple Nostr relays requires a per-relay subscription lifecycle that tracks the end of stored events for each connection independently before signaling completion to the UI.

What is the best way to handle Nostr relay reconnection with backoff and jitter?

Handling Nostr relay reconnection with backoff and jitter requires tracking per-relay connection state and using reconnect-aware resubscription with a since timestamp to ensure gap-free event delivery.

How does event deduplication work for regular and replaceable Nostr events?

Event deduplication for regular and replaceable Nostr events works by tracking event IDs and applying replacement rules to discard older versions, ensuring consistent UI state across multi-relay streams.

Can I implement optimistic publishing for Nostr events with per-relay OK handling?

You can implement optimistic publishing for Nostr events with per-relay OK handling by updating local cache immediately, tracking confirmation responses, and applying retry strategies with timeout fallbacks.

Do I need NIP-42 authentication to build a reliable Nostr client?

You need NIP-42 authentication to build a reliable Nostr client when connecting to restricted relays that require authenticated subscription and publishing access for protected event retrieval.