mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-09-20 14:55:49 -04:00
66 lines
1.8 KiB
Markdown
66 lines
1.8 KiB
Markdown
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.",
|
|
//...
|
|
}
|
|
```
|
|
|
|
Clients MUST include at least one `g`, `t`, `r` or `l` tags.
|
|
|
|
`.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 following topic. It registers a list of relays to aggregate events for the list of topics.
|
|
|
|
The `d` tag of this kind is a simple `UUID`.
|
|
|
|
```js
|
|
{
|
|
"kind": 30021,
|
|
"tags": [
|
|
["d", "<UUID>"],
|
|
["g", "<geohash>"],
|
|
["t", "<hashtag>"],
|
|
["r", "<url>"],
|
|
["relay", "wss://my-city-owned-relay"],
|
|
["relay", "wss://independent-but-city-based-relay"],
|
|
// ... other tags
|
|
["title", "Name of this topic"]
|
|
],
|
|
"content": nip44Encrypt([
|
|
["relay", "wss://my-city-owned-relay2"], // private relay
|
|
["title", "Name of this topic"] // private topic title
|
|
["t", "<hashtag>"], // private follows of tags.
|
|
// ... 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. |