upleb.uk

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

summaryrefslogtreecommitdiff
path: root/08.md
diff options
context:
space:
mode:
authorfiatjaf <faitjaf@gmail.com>2022-05-01 07:48:57 -0300
committerfiatjaf <faitjaf@gmail.com>2022-05-01 07:48:57 -0300
commitf25c7e672c23ca5463fa5c0fcb5e5f424d956862 (patch)
tree597462ec02ed56ef53f268279a31f62edd3f37eb /08.md
migrate nips from main nostr repo.
Diffstat (limited to '08.md')
-rw-r--r--08.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/08.md b/08.md
new file mode 100644
index 0000000..99100c9
--- /dev/null
+++ b/08.md
@@ -0,0 +1,17 @@
1NIP-08
2======
3
4Handling Mentions
5-----------------
6
7`draft` `optional` `author:fiatjaf` `author:scsibug`
8
9This document standardizes the treatment given by clients of inline mentions of other events and pubkeys inside the content of `text_note`s.
10
11Clients that want to allow tagged 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.
12
13Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST add that pubkey to the `.tags` with the tag `p`, then replace its textual reference (inside `.content`) with the notation `#[index]` in which "index" is equal to the 0-based index of the related tag in the tags array.
14
15The same process applies for mentioning event IDs.
16
17A client that receives a `text_note` event with such `#[index]` mentions in its `.content` CAN do a search-and-replace using the actual contents from the `.tags` array with the actual pubkey or event ID that is mentioned, doing any desired context augmentation (for example, linking to the pubkey or showing a preview of the mentioned event contents) it wants in the process.