You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 43d1ce3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/nips/NIP-RS.md
+128-1Lines changed: 128 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ This NIP defines a minimal, privacy-preserving protocol for propagating read sta
25
25
## Non-Goals
26
26
27
27
This NIP does not define a durable log of all read messages — blobs are best-effort recent activity hints bounded by a time horizon.
28
-
This NIP does not define cross-client interoperability on context ID format — context identifiers are opaque to this NIP and meaningful only within a single client family.
28
+
This NIP does not define cross-client interoperability on context ID format — context identifiers are opaque by default and meaningful only within a single client family, except for OPTIONAL well-known schemes defined in this NIP (currently only `thread:<root-event-id>`, defined under Thread Read Contexts), which are provided for cross-client thread-read interoperability.
29
29
This NIP does not define mark-as-unread — the merge rule is monotonic by design.
30
30
This NIP does not guarantee ordering of read events across devices.
31
31
This NIP does not require relay-side logic.
@@ -112,6 +112,133 @@ After decryption, clients MUST apply the following validation rules:
112
112
113
113
Context identifier format is not prescribed by this NIP. Clients choose identifiers appropriate to their context type (e.g., a NIP-28 channel event ID, a NIP-29 group address, a pubkey for DMs). Interoperability between different client implementations on context ID conventions is outside the scope of this NIP.
114
114
115
+
#### Thread Read Contexts (Optional)
116
+
117
+
This subsection defines an OPTIONAL well-known context scheme for tracking read
118
+
state of threads (reply chains) independently from the channel they belong to.
119
+
It is a pure interpretation layer over the flat `contexts` map — it introduces
120
+
no new fields, no nesting, and no change to the merge rule, event structure,
121
+
validation, or fetching. The schema version `v` remains `1`. Clients that do
122
+
not implement this subsection remain fully interoperable (see Backwards
123
+
Compatibility below).
124
+
125
+
A client implementing this scheme MUST use the context key `thread:<root-event-id>`
126
+
for a thread, where `<root-event-id>` is the 64-character lowercase hex event ID
127
+
of the thread's root event. A bare channel identifier (e.g., the NIP-28 channel
128
+
event ID) remains the channel context, exactly as before — this is grandfathered
129
+
existing behavior and is unchanged.
130
+
131
+
Keys beginning with `thread:` whose remainder does not match `^[0-9a-f]{64}$`
132
+
MUST be treated as ordinary opaque contexts, not as thread contexts. This
133
+
protects an existing client family that may already use a `thread:`-prefixed
134
+
convention from being misinterpreted under this scheme.
135
+
136
+
The relationship between a thread and its parent channel is DERIVED from the
137
+
Nostr event graph at evaluation time (the root event's channel reference, e.g.
138
+
its `h` tag) and MUST NOT be serialized into the blob. The blob remains a flat
139
+
`{<context-id>: <unix-timestamp>}` map.
140
+
141
+
##### Hierarchical Frontier Rule
142
+
143
+
The effective read frontier of a context is the maximum of its own merged
144
+
timestamp and the effective frontier of its parent:
A thread reply with `created_at = 140` is `<= 150`, so it reads as **read** (the
237
+
channel frontier already covers it). A reply with `created_at = 160` is `> 150`,
238
+
so the thread reads as **unread**. The thread's own entry (`100`) is dominated by
239
+
the channel frontier (`150`) and is therefore inert — a client MAY evict it
240
+
before publishing.
241
+
115
242
#### Timestamp Accuracy
116
243
117
244
Clients SHOULD use the `created_at` of the message being marked as read as the context timestamp — not the local wall clock and not the relay receive time.
0 commit comments