From a3292f4ae7856c69e5ace3feb2811574ba12e826 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 4 Sep 2023 11:35:30 -0400 Subject: [PATCH 01/28] First Draft --- 81.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 81.md diff --git a/81.md b/81.md new file mode 100644 index 000000000..864544b09 --- /dev/null +++ b/81.md @@ -0,0 +1,38 @@ +NIP-81 +====== + +Relationship Status +------------------- + +`draft` `optional` `author:vitorpamplona` + +## Abstract + +Creates a replaceable event to assert the level of trust from the author to any other pubkey. The wise-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. + +# Relationship Status Event + +A special event with `kind:30382` "Relationship Status Event" is defined as a _parameterized replaceable event_ with a single `d` tag as the target pubkey. The other tags are stringified, NIP-44 encrypted and placed inside the `.content` of the event. + +For example: + +```js +{ + "kind": 30382, + "tags": [ + ["d", "612ae..e610f"], + ], + "content": ""], + ["nickname", "< nickname to be used instead of the person's name in all interfaces >"] + ["summary", ""], + )", + ...other fields +} +``` + +Status MUST be a case-sensitive displayble category name with the expecation to group users by it. + +Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. + +Clients MAY filter by `kind:30382` to determine how to assemble feeds, group messages and when to display content. \ No newline at end of file From b7aa64dab47bcdc2023be90a6b50a8e4c4058736 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 4 Sep 2023 11:41:59 -0400 Subject: [PATCH 02/28] Quick adjustments --- 81.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/81.md b/81.md index 864544b09..f6956a7ab 100644 --- a/81.md +++ b/81.md @@ -8,7 +8,9 @@ Relationship Status ## Abstract -Creates a replaceable event to assert the level of trust from the author to any other pubkey. The wise-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. +Creates a replaceable event to assert the level of trust from the author to any other pubkey. + +The wise-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. # Relationship Status Event @@ -23,16 +25,20 @@ For example: ["d", "612ae..e610f"], ], "content": ""], - ["nickname", "< nickname to be used instead of the person's name in all interfaces >"] + ["status", ""], + ["nickname", ""] ["summary", ""], )", ...other fields } ``` -Status MUST be a case-sensitive displayble category name with the expecation to group users by it. +`status` MUST be a case-sensitive displayable category name with the expectation to group users by it. It is privately scoped and thus new statuses/groups are welcome. + +`nickname` SHOULD be used instead of the person's display name in all interfaces Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. -Clients MAY filter by `kind:30382` to determine how to assemble feeds, group messages and when to display content. \ No newline at end of file +Clients MAY filter by `kind:30382` to determine how to assemble feeds, group messages, and when to display content. \ No newline at end of file From 0006b13d72aed0ddde7652dd104a18a2adbcf39b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 4 Sep 2023 11:42:33 -0400 Subject: [PATCH 03/28] adds privately --- 81.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/81.md b/81.md index f6956a7ab..f7f95b704 100644 --- a/81.md +++ b/81.md @@ -8,7 +8,7 @@ Relationship Status ## Abstract -Creates a replaceable event to assert the level of trust from the author to any other pubkey. +Creates a replaceable event to privately assert the level of trust from the author to any other pubkey. The wise-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. From 5cc0c937dc0c6a59508f7667693fe5b602162595 Mon Sep 17 00:00:00 2001 From: sudocarlos <122110235+sudocarlos@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:50:32 -0400 Subject: [PATCH 04/28] correct typo --- 81.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/81.md b/81.md index f7f95b704..1ebce92a0 100644 --- a/81.md +++ b/81.md @@ -10,7 +10,7 @@ Relationship Status Creates a replaceable event to privately assert the level of trust from the author to any other pubkey. -The wise-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. +The wide-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. # Relationship Status Event @@ -41,4 +41,4 @@ For example: Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. -Clients MAY filter by `kind:30382` to determine how to assemble feeds, group messages, and when to display content. \ No newline at end of file +Clients MAY filter by `kind:30382` to determine how to assemble feeds, group messages, and when to display content. From dc4af5d1337d2267ae29c778cbaeb86ba9712056 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 7 Feb 2024 17:54:20 -0500 Subject: [PATCH 05/28] Refines proposal to make relationships private. --- 81.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/81.md b/81.md index 1ebce92a0..1a6005190 100644 --- a/81.md +++ b/81.md @@ -1,20 +1,18 @@ NIP-81 ====== -Relationship Status -------------------- +Private Relationship Status +--------------------------- -`draft` `optional` `author:vitorpamplona` +`draft` `optional` ## Abstract -Creates a replaceable event to privately assert the level of trust from the author to any other pubkey. - -The wide-spread use of these statuses between pubkeys is not ideal for Kind 3 or NIP-51 list structures. +Creates a replaceable event using unbound lists to privately assert the level of trust from the author to any other pubkey. # Relationship Status Event -A special event with `kind:30382` "Relationship Status Event" is defined as a _parameterized replaceable event_ with a single `d` tag as the target pubkey. The other tags are stringified, NIP-44 encrypted and placed inside the `.content` of the event. +A new `kind:30382` event named "Relationship Status Event" is defined as a _parameterized replaceable event_ with a single `d` tag as hash of the target pubkey and `n` as the name for the list. The other tags are stringified, NIP-44 encrypted and placed inside the `.content` of the event. For example: @@ -22,23 +20,21 @@ For example: { "kind": 30382, "tags": [ - ["d", "612ae..e610f"], + ["d", bytesToHex(sha256(hexToBytes("")))], + ["n", "Clients"] ], "content": ""], + ["p", "", "relay"] ["nickname", ""] ["summary", ""], + ["nip92secret", ""] )", ...other fields } ``` -`status` MUST be a case-sensitive displayable category name with the expectation to group users by it. It is privately scoped and thus new statuses/groups are welcome. - `nickname` SHOULD be used instead of the person's display name in all interfaces Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. -Clients MAY filter by `kind:30382` to determine how to assemble feeds, group messages, and when to display content. +Clients MAY filter by `kind:30382`, with or without `n` tags, to determine how to assemble feeds, group messages, and when to display content. From bd1755f44c61180ef074fe7c6eb5f86726b999b7 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 7 Feb 2024 17:57:53 -0500 Subject: [PATCH 06/28] Improves formatting --- 81.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/81.md b/81.md index 1a6005190..49d11805a 100644 --- a/81.md +++ b/81.md @@ -6,13 +6,9 @@ Private Relationship Status `draft` `optional` -## Abstract +A new `kind:30382` event documents a "Private Relationship Status" between two users of the network. -Creates a replaceable event using unbound lists to privately assert the level of trust from the author to any other pubkey. - -# Relationship Status Event - -A new `kind:30382` event named "Relationship Status Event" is defined as a _parameterized replaceable event_ with a single `d` tag as hash of the target pubkey and `n` as the name for the list. The other tags are stringified, NIP-44 encrypted and placed inside the `.content` of the event. +It is defined as a _parameterized replaceable event_ with a single `d` tag as hash of the target `.pubkey` and `n` as the name for the list. The other tags are stringified, NIP-44 encrypted and placed inside the `.content` of the event. For example: From 73a2aab8dd1b8ab73170ccc778a4f57e18745f6a Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 7 Feb 2024 17:59:27 -0500 Subject: [PATCH 07/28] Optional n tag --- 81.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/81.md b/81.md index 49d11805a..8818805a6 100644 --- a/81.md +++ b/81.md @@ -8,7 +8,9 @@ Private Relationship Status A new `kind:30382` event documents a "Private Relationship Status" between two users of the network. -It is defined as a _parameterized replaceable event_ with a single `d` tag as hash of the target `.pubkey` and `n` as the name for the list. The other tags are stringified, NIP-44 encrypted and placed inside the `.content` of the event. +It is defined as a _parameterized replaceable event_ with a single `d` tag as hash of the target `.pubkey`. An optional `n` tag adds the target key to an unbound list. + +The other tags are stringified, NIP-44-encrypted and placed inside the `.content` of the event. For example: From 225be8a2a1ab5764e585b3e387b708ee06e85dc9 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 7 Feb 2024 18:00:19 -0500 Subject: [PATCH 08/28] correcting the example --- 81.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/81.md b/81.md index 8818805a6..958937dae 100644 --- a/81.md +++ b/81.md @@ -25,7 +25,7 @@ For example: ["p", "", "relay"] ["nickname", ""] ["summary", ""], - ["nip92secret", ""] + ["nip82secret", ""] )", ...other fields } From 0f4edef69fefb1d8d2f7444aa15b443b852d4ffd Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 7 Feb 2024 18:33:15 -0500 Subject: [PATCH 09/28] Switch to random UUID for better security. --- 81.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/81.md b/81.md index 958937dae..4c8cfa96c 100644 --- a/81.md +++ b/81.md @@ -8,7 +8,7 @@ Private Relationship Status A new `kind:30382` event documents a "Private Relationship Status" between two users of the network. -It is defined as a _parameterized replaceable event_ with a single `d` tag as hash of the target `.pubkey`. An optional `n` tag adds the target key to an unbound list. +It is defined as a _parameterized replaceable event_ with a single `d` tag as a random UUID per pubkey. An optional `n` tag adds the target key to an unbound list. The other tags are stringified, NIP-44-encrypted and placed inside the `.content` of the event. @@ -18,7 +18,7 @@ For example: { "kind": 30382, "tags": [ - ["d", bytesToHex(sha256(hexToBytes("")))], + ["d", ""], ["n", "Clients"] ], "content": " Date: Mon, 12 Feb 2024 11:42:10 -0500 Subject: [PATCH 10/28] Updating NIP-81 to add private and public statuses --- 81.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/81.md b/81.md index 4c8cfa96c..bd629d195 100644 --- a/81.md +++ b/81.md @@ -1,18 +1,41 @@ NIP-81 ====== -Private Relationship Status ---------------------------- +Relationship Status +------------------- `draft` `optional` -A new `kind:30382` event documents a "Private Relationship Status" between two users of the network. +Event `kind:30382` documents a "Relationship Status" between two pubkeys and uses private and public tags to enhance the description of that relationship. -It is defined as a _parameterized replaceable event_ with a single `d` tag as a random UUID per pubkey. An optional `n` tag adds the target key to an unbound list. +Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag as a random UUID per pubkey. -The other tags are stringified, NIP-44-encrypted and placed inside the `.content` of the event. +Optional `n` tags add the target key to an unbound list. -For example: +The private tags are stringified, NIP-44-encrypted and placed inside the `.content` of the event. + +Examples: + +Public Status + +```js +{ + "kind": 30382, + "tags": [ + ["d", ""], + ["n", "Clients"], + ["n", "Developers"], + ["p", "", "relay"], + ["trust_level", "1"], + ["nickname", ""], + ["summary", ""] + ], + "content": "", + // ...other fields +} +``` + +Private Status ```js { @@ -21,12 +44,12 @@ For example: ["d", ""], ["n", "Clients"] ], - "content": "", "relay"] ["nickname", ""] ["summary", ""], ["nip82secret", ""] - )", + ])), ...other fields } ``` @@ -36,3 +59,29 @@ For example: Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. Clients MAY filter by `kind:30382`, with or without `n` tags, to determine how to assemble feeds, group messages, and when to display content. + +### Private `n`-tags + +Clients MAY hide human readable `n`-tags behind a code and list their code maps in `kind:10007` using the `n_name` tag. + +```js +{ + "kind": 10007, + "content": nip44Encrypt(JSON.stringify([ + ["n_name", "", ""], + ["n_name", "Clients", "Clients"] // public list of my Clients + ["n_name", "6064460175057025", "Idiot"] // private list of idiots + ])), + // ...other fields +} +``` + +### Deterministic `d`-Tag. + +For private use cases that must contain deterministic d-Tags, the recommendation is to use NIP-44's `hkdf` function and use a hash between the user's private key and the pubkey of the `p` tag. + +``` +nip81_key = hkdf(private_key, salt: 'nip81') +bobs_tag = sha256(nip81_key || bobs_pub) +kates_tag = sha256(nip81_key || kates_pub) +``` \ No newline at end of file From 6868e029f9b77ef742b19cc1fdbb6b7ac3987835 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 11:46:33 -0500 Subject: [PATCH 11/28] formatting --- 81.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/81.md b/81.md index bd629d195..5023b6846 100644 --- a/81.md +++ b/81.md @@ -6,17 +6,13 @@ Relationship Status `draft` `optional` -Event `kind:30382` documents a "Relationship Status" between two pubkeys and uses private and public tags to enhance the description of that relationship. +Event `kind:30382` documents a "Relationship Status" between two pubkeys and uses private and public tags to enhance the description of that relationship. Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag that identifies each pair of keys. -Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag as a random UUID per pubkey. +Optional `n` tags add the target key to unbound lists. -Optional `n` tags add the target key to an unbound list. +The private tags are JSON Stringified, [NIP-44](44.md)-encrypted and placed inside the `.content` of the event. -The private tags are stringified, NIP-44-encrypted and placed inside the `.content` of the event. - -Examples: - -Public Status +Example of public Status ```js { @@ -35,7 +31,7 @@ Public Status } ``` -Private Status +Example of private Status ```js { @@ -70,18 +66,18 @@ Clients MAY hide human readable `n`-tags behind a code and list their code maps "content": nip44Encrypt(JSON.stringify([ ["n_name", "", ""], ["n_name", "Clients", "Clients"] // public list of my Clients - ["n_name", "6064460175057025", "Idiot"] // private list of idiots + ["n_name", "6064460175057025", "Idiots"] // private list of idiots ])), // ...other fields } ``` -### Deterministic `d`-Tag. +### Deterministic `d`-Tags. -For private use cases that must contain deterministic d-Tags, the recommendation is to use NIP-44's `hkdf` function and use a hash between the user's private key and the pubkey of the `p` tag. +For private use cases that must contain deterministic d-Tags, the recommendation is to use [NIP-44](44.md)'s `hkdf` function and use a hash between the user's private key and the pubkey of the `p` tag. ``` nip81_key = hkdf(private_key, salt: 'nip81') -bobs_tag = sha256(nip81_key || bobs_pub) -kates_tag = sha256(nip81_key || kates_pub) +bobs_d_tag = sha256(nip81_key || bobs_pub) +kates_d_tag = sha256(nip81_key || kates_pub) ``` \ No newline at end of file From ee6d4e673ed608fec154b1e5582430033b476e96 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 11:48:35 -0500 Subject: [PATCH 12/28] enhancing the example with private ntags --- 81.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/81.md b/81.md index 5023b6846..be03c4ffd 100644 --- a/81.md +++ b/81.md @@ -38,7 +38,8 @@ Example of private Status "kind": 30382, "tags": [ ["d", ""], - ["n", "Clients"] + ["n", "Clients"], + ["n", "6064460175057025"], // see private n-tags below ], "content": nip44Encrypt(JSON.stringify([ ["p", "", "relay"] From 1bcbd31090604b32f6413b60457bd5aacebc90cb Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 11:49:02 -0500 Subject: [PATCH 13/28] wording --- 81.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/81.md b/81.md index be03c4ffd..e8bce0cb1 100644 --- a/81.md +++ b/81.md @@ -65,7 +65,7 @@ Clients MAY hide human readable `n`-tags behind a code and list their code maps { "kind": 10007, "content": nip44Encrypt(JSON.stringify([ - ["n_name", "", ""], + ["n_name", "", ""], ["n_name", "Clients", "Clients"] // public list of my Clients ["n_name", "6064460175057025", "Idiots"] // private list of idiots ])), From df362d1461dab0066eab12aee2d827eb22d89c3e Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 11:49:47 -0500 Subject: [PATCH 14/28] formatting --- 81.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/81.md b/81.md index e8bce0cb1..5d7117178 100644 --- a/81.md +++ b/81.md @@ -12,7 +12,7 @@ Optional `n` tags add the target key to unbound lists. The private tags are JSON Stringified, [NIP-44](44.md)-encrypted and placed inside the `.content` of the event. -Example of public Status +Example of Public Status ```js { @@ -31,7 +31,7 @@ Example of public Status } ``` -Example of private Status +Example of Private Status ```js { From 873569c208bd2b3591aaa9007cef64620444cef1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 11:51:45 -0500 Subject: [PATCH 15/28] formatting --- 81.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/81.md b/81.md index 5d7117178..b58d205b3 100644 --- a/81.md +++ b/81.md @@ -42,12 +42,12 @@ Example of Private Status ["n", "6064460175057025"], // see private n-tags below ], "content": nip44Encrypt(JSON.stringify([ - ["p", "", "relay"] - ["nickname", ""] + ["p", "", "relay"], + ["nickname", ""], ["summary", ""], ["nip82secret", ""] ])), - ...other fields + // ...other fields } ``` From 1e7da2bb7087612591ab5efc4fd6635389f9f3e3 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 11:57:50 -0500 Subject: [PATCH 16/28] Moves to 10008 kind for name maps --- 81.md | 10 +++++----- README.md | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/81.md b/81.md index b58d205b3..aae5e33bb 100644 --- a/81.md +++ b/81.md @@ -59,15 +59,15 @@ Clients MAY filter by `kind:30382`, with or without `n` tags, to determine how t ### Private `n`-tags -Clients MAY hide human readable `n`-tags behind a code and list their code maps in `kind:10007` using the `n_name` tag. +Clients MAY hide human readable `n`-tags behind a code and list their code maps in the new "Unbound List Names" event kind (`kind:10008`), using the `map` tag from code to name. ```js { - "kind": 10007, + "kind": 10008, "content": nip44Encrypt(JSON.stringify([ - ["n_name", "", ""], - ["n_name", "Clients", "Clients"] // public list of my Clients - ["n_name", "6064460175057025", "Idiots"] // private list of idiots + ["map", "", ""], + ["map", "Clients", "Clients"], // public list of my Clients + ["map", "6064460175057025", "Idiots"] // private list of idiots ])), // ...other fields } diff --git a/README.md b/README.md index d1c525003..846c857a0 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-72: Moderated Communities](72.md) - [NIP-75: Zap Goals](75.md) - [NIP-78: Application-specific data](78.md) +- [NIP-81: Relationship Status](81.md) - [NIP-84: Highlights](84.md) - [NIP-89: Recommended Application Handlers](89.md) - [NIP-90: Data Vending Machines](90.md) @@ -123,6 +124,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `10005` | Public chats list | [51](51.md) | | `10006` | Blocked relays list | [51](51.md) | | `10007` | Search relays list | [51](51.md) | +| `10008` | Unbound List Names | [81](81.md) | | `10015` | Interests list | [51](51.md) | | `10030` | User emoji list | [51](51.md) | | `10096` | File storage server list | [96](96.md) | @@ -151,6 +153,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30078` | Application-specific Data | [78](78.md) | | `30311` | Live Event | [53](53.md) | | `30315` | User Statuses | [38](38.md) | +| `30382` | Relationship Status | [81](81.md) | | `30402` | Classified Listing | [99](99.md) | | `30403` | Draft Classified Listing | [99](99.md) | | `31922` | Date-Based Calendar Event | [52](52.md) | From 3ff65d1d64890efd78ebb58d8800e75c3534f2c0 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 12 Feb 2024 12:17:06 -0500 Subject: [PATCH 17/28] Adds edge cases --- 81.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/81.md b/81.md index aae5e33bb..e93676228 100644 --- a/81.md +++ b/81.md @@ -6,7 +6,7 @@ Relationship Status `draft` `optional` -Event `kind:30382` documents a "Relationship Status" between two pubkeys and uses private and public tags to enhance the description of that relationship. Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag that identifies each pair of keys. +Event `kind:30382` documents a "Relationship Status" between two keys, the signer and a `p`-tag, and uses private and public tags to enhance the description of that relationship. Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag whole value identifies the key pair. Optional `n` tags add the target key to unbound lists. @@ -57,6 +57,12 @@ Profile screens MAY display the summary of the relationship and allow the user t Clients MAY filter by `kind:30382`, with or without `n` tags, to determine how to assemble feeds, group messages, and when to display content. +Web of Trust processors MAY use `kind:30382` as directional edges in the Web of Trust graph. + +Multiple `p`-tags in a single `kind:30382` represent a group of individuals that SHOULD be considered as of one entity. The other tags decribe the relationship to the entity and not individual keys. + +Having one `p`-tag in multiple `d`-tags represent separate statuses for the same pubkey based on their participation in a list `n` + ### Private `n`-tags Clients MAY hide human readable `n`-tags behind a code and list their code maps in the new "Unbound List Names" event kind (`kind:10008`), using the `map` tag from code to name. From a401682a582917739ff8b904d91c6955e78e8e88 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 14 Feb 2024 15:01:55 -0500 Subject: [PATCH 18/28] renames nicknames to petnames --- 81.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/81.md b/81.md index e93676228..abb525507 100644 --- a/81.md +++ b/81.md @@ -19,11 +19,11 @@ Example of Public Status "kind": 30382, "tags": [ ["d", ""], - ["n", "Clients"], - ["n", "Developers"], + ["n", "Client List"], + ["n", "Special Holidays List"], ["p", "", "relay"], ["trust_level", "1"], - ["nickname", ""], + ["petname", ""], ["summary", ""] ], "content": "", @@ -38,12 +38,12 @@ Example of Private Status "kind": 30382, "tags": [ ["d", ""], - ["n", "Clients"], + ["n", "Clients List"], ["n", "6064460175057025"], // see private n-tags below ], "content": nip44Encrypt(JSON.stringify([ ["p", "", "relay"], - ["nickname", ""], + ["petname", ""], ["summary", ""], ["nip82secret", ""] ])), @@ -51,7 +51,7 @@ Example of Private Status } ``` -`nickname` SHOULD be used instead of the person's display name in all interfaces +`petname` SHOULD be used instead of the person's display name in all interfaces Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. @@ -72,7 +72,7 @@ Clients MAY hide human readable `n`-tags behind a code and list their code maps "kind": 10008, "content": nip44Encrypt(JSON.stringify([ ["map", "", ""], - ["map", "Clients", "Clients"], // public list of my Clients + ["map", "Clients List", "Clients List"], // public list of my Clients ["map", "6064460175057025", "Idiots"] // private list of idiots ])), // ...other fields From 61898c0cd069b927999c26659e0acd379c752c22 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 19 Mar 2024 16:01:55 -0400 Subject: [PATCH 19/28] Simplifying statuses --- 81.md | 85 ++++++++++++++++++++++++----------------------------------- 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/81.md b/81.md index abb525507..eecca7073 100644 --- a/81.md +++ b/81.md @@ -6,85 +6,68 @@ Relationship Status `draft` `optional` -Event `kind:30382` documents a "Relationship Status" between two keys, the signer and a `p`-tag, and uses private and public tags to enhance the description of that relationship. Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag whole value identifies the key pair. +Event `kind:30382` documents a "Relationship Status" between two keys and uses private and public tags to describe that relationship. -Optional `n` tags add the target key to unbound lists. +Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag that identifies the target key. -The private tags are JSON Stringified, [NIP-44](44.md)-encrypted and placed inside the `.content` of the event. - -Example of Public Status - -```js -{ - "kind": 30382, - "tags": [ - ["d", ""], - ["n", "Client List"], - ["n", "Special Holidays List"], - ["p", "", "relay"], - ["trust_level", "1"], - ["petname", ""], - ["summary", ""] - ], - "content": "", - // ...other fields -} -``` - -Example of Private Status +When the relationship is public, the `d` tag is the same as the `p`-tag. ```js { "kind": 30382, "tags": [ - ["d", ""], - ["n", "Clients List"], - ["n", "6064460175057025"], // see private n-tags below + ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], + ["n", "Follow"], + ["n", "Bitcoiners"], + ["n", "6064460175057025"] + ["p", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411", ""], ], "content": nip44Encrypt(JSON.stringify([ - ["p", "", "relay"], - ["petname", ""], - ["summary", ""], - ["nip82secret", ""] + ["petname", "NVK (Coldcard)"], + ["summary", "Owes me a beer"] ])), // ...other fields } ``` -`petname` SHOULD be used instead of the person's display name in all interfaces - -Profile screens MAY display the summary of the relationship and allow the user to change the tags of this event. - -Clients MAY filter by `kind:30382`, with or without `n` tags, to determine how to assemble feeds, group messages, and when to display content. - -Web of Trust processors MAY use `kind:30382` as directional edges in the Web of Trust graph. +The private tags are JSON Stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event. -Multiple `p`-tags in a single `kind:30382` represent a group of individuals that SHOULD be considered as of one entity. The other tags decribe the relationship to the entity and not individual keys. +`petname` SHOULD be used instead of the person's display name in all interfaces -Having one `p`-tag in multiple `d`-tags represent separate statuses for the same pubkey based on their participation in a list `n` +### Relationship Categories -### Private `n`-tags +Optional `n` tags `["n", ""]` add the target key to unbound lists. This allows clients to query by `n` and download all members of a list. -Clients MAY hide human readable `n`-tags behind a code and list their code maps in the new "Unbound List Names" event kind (`kind:10008`), using the `map` tag from code to name. +List `codes` can be human readable or not. A new event kind named "Unbound List Names" (`kind:10008`) uses `map` tags to display the list name. Clients SHOULD display the `name` instead of the `code` if the `code` is present in this list. ```js { "kind": 10008, "content": nip44Encrypt(JSON.stringify([ - ["map", "", ""], - ["map", "Clients List", "Clients List"], // public list of my Clients - ["map", "6064460175057025", "Idiots"] // private list of idiots + ["map", "", ""], + ["map", "Bitcoiners", "Bitcoiners"], + ["map", "6064460175057025", "Debtors"] ])), // ...other fields } ``` -### Deterministic `d`-Tags. +### Private Relationship Status -For private use cases that must contain deterministic d-Tags, the recommendation is to use [NIP-44](44.md)'s `hkdf` function and use a hash between the user's private key and the pubkey of the `p` tag. +For relationships that MUST remain private, a deterministic `d`-Tag is calculated using [NIP-44](44.md)'s `hkdf` function and a `sha256` hash between the signer's private key and the pubkey of the `p` tag. -``` -nip81_key = hkdf(private_key, salt: 'nip81') -bobs_d_tag = sha256(nip81_key || bobs_pub) -kates_d_tag = sha256(nip81_key || kates_pub) +```js +{ + "kind": 30382, + "tags": [ + ["d", sha256(hkdf(private_key, salt: 'nip81') || "")], + ], + "content": nip44Encrypt(JSON.stringify([ + ["p", "", "relay"], + ["n", "Clients List"], + ["petname", ""], + ["summary", ""], + ])), + // ...other fields +} ``` \ No newline at end of file From 4482a41d903de21e298bf727ee80ffba47223108 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 19 Mar 2024 16:16:00 -0400 Subject: [PATCH 20/28] Creating two event kinds. --- 81.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/81.md b/81.md index eecca7073..faf81c31a 100644 --- a/81.md +++ b/81.md @@ -6,21 +6,22 @@ Relationship Status `draft` `optional` -Event `kind:30382` documents a "Relationship Status" between two keys and uses private and public tags to describe that relationship. +This NIP defines two new event kinds (`30382` and `30383`) to document the relationship between two keys. -Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag that identifies the target key. +Both kinds offer public and private tags to describe that relationship. Private tags are JSON Stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event. -When the relationship is public, the `d` tag is the same as the `p`-tag. +### Public Relationship Status + +Event kind `30382` is used when the relationship itself is public, with the `d` tag receiving the public key each target key. ```js { "kind": 30382, "tags": [ ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], - ["n", "Follow"], + ["n", "Follows"], ["n", "Bitcoiners"], ["n", "6064460175057025"] - ["p", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411", ""], ], "content": nip44Encrypt(JSON.stringify([ ["petname", "NVK (Coldcard)"], @@ -30,9 +31,7 @@ When the relationship is public, the `d` tag is the same as the `p`-tag. } ``` -The private tags are JSON Stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event. - -`petname` SHOULD be used instead of the person's display name in all interfaces +`petname` SHOULD be used instead of the person's display name in all interfaces. ### Relationship Categories @@ -54,13 +53,14 @@ List `codes` can be human readable or not. A new event kind named "Unbound List ### Private Relationship Status -For relationships that MUST remain private, a deterministic `d`-Tag is calculated using [NIP-44](44.md)'s `hkdf` function and a `sha256` hash between the signer's private key and the pubkey of the `p` tag. +For relationships that MUST remain private, Event kind `30383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. ```js { - "kind": 30382, + "kind": 30383, "tags": [ ["d", sha256(hkdf(private_key, salt: 'nip81') || "")], + ["n", "6064460175057025"], ], "content": nip44Encrypt(JSON.stringify([ ["p", "", "relay"], From a3a678464e17998cfe884068ac7b23c6e767bee3 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 10 May 2024 10:39:22 -0400 Subject: [PATCH 21/28] Update 81.md Co-authored-by: arthurfranca --- 81.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/81.md b/81.md index faf81c31a..f01e8dd0e 100644 --- a/81.md +++ b/81.md @@ -64,7 +64,7 @@ For relationships that MUST remain private, Event kind `30383` uses a similar st ], "content": nip44Encrypt(JSON.stringify([ ["p", "", "relay"], - ["n", "Clients List"], + ["n", "clients-list"], ["petname", ""], ["summary", ""], ])), From 08d8b1e5ace2a86c9e1b9b15b9635bd2ce31a7da Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 10 May 2024 10:39:28 -0400 Subject: [PATCH 22/28] Update 81.md Co-authored-by: arthurfranca --- 81.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/81.md b/81.md index f01e8dd0e..064207856 100644 --- a/81.md +++ b/81.md @@ -19,8 +19,8 @@ Event kind `30382` is used when the relationship itself is public, with the `d` "kind": 30382, "tags": [ ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], - ["n", "Follows"], - ["n", "Bitcoiners"], + ["n", "follow"], + ["n", "bitcoiner"], ["n", "6064460175057025"] ], "content": nip44Encrypt(JSON.stringify([ From a5ff4869898e106682f214ed4562745a16da0a63 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 10 May 2024 10:39:33 -0400 Subject: [PATCH 23/28] Update 81.md Co-authored-by: arthurfranca --- 81.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/81.md b/81.md index 064207856..43fc91b81 100644 --- a/81.md +++ b/81.md @@ -44,8 +44,8 @@ List `codes` can be human readable or not. A new event kind named "Unbound List "kind": 10008, "content": nip44Encrypt(JSON.stringify([ ["map", "", ""], - ["map", "Bitcoiners", "Bitcoiners"], - ["map", "6064460175057025", "Debtors"] + ["map", "bitcoiner", "bitcoiner"], + ["map", "6064460175057025", "debtor"] ])), // ...other fields } From bae459a771b4901f0d58cc77d66f7eaf85991ed1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 10 May 2024 20:01:11 -0400 Subject: [PATCH 24/28] Updates relationship status to use event sets. --- 81.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/81.md b/81.md index 43fc91b81..150f67832 100644 --- a/81.md +++ b/81.md @@ -12,7 +12,7 @@ Both kinds offer public and private tags to describe that relationship. Private ### Public Relationship Status -Event kind `30382` is used when the relationship itself is public, with the `d` tag receiving the public key each target key. +Event kind `30382` is used when the relationship itself is public. The `d` tag contains the target public key in hex. ```js { @@ -31,19 +31,21 @@ Event kind `30382` is used when the relationship itself is public, with the `d` } ``` -`petname` SHOULD be used instead of the person's display name in all interfaces. +`petname` SHOULD be rendered instead of the person's display name in all interfaces when the signer of this event is logged in. ### Relationship Categories -Optional `n` tags `["n", ""]` add the target key to unbound lists. This allows clients to query by `n` and download all members of a list. +Optional `n` tags `["n", ""]` add the target key to event sets. This allows clients to query by `n` and download all members of a set. -List `codes` can be human readable or not. A new event kind named "Unbound List Names" (`kind:10008`) uses `map` tags to display the list name. Clients SHOULD display the `name` instead of the `code` if the `code` is present in this list. +Set `identifier` can be human readable and public or not. + +For private cases, a new event kind named "Event Set Names" (`kind:10008`) uses `map` tags to store the set name. Clients SHOULD display the `name` instead of the `identifier` if the `identifier` is present in this event. ```js { "kind": 10008, "content": nip44Encrypt(JSON.stringify([ - ["map", "", ""], + ["map", "", ""], ["map", "bitcoiner", "bitcoiner"], ["map", "6064460175057025", "debtor"] ])), @@ -53,7 +55,7 @@ List `codes` can be human readable or not. A new event kind named "Unbound List ### Private Relationship Status -For relationships that MUST remain private, Event kind `30383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. +For relationships that must remain private (e.g private follows, client lists, etc), the event kind `30383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. ```js { @@ -63,8 +65,8 @@ For relationships that MUST remain private, Event kind `30383` uses a similar st ["n", "6064460175057025"], ], "content": nip44Encrypt(JSON.stringify([ - ["p", "", "relay"], - ["n", "clients-list"], + ["p", "", ""], + ["n", "client-list"], ["petname", ""], ["summary", ""], ])), From a8c573f4eaeacbdbd8432ba0d97f9261d67d7c43 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 10 May 2024 20:22:30 -0400 Subject: [PATCH 25/28] adds public relationship status to the readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 611f92f60..c82b000fe 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30078` | Application-specific Data | [78](78.md) | | `30311` | Live Event | [53](53.md) | | `30315` | User Statuses | [38](38.md) | -| `30382` | Relationship Status | [81](81.md) | +| `30382` | Public Relationship Status | [81](81.md) | +| `30383` | Private Relationship Status| [81](81.md) | | `30402` | Classified Listing | [99](99.md) | | `30403` | Draft Classified Listing | [99](99.md) | | `30617` | Repository announcements | [34](34.md) | From 4e0b5fa038d3e76c7bf651c80f018ee70122fa23 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 20 Jun 2024 14:34:02 -0400 Subject: [PATCH 26/28] Aligning the Private Relationship status Kind with the other PRs --- 81.md | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/81.md b/81.md index 150f67832..74495f583 100644 --- a/81.md +++ b/81.md @@ -55,11 +55,11 @@ For private cases, a new event kind named "Event Set Names" (`kind:10008`) uses ### Private Relationship Status -For relationships that must remain private (e.g private follows, client lists, etc), the event kind `30383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. +For relationships that must remain private (e.g private follows, client lists, etc), the event kind `31383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. ```js { - "kind": 30383, + "kind": 31383, "tags": [ ["d", sha256(hkdf(private_key, salt: 'nip81') || "")], ["n", "6064460175057025"], diff --git a/README.md b/README.md index c82b000fe..bc0419c9c 100644 --- a/README.md +++ b/README.md @@ -172,11 +172,11 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30311` | Live Event | [53](53.md) | | `30315` | User Statuses | [38](38.md) | | `30382` | Public Relationship Status | [81](81.md) | -| `30383` | Private Relationship Status| [81](81.md) | | `30402` | Classified Listing | [99](99.md) | | `30403` | Draft Classified Listing | [99](99.md) | | `30617` | Repository announcements | [34](34.md) | | `30818` | Wiki article | [54](54.md) | +| `31382` | Private Relationship Status| [81](81.md) | | `31922` | Date-Based Calendar Event | [52](52.md) | | `31923` | Time-Based Calendar Event | [52](52.md) | | `31924` | Calendar | [52](52.md) | From 3ba8526756bd06d7a0744d66ccccdb5fd746859b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 20 Jun 2024 14:35:45 -0400 Subject: [PATCH 27/28] Fixing kind numbers --- 81.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/81.md b/81.md index 74495f583..8f8679e93 100644 --- a/81.md +++ b/81.md @@ -6,7 +6,7 @@ Relationship Status `draft` `optional` -This NIP defines two new event kinds (`30382` and `30383`) to document the relationship between two keys. +This NIP defines two new event kinds (`30382` and `31382`) to document the relationship between two keys. Both kinds offer public and private tags to describe that relationship. Private tags are JSON Stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event. @@ -55,11 +55,11 @@ For private cases, a new event kind named "Event Set Names" (`kind:10008`) uses ### Private Relationship Status -For relationships that must remain private (e.g private follows, client lists, etc), the event kind `31383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. +For relationships that must remain private (e.g private follows, client lists, etc), the event kind `31382` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. ```js { - "kind": 31383, + "kind": 31382, "tags": [ ["d", sha256(hkdf(private_key, salt: 'nip81') || "")], ["n", "6064460175057025"], From 8dafaf8714dcb9c0fca5530b53535bf8327ed6c7 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 11 Oct 2024 08:36:13 -0400 Subject: [PATCH 28/28] moves event set names to the right position on readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4223f1728..f7be7dff1 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `44` | Channel Mute User | [28](28.md) | | `64` | Chess (PGN) | [64](64.md) | | `818` | Merge Requests | [54](54.md) | -| `10008` | Event Set Names | [81](81.md) | | `1021` | Bid | [15](15.md) | | `1022` | Bid confirmation | [15](15.md) | | `1040` | OpenTimestamps | [03](03.md) | @@ -156,6 +155,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `10005` | Public chats list | [51](51.md) | | `10006` | Blocked relays list | [51](51.md) | | `10007` | Search relays list | [51](51.md) | +| `10008` | Event Set Names | [81](81.md) | | `10009` | User groups | [51](51.md), [29](29.md) | | `10015` | Interests list | [51](51.md) | | `10030` | User emoji list | [51](51.md) |