distinction between lists and sets.

This commit is contained in:
fiatjaf 2023-11-15 07:33:26 -03:00
parent da05b5d915
commit 1bbd87c42f
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

30
51.md
View File

@ -14,19 +14,31 @@ Public items in a list are specified in the event `tags` array, while private it
The kinds `30000` and `30001` have been reserved for generic lists. These must be accompanied by a `d` tag identifying the list, but these are generally client-specific, except in the standard cases specified below.
## Standard lists
### Standard lists
| name | kind | "d" tag | description | expected tag items |
| --- | --- | --- | --- | --- |
| Mute list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) |
| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) |
| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) |
| Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) |
| Relay sets | 30002 | (user-defined) | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) |
These are some standards that emerged in the wild:
| name | kind | "d" tag | description | expected tag items |
| --- | --- | --- | --- | --- |
| Mute list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) |
| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) |
| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) |
| Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) |
## Sets
Sets are lists with well-defined meaning and purpose and user-assigned `d` tags meant to be displayed in the UI. For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which relays they will publish an event or from which relays they will read the replies to an event; or _curation sets_ can be used by apps to showcase curations made by others tagged to different topics.
Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tag that can be used to enhance their UI.
| name | kind | description | expected tag items |
| --- | --- | --- | --- |
| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) |
| Article Curation sets | 30003 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles) |
## Examples
### A _Mute list_ with some public items and some encrypted items
### A _mute list_ with some public items and some encrypted items
```json
{