Nostr Protocol Basics: Events, Signatures, and Communication

2024-12-23

Nostr's NIP-01 outlines its core mechanics. Each user has a keypair, using Schnorr signatures on the secp256k1 curve. The core is the event, containing fields like ID, pubkey, timestamp, kind, tags, content, and signature. The event ID is the SHA256 hash of the serialized event data. Tags reference other events or users, with three standard tags defined: e (references an event), p (references a user), and a (references an addressable event). Event kinds define their meaning; NIP-01 defines two basic kinds: user metadata and text notes, and specifies how different kind ranges are handled (regular, replaceable, ephemeral, and addressable). Clients communicate with relays via websockets, sending events, requesting events, and closing subscriptions. Relays return events matching filters and send OK, EOSE, CLOSED, and NOTICE messages.