1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
//! NIP modules — one Rust module per [Nostr Implementation Possibility].
//!
//! Each submodule mirrors the `nostr-protocol/nips` numbering exactly so
//! that grepping for `nipXX` either in this crate or in the spec
//! repository points at the same artefact. The common surface across
//! all of them:
//!
//! - `pub fn` helpers (typed accessors, parsers, builders) that read
//! from or attach to an [`Event`](crate::Event) or
//! [`UnsignedEvent`](crate::UnsignedEvent).
//! - A module-local error enum prefixed with the NIP topic
//! (`ContactListError`, `PowError`, …) so importing several at once
//! stays unambiguous.
//! - For NIPs that ride on top of other NIPs (NIP-17 on NIP-59, NIP-59
//! on NIP-44, NIP-46 on NIP-44), the dependency chain is encoded in
//! the Cargo `[features]` graph so disabling the leaf disables
//! everything above it.
//!
//! # Topical groups
//!
//! ## Protocol foundation
//!
//! - [`nip01`] — Spec-to-source index for the NIP-01 core (events,
//! filters, wire messages); re-exports the canonical surface that
//! lives in [`crate::event`], [`crate::filter`], [`crate::message`].
//!
//! ## Social events
//!
//! - [`nip02`] — Follow list (`kind 3`).
//! - [`nip03`] — `OpenTimestamps` attestations (`kind 1040`).
//! - [`nip09`] — Event deletion requests (`kind 5`).
//! - [`nip10`] — `e` / `p` tags inside text notes (threading).
//! - [`nip14`] — `subject` tag for `kind: 1` text notes (threaded views).
//! - [`nip18`] — Reposts (`kind 6`), generic reposts (`kind 16`), and
//! quote-repost `q` tags.
//! - [`nip22`] — Comments (`kind 1111`).
//! - [`nip23`] — Long-form articles (`kind 30023` / draft `30024`).
//! - [`nip25`] — Reactions (`kind 7`): like / dislike / emoji /
//! custom-emoji content with the prescribed `e` / `p` / `k` / `a`
//! tag set.
//! - [`nip27`] — Text note references: `nostr:` URI scanner with
//! byte-range spans and NIP-18 `q` / NIP-01 `p` implicit tag
//! synthesis.
//! - [`nip38`] — User statuses (`kind 30315`, addressable by status
//! type such as `general` / `music`).
//! - [`nip64`] — Chess games in PGN (`kind 64`).
//!
//! ## Discovery and trust
//!
//! - [`nip5a`] — Static websites (nsites): `kind 15128` root /
//! `kind 35128` named site manifests mapping paths to Blossom
//! blobs.
//! - [`nip69`] — Peer-to-peer order events (`kind 38383`): a shared
//! cross-platform liquidity book for P2P bitcoin trades.
//! - [`nip85`] — Trusted assertions (`kind 30382`–`30385`) plus the
//! `kind 10040` trusted-provider list.
//! - [`nip87`] — Ecash mint discoverability: `kind 38172` (Cashu) /
//! `38173` (Fedimint) announcements and `kind 38000`
//! recommendations.
//!
//! ## DNS-bound identity
//!
//! - [`nip05`] *(feature `nip05`)* — DNS-based internet identifiers
//! `<local>@<domain>` resolved through
//! `/.well-known/nostr.json`. The fetch surface is abstracted as
//! the [`nip05::Nip05Fetcher`] trait; a redirect-disabled `reqwest`
//! implementation lives behind the same feature flag.
//!
//! ## Relay-side semantics
//!
//! - [`nip11`] — Relay information document (HTTP `application/nostr+json`).
//! - [`nip42`] — Client-to-relay AUTH (`kind 22242`).
//! - [`nip43`] — Relay access metadata and admission requests
//! (`kind 13534` membership list, `8000`/`8001` add/remove,
//! `28934`–`28936` join / invite / leave).
//! - [`nip65`] — Relay list metadata (`kind 10002`).
//! - [`nip70`] — Protected events (`["-"]` tag).
//!
//! ## Time, work, and lifecycle
//!
//! - [`nip13`] — Proof of work (`nonce` tag, leading-zero target).
//! - [`nip40`] — Expiration timestamp.
//!
//! ## Identifier encodings
//!
//! - [`nip19`] — bech32 entities (`npub`, `nsec`, `note`, `nprofile`,
//! `nevent`, `naddr`).
//! - [`nip21`] — `nostr:` URI scheme wrapping every NIP-19 entity that is
//! safe to expose in a URL (secret keys are refused).
//!
//! ## Metadata and generic conventions
//!
//! - [`nip24`] — Extra `kind: 0` fields and cross-kind tag conventions
//! (`display_name`, `bot`, `birthday`, `r` / `i` / `title` / `t`).
//! - [`nip31`] — Human-readable `alt` fallback for unknown event kinds
//! so `kind: 1`-centric clients still render something sensible.
//! - [`nip30`] — Custom emoji: `:shortcode:` tokens resolved through
//! `emoji` tags. Ships both a builder ([`Tag::emoji`](crate::event::Tag::emoji))
//! and a content scanner ([`nip30::shortcodes_in`]).
//! - [`nip39`] — External identities (`github`, `twitter`, `mastodon`,
//! `telegram`, …) declared via `i` tags with platform-specific
//! proofs. Forward-compatible: unknown platform names round-trip.
//!
//! ## Key derivation and delegation
//!
//! - [`nip06`] *(feature `nip06`)* — BIP-39 mnemonic + BIP-32 path
//! `m/44'/1237'/account'/chain_type/index` → Nostr [`Keys`](crate::Keys).
//! - [`nip26`] — Delegated event signing (cold-key → hot-key
//! authority via the `delegation` tag). Spec marks NIP-26 as
//! `unrecommended`; we ship a complete implementation so existing
//! on-relay corpora remain decodable.
//!
//! ## Encryption
//!
//! - [`nip04`] *(feature `nip04`)* — **Deprecated** legacy DM
//! (AES-256-CBC over raw ECDH `X`); kept for compatibility with the
//! existing on-relay corpus and NIP-46 backends.
//! - [`nip44`] *(feature `nip44`)* — Versioned payload encryption
//! (`ChaCha20` + HMAC-SHA256), the modern direct-message primitive.
//! - [`nip49`] *(feature `nip49`)* — `ncryptsec`, password-protected
//! private keys (scrypt + XChaCha20-Poly1305).
//! - [`nip59`] *(feature `nip59`)* — Gift-wrap envelope (kind 13/1059).
//! - [`nip17`] *(feature `nip17`)* — Private direct messages built on
//! gift wraps.
//!
//! ## Remote signing
//!
//! - [`nip46`] *(feature `nip46`)* — Nostr Connect protocol primitives
//! (request/response types, `bunker://` and `nostrconnect://` URIs).
//!
//! [Nostr Implementation Possibility]: https://github.com/nostr-protocol/nips