upleb.uk

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

summaryrefslogtreecommitdiff
path: root/51.md
diff options
context:
space:
mode:
Diffstat (limited to '51.md')
-rw-r--r--51.md112
1 files changed, 112 insertions, 0 deletions
diff --git a/51.md b/51.md
new file mode 100644
index 0000000..80cc09e
--- /dev/null
+++ b/51.md
@@ -0,0 +1,112 @@
1NIP-51
2======
3
4Lists
5-------------------------
6
7`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `depends:33`
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.
10
11If a list type should only be defined once per user (like the 'Mute' list), the list type's events should follow the specification for [NIP-16 - Replaceable Events](16.md). These lists may be referred to as 'replaceable lists'.
12
13Otherwise, the list type's events should follow the specification for [NIP-33 - Parameterized Replaceable Events](33.md), where the list name will be used as the 'd' parameter. These lists may be referred to as 'parameterized replaceable lists'.
14
15## Replaceable List Event Example
16
17Lets say a user wants to create a 'Mute' list and has keys:
18```
19priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
20pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
21```
22The user wants to publicly include these users:
23
24```json
25["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
26["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
27```
28and privately include these users (below is the JSON that would be encrypted and placed in the event content):
29
30```json
31[
32 ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
33 ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
34]
35```
36
37Then the user would create a 'Mute' list event like below:
38
39```json
40{
41 "kind": 10000,
42 "tags": [
43 ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
44 ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
45 ],
46 "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
47 ...other fields
48}
49```
50
51
52## Parameterized Replaceable List Event Example
53
54Lets say a user wants to create a 'Categorized People' list of `nostr` people and has keys:
55```
56priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
57pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
58```
59The user wants to publicly include these users:
60
61```json
62["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
63["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
64```
65and privately include these users (below is the JSON that would be encrypted and placed in the event content):
66
67```json
68[
69 ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
70 ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
71]
72```
73
74Then the user would create a 'Categorized People' list event like below:
75
76```json
77{
78 "kind": 30000,
79 "tags": [
80 ["d", "nostr"],
81 ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
82 ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
83 ],
84 "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
85 ...other fields
86}
87```
88
89## List Event Kinds
90
91| kind | list type |
92| ------ | ----------------------- |
93| 10000 | Mute |
94| 10001 | Pin |
95| 30000 | Categorized People |
96| 30001 | Categorized Bookmarks |
97
98### Mute List
99
100An 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.
101
102### Pin List
103
104An 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.
105
106### Categorized People List
107
108An 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).
109
110### Categorized Bookmarks List
111
112An event with 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. Any standardized tag can be included in a Categorized Bookmarks List.