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:
authormonlovesmango <96307647+monlovesmango@users.noreply.github.com>2023-03-09 11:16:57 -0600
committerGitHub <noreply@github.com>2023-03-09 14:16:57 -0300
commit30daaedbdb48c7583843a12d3496ced311b9986a (patch)
treede6fcff0157541dffbc0b371dc8da8a9f78bfded /51.md
parenta4ed9689032a6e16eff92994195f273e74475f45 (diff)
NIP-51 Lists (#183)
Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> Co-authored-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io> Co-authored-by: fiatjaf_ <fiatjaf@gmail.com>
Diffstat (limited to '51.md')
-rw-r--r--51.md97
1 files changed, 97 insertions, 0 deletions
diff --git a/51.md b/51.md
new file mode 100644
index 0000000..bbb3987
--- /dev/null
+++ b/51.md
@@ -0,0 +1,97 @@
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## List Event Kinds
16
17| kind | list type | NIP |
18|------|-----------------------------|---------------|
19| 10000| Mute | [51a](51a.md) |
20| 10001| Pin | [51b](51b.md) |
21| 30000| Categorized People | [51c](51c.md) |
22| 30001| Categorized Bookmarks | [51d](51d.md) |
23## Replaceable List Event Example
24
25Lets say a user wants to create a 'Mute' list and has keys:
26```
27priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
28pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
29```
30The user wants to publicly include these users:
31
32```json
33["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
34["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
35```
36and privately include these users (below is the JSON that would be encrypted and placed in the event content):
37
38```json
39[
40 ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
41 ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
42]
43```
44
45Then the user would create a 'Mute' list event like below:
46
47```json
48{
49 "kind": 10000,
50 "tags": [
51 ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
52 ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
53 ],
54 "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
55 ...other fields
56}
57```
58
59
60## Parameterized Replaceable List Event Example
61
62Lets say a user wants to create a 'Categorized People' list of `nostr` people and has keys:
63```
64priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
65pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
66```
67The user wants to publicly include these users:
68
69```json
70["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
71["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
72```
73and privately include these users (below is the JSON that would be encrypted and placed in the event content):
74
75```json
76[
77 ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
78 ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
79]
80```
81
82Then the user would create a 'Categorized People' list event like below:
83
84```json
85{
86 "kind": 30000,
87 "tags": [
88 ["d", "nostr"],
89 ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
90 ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
91 ],
92 "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
93 ...other fields
94}
95```
96
97