NIPs (Nostr Implementation Possibilities)
NIPs are the specification documents that define how Nostr works. They range from the core protocol to optional features.
What are NIPs?
NIPs are standards documents hosted at github.com/nostr-protocol/nips. They define:
- Core protocol behavior
- Event kinds and their formats
- Optional features and extensions
- Best practices for implementations
NIP Categories
Core Protocol
| NIP | Title | Description |
|---|---|---|
| NIP-01 | Basic Protocol | Fundamental protocol definition |
| NIP-02 | Follow List | Contact list and petnames |
| NIP-10 | Reply Threading | Conventions for replies |
Identity & Keys
| NIP | Title | Description |
|---|---|---|
| NIP-05 | DNS-Based Verification | Mapping identifiers to pubkeys |
| NIP-19 | Bech32 Entities | Human-readable key encoding |
| NIP-46 | Nostr Connect | Remote signing protocol |
Content Types
| NIP | Title | Description |
|---|---|---|
| NIP-23 | Long-form Content | Articles and blog posts |
| NIP-30 | Custom Emoji | Custom emoji in events |
| NIP-94 | File Metadata | File attachments |
Encryption & Security
| NIP | Title | Description |
|---|---|---|
| NIP-04 | Encrypted DMs | Direct messages (deprecated) |
| NIP-42 | Authentication | Client-relay auth |
| NIP-44 | Versioned Encryption | Modern encryption standard |
Social Features
| NIP | Title | Description |
|---|---|---|
| NIP-25 | Reactions | Likes and emoji reactions |
| NIP-57 | Zaps | Lightning payments |
| NIP-51 | Lists | Mute lists, bookmarks, etc. |
Relay Features
| NIP | Title | Description |
|---|---|---|
| NIP-11 | Relay Information | Relay metadata document |
| NIP-42 | Authentication | Relay authentication |
| NIP-65 | Relay List Metadata | User's relay preferences |
Essential NIPs
NIP-01: Basic Protocol
Defines the core protocol:
- Event structure and signing
- WebSocket message formats
- Filter syntax
- Relay behavior
Every implementation must support NIP-01.
NIP-19: Bech32 Entities
Defines human-readable encodings:
npub1... → Public key
nsec1... → Private key (never share!)
note1... → Event ID
nprofile1... → Profile + relay hints
nevent1... → Event + relay hints
naddr1... → Replaceable event address
Example:
import { nip19 } from 'nostr-tools';
// Encode
const npub = nip19.npubEncode(pubkeyHex);
// Decode
const { type, data } = nip19.decode(npub);
NIP-05: DNS Verification
Maps human-readable identifiers to pubkeys:
alice@example.com → looks up https://example.com/.well-known/nostr.json
{
"names": {
"alice": "pubkey-hex-here"
},
"relays": {
"pubkey-hex-here": ["wss://relay.example.com"]
}
}
NIP-57: Zaps (Lightning Payments)
Enables Lightning payments integrated with events:
- Client creates kind 9734 zap request
- Sends to recipient's LNURL endpoint
- User pays invoice
- Wallet service creates kind 9735 zap receipt
NIP Statuses
NIPs have different maturity levels:
| Status | Meaning |
|---|---|
| Draft | Work in progress |
| Final | Stable, implemented |
| Deprecated | Superseded by newer NIP |
Implementing NIPs
Check Requirements
Some NIPs depend on others:
- NIP-57 (Zaps) requires NIP-01, NIP-09
- NIP-46 (Connect) requires NIP-01, NIP-44
Graceful Degradation
Not all relays/clients support all NIPs:
// Check if NIP-07 extension is available
if (window.nostr) {
const event = await window.nostr.signEvent(unsignedEvent);
} else {
// Fallback: use local key
const event = finalizeEvent(unsignedEvent, secretKey);
}
Feature Detection
Query relay capabilities:
const response = await fetch('https://relay.example.com/', {
headers: { Accept: 'application/nostr+json' }
});
const info = await response.json();
console.log(info.supported_nips); // [1, 11, 42, ...]
Common NIP Combinations
Social Client
Essential:
- NIP-01 (Core)
- NIP-02 (Follows)
- NIP-10 (Threading)
- NIP-19 (Encoding)
Recommended:
- NIP-05 (Verification)
- NIP-25 (Reactions)
- NIP-57 (Zaps)
Chat Application
Essential:
- NIP-01 (Core)
- NIP-44 (Encryption)
Recommended:
- NIP-19 (Encoding)
- NIP-42 (Auth)
Long-form Platform
Essential:
- NIP-01 (Core)
- NIP-23 (Articles)
Recommended:
- NIP-05 (Verification)
- NIP-57 (Zaps)
- NIP-94 (Media)
Keeping Up to Date
The NIPs repository is actively developed:
# Watch the repository
gh repo star nostr-protocol/nips
Follow these resources:
- NIPs GitHub
- Nostr.how
- Nostr clients for protocol discussions