Tools · Agent-integration primitives

Nostr

The open identity-and-discovery layer under the agent stack — cryptographic keypairs for portable identity, and relays for censorship-resistant service discovery. It's how an agent finds providers and controls a wallet; the money itself rides Lightning/Cashu.

protocol Nostr open protocol & community (NIPs) Links verified 2026-06-04

What it is

Nostr (“Notes and Other Stuff Transmitted by Relays”) is a deliberately simple open protocol: cryptographically signed events published to independent servers called relays. Identity is a keypair, not an account — your public key (npub) is who you are, portable across every relay and app, with no sign-up, no platform, and no one who can revoke it. There is no central server; you read and write by connecting to whichever relays you choose.

For the Bitcoin agent stack, Nostr is the identity-and-discovery layer — the connective tissue under several pieces an agent already uses:

Nostr carries no money itself. It is identity, messaging, and discovery; the value rides Lightning and Cashu alongside it.

When to use it

Dependencies

A keypair (npub/nsec), a set of relays to publish to and read from, and a client library (nostr-sdk, nostr-tools, or NDK); for wallet control, an NWC connection rather than a raw key. No platform account and no single server.

Quick start

  1. Get a keypair (npub/nsec) from any Nostr client or library, and guard the nsec like a private key — it is the identity.
  2. Choose relays. Connect to several independent relays; availability and content vary by relay, so redundancy is the norm.
  3. For wallet control, use NWC — connect the agent to a wallet via a revocable, budget-scoped connection string (Alby & NWC).
  4. For discovery, subscribe to the relevant event kinds on your relays (e.g. Routstr provider-announcement events) and filter for the providers/models you want.

Libraries for wiring an agent in (not a human app): the onboarding UX is mostly human-and-app today, but the programmatic primitives are solid — nostr-sdk (Rust / Python, with a built-in NWC client), nostr-tools (JS/TS, headless option), and NDK (TS, multi-relay coordination). An agent integrates Nostr through one of these rather than through a wallet app.

The NIPs (Nostr Implementation Possibilities) at github.com/nostr-protocol/nips are the canonical specs; NIP-47 (NWC) and NIP-57 (zaps) are the two most load-bearing for agent payments.

Gotchas