From 30daaedbdb48c7583843a12d3496ced311b9986a Mon Sep 17 00:00:00 2001 From: monlovesmango <96307647+monlovesmango@users.noreply.github.com> Date: Thu, 9 Mar 2023 11:16:57 -0600 Subject: [PATCH] NIP-51 Lists (#183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> Co-authored-by: Ricardo Arturo Cabral Mejía Co-authored-by: fiatjaf_ --- 51.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 51a.md | 9 ++++++ 51b.md | 9 ++++++ 51c.md | 9 ++++++ 51d.md | 9 ++++++ README.md | 6 ++++ 6 files changed, 139 insertions(+) create mode 100644 51.md create mode 100644 51a.md create mode 100644 51b.md create mode 100644 51c.md create mode 100644 51d.md diff --git a/51.md b/51.md new file mode 100644 index 00000000..bbb39874 --- /dev/null +++ b/51.md @@ -0,0 +1,97 @@ +NIP-51 +====== + +Lists +------------------------- + +`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `depends:33` + +A "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. + +If 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'. + +Otherwise 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'. + +## List Event Kinds + +| kind | list type | NIP | +|------|-----------------------------|---------------| +| 10000| Mute | [51a](51a.md) | +| 10001| Pin | [51b](51b.md) | +| 30000| Categorized People | [51c](51c.md) | +| 30001| Categorized Bookmarks | [51d](51d.md) | +## Replaceable List Event Example + +Lets say a user wants to create a 'Mute' list and has keys: +``` +priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1 +pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d +``` +The user wants to publicly include these users: + +```json +["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], +["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"] +``` +and privately include these users (below is the JSON that would be encrypted and placed in the event content): + +```json +[ + ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"], + ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"] +] +``` + +Then the user would create a 'Mute' list event like below: + +```json +{ + "kind": 10000, + "tags": [ + ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], + ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], + ], + "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==", + ...other fields +} +``` + + +## Parameterized Replaceable List Event Example + +Lets say a user wants to create a 'Categorized People' list of `nostr` people and has keys: +``` +priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1 +pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d +``` +The user wants to publicly include these users: + +```json +["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], +["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"] +``` +and privately include these users (below is the JSON that would be encrypted and placed in the event content): + +```json +[ + ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"], + ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"] +] +``` + +Then the user would create a 'Categorized People' list event like below: + +```json +{ + "kind": 30000, + "tags": [ + ["d", "nostr"], + ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], + ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], + ], + "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==", + ...other fields +} +``` + + diff --git a/51a.md b/51a.md new file mode 100644 index 00000000..ef9d5dec --- /dev/null +++ b/51a.md @@ -0,0 +1,9 @@ +NIP-51a +====== + +Mute List +------------------------- + +`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` + +An event with kind `10000` is defined as a replaceable list event (see [NIP-51 - Lists](51.md) for listing content a user wants to mute. Any standarized tag can be included in a Mute List. \ No newline at end of file diff --git a/51b.md b/51b.md new file mode 100644 index 00000000..522403dc --- /dev/null +++ b/51b.md @@ -0,0 +1,9 @@ +NIP-51b +====== + +Pin List +------------------------- + +`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` + +An event with kind `10001` is defined as a replaceable list event (see [NIP-51 - Lists](51.md) for listing content a user wants to pin. Any standarized tag can be included in a Pin List. \ No newline at end of file diff --git a/51c.md b/51c.md new file mode 100644 index 00000000..772a7f96 --- /dev/null +++ b/51c.md @@ -0,0 +1,9 @@ +NIP-51c +====== + +Categorized People List +------------------------- + +`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` + +An event with kind `30000` is defined as a parameterized replaceable list event (see [NIP-51 - Lists](51.md)) 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). \ No newline at end of file diff --git a/51d.md b/51d.md new file mode 100644 index 00000000..0891f600 --- /dev/null +++ b/51d.md @@ -0,0 +1,9 @@ +NIP-51c +====== + +Categorized Bookmarks List +------------------------- + +`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` + +An event with kind `30001` is defined as a parameterized replaceable list event (see [NIP-51 - Lists](51.md)) for categorizing bookmarks. The 'd' parameter for this event holds the category name of the list. Any standarized tag can be included in a Categorized Bookmarks List. \ No newline at end of file diff --git a/README.md b/README.md index 42674cce..544a6b21 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh - [NIP-42: Authentication of clients to relays](42.md) - [NIP-46: Nostr Connect](46.md) - [NIP-50: Keywords filter](50.md) +- [NIP-51: Lists](51.md) - [NIP-56: Reporting](56.md) - [NIP-57: Lightning Zaps](57.md) - [NIP-58: Badges](58.md) @@ -39,6 +40,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh - [NIP-78: Application-specific data](78.md) ## Event Kinds + | kind | description | NIP | | ------------- | -------------------------------- | ----------- | | 0 | Metadata | [1](01.md) | @@ -57,9 +59,13 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh | 1984 | Reporting | [56](56.md) | | 9734 | Zap Request | [57](57.md) | | 9735 | Zap | [57](57.md) | +| 10000 | Mute List | [51](51.md) | +| 10001 | Pin List | [51](51.md) | | 10002 | Relay List Metadata | [65](65.md) | | 22242 | Client Authentication | [42](42.md) | | 24133 | Nostr Connect | [46](46.md) | +| 30000 | Categorized People List | [51](51.md) | +| 30001 | Categorized Bookmark List | [51](51.md) | | 30008 | Profile Badges | [58](58.md) | | 30009 | Badge Definition | [58](58.md) | | 30023 | Long-form Content | [23](23.md) |