upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--25.md43
-rw-r--r--README.md2
2 files changed, 45 insertions, 0 deletions
diff --git a/25.md b/25.md
new file mode 100644
index 0000000..fa818db
--- /dev/null
+++ b/25.md
@@ -0,0 +1,43 @@
1
2NIP-25
3======
4
5Reactions
6---------
7
8`draft` `optional` `author:jb55`
9
10A reaction is a `kind 7` note that is used to react to `kind 1` text notes.
11
12The generic reaction, represented by an empty string, SHOULD be interpreted as
13a "like".
14
15The `content` MAY be an emoji, in this case it MAY be interpreted as a "like",
16or the client MAY display this emoji reaction on the post.
17
18Tags
19----
20
21The reaction event SHOULD include `e` and `p` tags from the note the user is
22reacting to. This allows users to be notified of reactions to posts they were
23mentioned in. Including the `e` tags enables clients to pull all the reactions
24associated with individual posts or all the posts in a thread.
25
26The last `e` tag MUST be the `id` of the note that is being reacted to.
27
28The last `p` tag MUST be the `pubkey` of the event being reacted to.
29
30Example code
31
32```swift
33func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
34 var tags: [[String]] = liked.tags.filter {
35 tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
36 }
37 tags.append(["e", liked.id])
38 tags.append(["p", liked.pubkey])
39 let ev = NostrEvent(content: "", pubkey: pubkey, kind: 7, tags: tags)
40 ev.calculate_id()
41 ev.sign(privkey: privkey)
42 return ev
43}
diff --git a/README.md b/README.md
index 446003e..acf8689 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
18- [NIP-14: Subject tag in text events.](14.md) 18- [NIP-14: Subject tag in text events.](14.md)
19- [NIP-15: End of Stored Events Notice](15.md) 19- [NIP-15: End of Stored Events Notice](15.md)
20- [NIP-16: Event Treatment](16.md) 20- [NIP-16: Event Treatment](16.md)
21- [NIP-25: Reactions](25.md)
21 22
22## Event Kinds 23## Event Kinds
23 24
@@ -29,6 +30,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
29| 3 | Contacts | 2 | 30| 3 | Contacts | 2 |
30| 4 | Encrypted Direct Messages | 4 | 31| 4 | Encrypted Direct Messages | 4 |
31| 5 | Event Deletion | 9 | 32| 5 | Event Deletion | 9 |
33| 7 | Reaction | 25 |
32 34
33Please update this list when proposing NIPs introducing new event kinds. 35Please update this list when proposing NIPs introducing new event kinds.
34 36