mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-24 09:25:52 -05:00
Adds Topical Notes
This commit is contained in:
parent
b765b3c030
commit
6a1c8eb781
60
54.md
Normal file
60
54.md
Normal file
|
@ -0,0 +1,60 @@
|
|||
NIP-54
|
||||
======
|
||||
|
||||
Topical Notes
|
||||
-------------
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP enables authors to post exclusively into topics, without polluting their main feed. Authors can post to locations, hashtags, labels, and urls in a way that only followers of those topics will receive their posts.
|
||||
|
||||
## Topical Note Kind
|
||||
|
||||
Kind `21` defines a `kind:1`-equivalent event that MUST NOT be displayed unless the user follows one of the `g`, `t`, `r` or `l` tags.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 21,
|
||||
"tags": [
|
||||
["g", "<geohash>"],
|
||||
["t", "<hashtag>"],
|
||||
["r", "<url>"],
|
||||
//..
|
||||
["L", "<label namespace>"],
|
||||
["l", "<label>", "<label namespace>"],
|
||||
],
|
||||
"content": "This is a note for followers of the hashtag, location OR url. My followers should not see this.",
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
`.content` MUST be plain text and tags that mention, quote and assemble threading structures MUST follow [NIP-10](10.md).
|
||||
|
||||
## Topical Relay Setup
|
||||
|
||||
Kind `30021` defines a topic follower. It registers a list of relays to aggregate events for each topic.
|
||||
|
||||
The `d` tag of this kind is equal to `name:value` of the topics used in kind `21`.
|
||||
|
||||
```js
|
||||
{
|
||||
"kind": 30021,
|
||||
"tags": [
|
||||
["d", "g:<my city's geohash>"],
|
||||
["r", "wss://my-city-owned-relay"],
|
||||
["r", "wss://independent-but-city-based-relay"],
|
||||
// ... other tags
|
||||
["title", "Name of this topic"]
|
||||
],
|
||||
"content": nip44Encrypt([
|
||||
["r", "wss://my-city-owned-relay2"], // private relay
|
||||
["title", "Name of this topic"] // private topic title
|
||||
// ... other tags
|
||||
]),
|
||||
//...other fields
|
||||
}
|
||||
```
|
||||
|
||||
The `.content` contains a list of private tags.
|
||||
|
||||
Clients MUST seek and broadcast events from and to the relays defined for each topic.
|
Loading…
Reference in New Issue
Block a user