From 8b158e92279c08af812307ed7294378ddb8abbdd Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Tue, 21 Mar 2023 15:24:05 -0300 Subject: [PATCH 1/6] Add alternative mention handling NIP --- 08.md | 2 ++ 27.md | 17 +++++++++++++++++ README.md | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 27.md diff --git a/08.md b/08.md index 113cb539..d82787db 100644 --- a/08.md +++ b/08.md @@ -1,3 +1,5 @@ +> __Warning__ `unrecommended`: discouraged in favor of NIP-27 + NIP-08 ====== diff --git a/27.md b/27.md new file mode 100644 index 00000000..b2d1e5aa --- /dev/null +++ b/27.md @@ -0,0 +1,17 @@ +NIP-27 +====== + +Handling Mentions +----------------- + +`draft` `optional` `author:fiatjaf` `author:scsibug` `author:arthurfranca` + +This document standardizes the treatment given by clients of inline mentions of other events and pubkeys inside the content of `text_note`s. + +Clients that want to allow inline mentions they MUST show an autocomplete component or something analogous to that whenever the user starts typing a special key (for example, "@") or presses some button to include a mention etc -- or these clients can come up with other ways to unambiguously differentiate between mentions and normal text. + +Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST replace its textual reference (inside `.content`) with the notation `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg` as per NIP-21. If client doesn't support NIP-21, it can instead use a regular http link to a nostr client such as `https://snort.social/p/nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`. The client MAY add that pubkey to the `.tags` with the tag `p` if it wishes to notify mentioned user. + +The same process applies for mentioning event IDs, except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. + +A client that receives a `text_note` event with such `nostr:...` mentions in its `.content` CAN do any desired context augmentation (for example, linking to the pubkey or showing a preview of the mentioned event contents) it wants in the process. diff --git a/README.md b/README.md index 37b2fe44..d93f5c2d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh - [NIP-05: Mapping Nostr keys to DNS-based internet identifiers](05.md) - [NIP-06: Basic key derivation from mnemonic seed phrase](06.md) - [NIP-07: `window.nostr` capability for web browsers](07.md) -- [NIP-08: Handling Mentions](08.md) +- [NIP-08: Handling Mentions](08.md) – `unrecommended`: discouraged in favor of [NIP-27](27.md) - [NIP-09: Event Deletion](09.md) - [NIP-10: Conventions for clients' use of `e` and `p` tags in text events](10.md) - [NIP-11: Relay Information Document](11.md) @@ -25,6 +25,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh - [NIP-23: Long-form Content](23.md) - [NIP-25: Reactions](25.md) - [NIP-26: Delegated Event Signing](26.md) +- [NIP-27: Handling Mentions](27.md) - [NIP-28: Public Chat](28.md) - [NIP-33: Parameterized Replaceable Events](33.md) - [NIP-36: Sensitive Content](36.md) From a32ec25ecb5cb13754e435db01ef6bf2a749769c Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Wed, 22 Mar 2023 10:13:04 -0300 Subject: [PATCH 2/6] Make it clear why e tags are discouraged --- 27.md | 11 ++++++----- README.md | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/27.md b/27.md index b2d1e5aa..237feaaf 100644 --- a/27.md +++ b/27.md @@ -1,17 +1,18 @@ NIP-27 ====== -Handling Mentions ------------------ +Text Note References +-------------------- `draft` `optional` `author:fiatjaf` `author:scsibug` `author:arthurfranca` -This document standardizes the treatment given by clients of inline mentions of other events and pubkeys inside the content of `text_note`s. +This document standardizes the treatment given by clients of inline references of other events and pubkeys inside the content of `text notes` (currently kinds 1 and 30023). -Clients that want to allow inline mentions they MUST show an autocomplete component or something analogous to that whenever the user starts typing a special key (for example, "@") or presses some button to include a mention etc -- or these clients can come up with other ways to unambiguously differentiate between mentions and normal text. +Clients that want to allow inline mentions of profiles MUST show an autocomplete component or something analogous to that whenever the user starts typing a special key (for example, "@") or presses some button to include a mention etc -- or these clients can come up with other ways to unambiguously differentiate between mentions and normal text. Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST replace its textual reference (inside `.content`) with the notation `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg` as per NIP-21. If client doesn't support NIP-21, it can instead use a regular http link to a nostr client such as `https://snort.social/p/nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`. The client MAY add that pubkey to the `.tags` with the tag `p` if it wishes to notify mentioned user. -The same process applies for mentioning event IDs, except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. +The same process applies for referencing event IDs, except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. +Because `e` tags on `text notes` are usually considered ancestor events used to build a conversarion thread (as per NIP-10), it is advised to use inline references when mentioning events and NOT adding corresponding `e` tag to the `.tags` event key. A client that receives a `text_note` event with such `nostr:...` mentions in its `.content` CAN do any desired context augmentation (for example, linking to the pubkey or showing a preview of the mentioned event contents) it wants in the process. diff --git a/README.md b/README.md index d93f5c2d..6642e926 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh - [NIP-23: Long-form Content](23.md) - [NIP-25: Reactions](25.md) - [NIP-26: Delegated Event Signing](26.md) -- [NIP-27: Handling Mentions](27.md) +- [NIP-27: Text Note References](27.md) - [NIP-28: Public Chat](28.md) - [NIP-33: Parameterized Replaceable Events](33.md) - [NIP-36: Sensitive Content](36.md) From 61a158caec1f8cfb3ffa98792640f0df807f35a8 Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Wed, 22 Mar 2023 19:48:07 -0300 Subject: [PATCH 3/6] Replace specific client url --- 27.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/27.md b/27.md index 237feaaf..26e29af8 100644 --- a/27.md +++ b/27.md @@ -10,7 +10,7 @@ This document standardizes the treatment given by clients of inline references o Clients that want to allow inline mentions of profiles MUST show an autocomplete component or something analogous to that whenever the user starts typing a special key (for example, "@") or presses some button to include a mention etc -- or these clients can come up with other ways to unambiguously differentiate between mentions and normal text. -Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST replace its textual reference (inside `.content`) with the notation `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg` as per NIP-21. If client doesn't support NIP-21, it can instead use a regular http link to a nostr client such as `https://snort.social/p/nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`. The client MAY add that pubkey to the `.tags` with the tag `p` if it wishes to notify mentioned user. +Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST replace its textual reference (inside `.content`) with the notation `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg` as per NIP-21. If client doesn't support NIP-21, it can instead use a regular http link to a nostr client such as `https://a-nostr-client.com/nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`. The client MAY add that pubkey to the `.tags` with the tag `p` if it wishes to notify mentioned user. The same process applies for referencing event IDs, except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. Because `e` tags on `text notes` are usually considered ancestor events used to build a conversarion thread (as per NIP-10), it is advised to use inline references when mentioning events and NOT adding corresponding `e` tag to the `.tags` event key. From 9764a3b510c11719c76ec86240c67049981b8b45 Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Wed, 22 Mar 2023 19:50:03 -0300 Subject: [PATCH 4/6] Replace discouraged with deprecated --- 08.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/08.md b/08.md index d82787db..2ab2b8fc 100644 --- a/08.md +++ b/08.md @@ -1,4 +1,4 @@ -> __Warning__ `unrecommended`: discouraged in favor of NIP-27 +> __Warning__ `unrecommended`: deprecated in favor of NIP-27 NIP-08 ====== diff --git a/README.md b/README.md index 6642e926..9390916a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh - [NIP-05: Mapping Nostr keys to DNS-based internet identifiers](05.md) - [NIP-06: Basic key derivation from mnemonic seed phrase](06.md) - [NIP-07: `window.nostr` capability for web browsers](07.md) -- [NIP-08: Handling Mentions](08.md) – `unrecommended`: discouraged in favor of [NIP-27](27.md) +- [NIP-08: Handling Mentions](08.md) – `unrecommended`: deprecated in favor of [NIP-27](27.md) - [NIP-09: Event Deletion](09.md) - [NIP-10: Conventions for clients' use of `e` and `p` tags in text events](10.md) - [NIP-11: Relay Information Document](11.md) From 2b926f54cdc6eb779de27510b1be20336c933ef9 Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Thu, 23 Mar 2023 10:11:18 -0300 Subject: [PATCH 5/6] Improve the text --- 27.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/27.md b/27.md index 26e29af8..235b4a59 100644 --- a/27.md +++ b/27.md @@ -6,13 +6,13 @@ Text Note References `draft` `optional` `author:fiatjaf` `author:scsibug` `author:arthurfranca` -This document standardizes the treatment given by clients of inline references of other events and pubkeys inside the content of `text notes` (currently kinds 1 and 30023). +This document standardizes the treatment given by clients of inline references of other events and profiles inside the content of `text notes` (currently kinds 1 and 30023). -Clients that want to allow inline mentions of profiles MUST show an autocomplete component or something analogous to that whenever the user starts typing a special key (for example, "@") or presses some button to include a mention etc -- or these clients can come up with other ways to unambiguously differentiate between mentions and normal text. +Once a mention is identified by a client, for example, when an user pastes a NIP-19 nostr profile string inside the event content input field (or optionally by any other means the client may wish to support, such as selecting an user from a context menu or autocompleter), the client MUST replace it with the notation `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg` as per NIP-21 before effectively creating the event. The client MAY add the corresponding pubkey to the `.tags` with the tag `p` if it wishes to notify mentioned user. -Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST replace its textual reference (inside `.content`) with the notation `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg` as per NIP-21. If client doesn't support NIP-21, it can instead use a regular http link to a nostr client such as `https://a-nostr-client.com/nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`. The client MAY add that pubkey to the `.tags` with the tag `p` if it wishes to notify mentioned user. - -The same process applies for referencing event IDs, except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. +The same process applies for referencing event IDs (using `nostr:nevent1...`), except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. Because `e` tags on `text notes` are usually considered ancestor events used to build a conversarion thread (as per NIP-10), it is advised to use inline references when mentioning events and NOT adding corresponding `e` tag to the `.tags` event key. -A client that receives a `text_note` event with such `nostr:...` mentions in its `.content` CAN do any desired context augmentation (for example, linking to the pubkey or showing a preview of the mentioned event contents) it wants in the process. +Note that the usage of `nostr:npub1...` for profile mentions or `nostr:note1...` for event mentions is discouraged due to their lack of embedded relay recommendation. + +A reader client that receives a `text_note` event with such `nostr:...` mentions in its `.content` CAN do any desired context augmentation (for example, linking to the profile or showing a preview of the mentioned event contents) it wants in the process. If turning such mentions into links, they could become internal links, NIP-21 links or direct links to web clients that will handle these references. From 45b1860b52025182d6400fd804a5d376a183ee40 Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Thu, 23 Mar 2023 19:37:10 -0300 Subject: [PATCH 6/6] Mention other nostr identifiers --- 27.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/27.md b/27.md index 235b4a59..f4e4629d 100644 --- a/27.md +++ b/27.md @@ -13,6 +13,8 @@ Once a mention is identified by a client, for example, when an user pastes a NIP The same process applies for referencing event IDs (using `nostr:nevent1...`), except that the client SHOULD NOT add the event id to the `.tags` with the tag `e` so to not negatively impact thread loading. Because `e` tags on `text notes` are usually considered ancestor events used to build a conversarion thread (as per NIP-10), it is advised to use inline references when mentioning events and NOT adding corresponding `e` tag to the `.tags` event key. +Other nostr identifiers should be referenced similarly using NIP-21 URLs inside event content (e.g. `nostr:naddr1...` for parameterized replaceable events). + Note that the usage of `nostr:npub1...` for profile mentions or `nostr:note1...` for event mentions is discouraged due to their lack of embedded relay recommendation. A reader client that receives a `text_note` event with such `nostr:...` mentions in its `.content` CAN do any desired context augmentation (for example, linking to the profile or showing a preview of the mentioned event contents) it wants in the process. If turning such mentions into links, they could become internal links, NIP-21 links or direct links to web clients that will handle these references.