upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2023-11-15 00:22:09 -0300
committerfiatjaf <fiatjaf@gmail.com>2023-11-15 00:22:09 -0300
commit5dc6071978bc7c2dcee807d16ef085192971ac27 (patch)
treef33760888d62266191af07553fb47c7296c950b7
parentf1433e0f0cb28d17102b530081b48d47e0ee38ac (diff)
cut, simplify and update NIP-51 to reflect the real-world usage.
-rw-r--r--51.md151
-rw-r--r--README.md117
2 files changed, 69 insertions, 199 deletions
diff --git a/51.md b/51.md
index e4d7c24..c74487f 100644
--- a/51.md
+++ b/51.md
@@ -6,148 +6,19 @@ Lists
6 6
7`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus` 7`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus`
8 8
9A "list" event is defined as having a list of public and/or private tags. Public tags will be listed in the event `tags`. Private tags will be encrypted in the event `content`. Encryption for private tags will use [NIP-04 - Encrypted Direct Message](04.md) encryption, using the list author's private and public key for the shared secret. A distinct event kind should be used for each list type created. 9This NIP defines lists of things that users can create. Lists can contain references to anything, and these references can be **public** or **private**.
10 10
11If a list should only be defined once per user (like the "mute" list) the list is declared as a _replaceable event_. These lists may be referred to as "replaceable lists". Otherwise, the list is a _parameterized replaceable event_ and the list name will be used as the `d` tag. These lists may be referred to as "parameterized replaceable lists". 11Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted using the same scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and stored in the `.content`.
12 12
13## Replaceable List Event Example 13## Generic lists
14 14
15Lets say a user wants to create a 'Mute' list and has keys: 15The 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.
16```
17priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
18pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
19```
20The user wants to publicly include these users:
21 16
22```json 17## Standard lists
23["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
24["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
25```
26and privately include these users (below is the JSON that would be encrypted and placed in the event content):
27 18
28```json 19| name | kind | "d" tag | description | expected tag items |
29[ 20| --- | --- | --- | --- | --- |
30 ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"], 21| Muted list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) |
31 ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"] 22| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) |
32] 23| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) |
33``` 24| Relay sets | 30002 | (user-defined) | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) |
34
35Then the user would create a 'Mute' list event like below:
36
37```json
38{
39 "kind": 10000,
40 "tags": [
41 ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
42 ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
43 ],
44 "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
45 ...other fields
46}
47```
48
49
50## Parameterized Replaceable List Event Example
51
52Lets say a user wants to create a 'Categorized People' list of `nostr` people and has keys:
53```
54priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
55pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
56```
57The user wants to publicly include these users:
58
59```json
60["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
61["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
62```
63and privately include these users (below is the JSON that would be encrypted and placed in the event content):
64
65```json
66[
67 ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
68 ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
69]
70```
71
72Then the user would create a 'Categorized People' list event like below:
73
74```json
75{
76 "kind": 30000,
77 "tags": [
78 ["d", "nostr"],
79 ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
80 ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
81 ],
82 "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
83 ...other fields
84}
85```
86
87Lets say a user wants to create a 'Categorized Bookmarks' list of `bookmarks` and has keys:
88```
89priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
90pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
91```
92The user wants to publicly include these bookmarks:
93
94```json
95["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"],
96["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"],
97["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"],
98```
99and privately include these bookmarks (below is the JSON that would be encrypted and placed in the event content):
100
101```json
102[
103 ["r", "https://my-private.bookmark", "My private bookmark"],
104 ["a", "30001:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"],
105]
106```
107
108Then the user would create a 'Categorized Bookmarks' list event like below:
109
110```json
111{
112 "kind": 30001,
113 "tags": [
114 ["d", "bookmarks"],
115 ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"],
116 ["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"],
117 ["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"],
118 ],
119 "content": "y3AyaLJfnmYr9x9Od9o4aYrmL9+Ynmsim5y2ONrU0urOTq+V81CyAthQ2mUOWE9xwGgrizhY7ILdQwWhy6FK0sA33GHtC0egUJw1zIdknPe7BZjznD570yk/8RXYgGyDKdexME+RMYykrnYFxq1+y/h00kmJg4u+Gpn+ZjmVhNYxl9b+TiBOAXG9UxnK/H0AmUqDpcldn6+j1/AiStwYZhD1UZ3jzDIk2qcCDy7MlGnYhSP+kNmG+2b0T/D1L0Z7?iv=PGJJfPE84gacAh7T0e6duQ==",
120 ...other fields
121}
122```
123
124## List Event Kinds
125
126| kind | list type |
127| ------ | ----------------------- |
128| 10000 | Mute |
129| 10001 | Pin |
130| 30000 | Categorized People |
131| 30001 | Categorized Bookmarks |
132| 30002 | Categorized Relay Sets |
133
134
135### Mute List
136
137An event with kind `10000` is defined as a replaceable list event for listing content a user wants to mute. Any standardized tag can be included in a Mute List.
138
139### Pin List
140
141An event with kind `10001` is defined as a replaceable list event for listing content a user wants to pin. Any standardized tag can be included in a Pin List.
142
143### Categorized People List
144
145An event with kind `30000` is defined as a parameterized replaceable list event for categorizing people. The 'd' parameter for this event holds the category name of the list. The tags included in these lists MUST follow the format of kind 3 events as defined in [NIP-02 - Contact List and Petnames](02.md).
146
147### Categorized Bookmarks List
148
149An event of kind `30001` is defined as a parameterized replaceable list event for categorizing bookmarks. The 'd' parameter for this event holds the category name of the list. The bookmark lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). Any standardized tag can be included in a Categorized Bookmark List.
150
151### Categorized Relay Set
152
153An event of kind `30002` is defined as a parameterized replaceable list event for categorizing relays. The 'd' parameter for this event holds the category name of the list. The relays lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). These sets can be used by clients in order to determine which relays to query in different scenarios.
diff --git a/README.md b/README.md
index 483056d..74411ca 100644
--- a/README.md
+++ b/README.md
@@ -74,66 +74,65 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
74- [NIP-99: Classified Listings](99.md) 74- [NIP-99: Classified Listings](99.md)
75 75
76## Event Kinds 76## Event Kinds
77| kind | description | NIP | 77| kind | description | NIP |
78| ------------- | -------------------------- | ----------- | 78| ------------- | -------------------------- | ----------- |
79| `0` | Metadata | [1](01.md) | 79| `0` | Metadata | [1](01.md) |
80| `1` | Short Text Note | [1](01.md) | 80| `1` | Short Text Note | [1](01.md) |
81| `2` | Recommend Relay | | 81| `2` | Recommend Relay | |
82| `3` | Contacts | [2](02.md) | 82| `3` | Contacts | [2](02.md) |
83| `4` | Encrypted Direct Messages | [4](04.md) | 83| `4` | Encrypted Direct Messages | [4](04.md) |
84| `5` | Event Deletion | [9](09.md) | 84| `5` | Event Deletion | [9](09.md) |
85| `6` | Repost | [18](18.md) | 85| `6` | Repost | [18](18.md) |
86| `7` | Reaction | [25](25.md) | 86| `7` | Reaction | [25](25.md) |
87| `8` | Badge Award | [58](58.md) | 87| `8` | Badge Award | [58](58.md) |
88| `16` | Generic Repost | [18](18.md) | 88| `16` | Generic Repost | [18](18.md) |
89| `40` | Channel Creation | [28](28.md) | 89| `40` | Channel Creation | [28](28.md) |
90| `41` | Channel Metadata | [28](28.md) | 90| `41` | Channel Metadata | [28](28.md) |
91| `42` | Channel Message | [28](28.md) | 91| `42` | Channel Message | [28](28.md) |
92| `43` | Channel Hide Message | [28](28.md) | 92| `43` | Channel Hide Message | [28](28.md) |
93| `44` | Channel Mute User | [28](28.md) | 93| `44` | Channel Mute User | [28](28.md) |
94| `1063` | File Metadata | [94](94.md) | 94| `1063` | File Metadata | [94](94.md) |
95| `1311` | Live Chat Message | [53](53.md) | 95| `1311` | Live Chat Message | [53](53.md) |
96| `1040` | OpenTimestamps | [03](03.md) | 96| `1040` | OpenTimestamps | [03](03.md) |
97| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) | 97| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) |
98| `1984` | Reporting | [56](56.md) | 98| `1984` | Reporting | [56](56.md) |
99| `1985` | Label | [32](32.md) | 99| `1985` | Label | [32](32.md) |
100| `4550` | Community Post Approval | [72](72.md) | 100| `4550` | Community Post Approval | [72](72.md) |
101| `5000`-`5999` | Job Request | [90](90.md) | 101| `5000`-`5999` | Job Request | [90](90.md) |
102| `6000`-`6999` | Job Result | [90](90.md) | 102| `6000`-`6999` | Job Result | [90](90.md) |
103| `7000` | Job Feedback | [90](90.md) | 103| `7000` | Job Feedback | [90](90.md) |
104| `9041` | Zap Goal | [75](75.md) | 104| `9041` | Zap Goal | [75](75.md) |
105| `9734` | Zap Request | [57](57.md) | 105| `9734` | Zap Request | [57](57.md) |
106| `9735` | Zap | [57](57.md) | 106| `9735` | Zap | [57](57.md) |
107| `9802` | Highlights | [84](84.md) | 107| `9802` | Highlights | [84](84.md) |
108| `10000` | Mute List | [51](51.md) | 108| `10002` | Relay List Metadata | [65](65.md) |
109| `10001` | Pin List | [51](51.md) | 109| `13194` | Wallet Info | [47](47.md) |
110| `10002` | Relay List Metadata | [65](65.md) | 110| `22242` | Client Authentication | [42](42.md) |
111| `13194` | Wallet Info | [47](47.md) | 111| `23194` | Wallet Request | [47](47.md) |
112| `22242` | Client Authentication | [42](42.md) | 112| `23195` | Wallet Response | [47](47.md) |
113| `23194` | Wallet Request | [47](47.md) | 113| `24133` | Nostr Connect | [46](46.md) |
114| `23195` | Wallet Response | [47](47.md) | 114| `27235` | HTTP Auth | [98](98.md) |
115| `24133` | Nostr Connect | [46](46.md) | 115| `30000` | People List | [51](51.md) |
116| `27235` | HTTP Auth | [98](98.md) | 116| `30001` | Things List | [51](51.md) |
117| `30000` | Categorized People List | [51](51.md) | 117| `30002` | Relay Set | [51](51.md) |
118| `30001` | Categorized Bookmark List | [51](51.md) | 118| `30008` | Profile Badges | [58](58.md) |
119| `30008` | Profile Badges | [58](58.md) | 119| `30009` | Badge Definition | [58](58.md) |
120| `30009` | Badge Definition | [58](58.md) | 120| `30017` | Create or update a stall | [15](15.md) |
121| `30017` | Create or update a stall | [15](15.md) | 121| `30018` | Create or update a product | [15](15.md) |
122| `30018` | Create or update a product | [15](15.md) | 122| `30023` | Long-form Content | [23](23.md) |
123| `30023` | Long-form Content | [23](23.md) | 123| `30024` | Draft Long-form Content | [23](23.md) |
124| `30024` | Draft Long-form Content | [23](23.md) | 124| `30078` | Application-specific Data | [78](78.md) |
125| `30078` | Application-specific Data | [78](78.md) | 125| `30311` | Live Event | [53](53.md) |
126| `30311` | Live Event | [53](53.md) | 126| `30315` | User Statuses | [38](38.md) |
127| `30315` | User Statuses | [38](38.md) | 127| `30402` | Classified Listing | [99](99.md) |
128| `30402` | Classified Listing | [99](99.md) | 128| `30403` | Draft Classified Listing | [99](99.md) |
129| `30403` | Draft Classified Listing | [99](99.md) | 129| `31922` | Date-Based Calendar Event | [52](52.md) |
130| `31922` | Date-Based Calendar Event | [52](52.md) | 130| `31923` | Time-Based Calendar Event | [52](52.md) |
131| `31923` | Time-Based Calendar Event | [52](52.md) | 131| `31924` | Calendar | [52](52.md) |
132| `31924` | Calendar | [52](52.md) | 132| `31925` | Calendar Event RSVP | [52](52.md) |
133| `31925` | Calendar Event RSVP | [52](52.md) | 133| `31989` | Handler recommendation | [89](89.md) |
134| `31989` | Handler recommendation | [89](89.md) | 134| `31990` | Handler information | [89](89.md) |
135| `31990` | Handler information | [89](89.md) | 135| `34550` | Community Definition | [72](72.md) |
136| `34550` | Community Definition | [72](72.md) |
137 136
138## Message types 137## Message types
139 138