upleb.uk

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

summaryrefslogtreecommitdiff
path: root/53.md
diff options
context:
space:
mode:
authorSemisol <45574030+Semisol@users.noreply.github.com>2023-11-19 01:45:41 +0100
committerGitHub <noreply@github.com>2023-11-19 01:45:41 +0100
commitda19c078ab892b578a5c35968443205c9e8ac27f (patch)
tree17a9f4f3105acdae234d3bc67e42571aed261fa2 /53.md
parent4d709d1804de45bab3739ce814d4b0c0b211c273 (diff)
parent5dcfe85306434f21ecb1e7a47edd92b2e3e64f9a (diff)
Merge branch 'master' into clarify-json-serialization
Diffstat (limited to '53.md')
-rw-r--r--53.md122
1 files changed, 122 insertions, 0 deletions
diff --git a/53.md b/53.md
new file mode 100644
index 0000000..d3cc0af
--- /dev/null
+++ b/53.md
@@ -0,0 +1,122 @@
1NIP-53
2======
3
4Live Activities
5---------------
6
7`draft` `optional`
8
9Service providers want to offer live activities to the Nostr network in such a way that participants can easily logged and queried by clients. This NIP describes a general framework to advertise the involvement of pubkeys in such live activities.
10
11## Concepts
12
13### Live Event
14
15A special event with `kind:30311` "Live Event" is defined as a _parameterized replaceable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity.
16
17For example:
18
19```json
20{
21 "kind": 30311,
22 "tags": [
23 ["d", "<unique identifier>"],
24 ["title", "<name of the event>"],
25 ["summary", "<description>"],
26 ["image", "<preview image url>"],
27 ["t", "hashtag"]
28 ["streaming", "<url>"],
29 ["recording", "<url>"], // used to place the edited video once the activity is over
30 ["starts", "<unix timestamp in seconds>"],
31 ["ends", "<unix timestamp in seconds>"],
32 ["status", "<planned, live, ended>"],
33 ["current_participants", "<number>"],
34 ["total_participants", "<number>"],
35 ["p", "91cf9..4e5ca", "wss://provider1.com/", "Host", "<proof>"],
36 ["p", "14aeb..8dad4", "wss://provider2.com/nostr", "Speaker"],
37 ["p", "612ae..e610f", "ws://provider3.com/ws", "Participant"],
38 ["relays", "wss://one.com", "wss://two.com", ...]
39 ],
40 "content": "",
41 ...
42}
43```
44
45A distinct `d` tag should be used for each activity. All other tags are optional.
46
47Providers SHOULD keep the participant list small (e.g. under 1000 users) and, when limits are reached, Providers SHOULD select which participants get named in the event. Clients should not expect a comprehensive list. Once the activity ends, the event can be deleted or updated to summarize the activity and provide async content (e.g. recording of the event).
48
49Clients are expected to subscribe to `kind:30311` events in general or for given follow lists and statuses. Clients MAY display participants' roles in activities as well as access points to join the activity.
50
51Live Activity management clients are expected to constantly update `kind:30311` during the event. Clients MAY choose to consider `status=live` events after 1hr without any update as `ended`. The `starts` and `ends` timestamp SHOULD be updated when the status changes to and from `live`
52
53The activity MUST be linked to using the [NIP-19](19.md) `naddr` code along with the `a` tag.
54
55### Proof of Agreement to Participate
56
57Event owners can add proof as the 5th term in each `p` tag to clarify the participant's agreement in joining the event. The proof is a signed SHA256 of the complete `a` Tag of the event (`kind:pubkey:dTag`) by each `p`'s private key, encoded in hex.
58
59Clients MAY only display participants if the proof is available or MAY display participants as "invited" if the proof is not available.
60
61This feature is important to avoid malicious event owners adding large account holders to the event, without their knowledge, to lure their followers into the malicious owner's trap.
62
63### Live Chat Message
64
65Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used.
66
67```json
68{
69 "kind": 1311,
70 "tags": [
71 ["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"],
72 ],
73 "content": "Zaps to live streams is beautiful.",
74 ...
75}
76```
77
78## Use Cases
79
80Common use cases include meeting rooms/workshops, watch-together activities, or event spaces, such as [live.snort.social](https://live.snort.social) and [nostrnests.com](https://nostrnests.com).
81
82## Example
83
84### Live Streaming
85
86```json
87{
88 "id": "57f28dbc264990e2c61e80a883862f7c114019804208b14da0bff81371e484d2",
89 "pubkey": "1597246ac22f7d1375041054f2a4986bd971d8d196d7997e48973263ac9879ec",
90 "created_at": 1687182672,
91 "kind": 30311,
92 "tags": [
93 ["d", "demo-cf-stream"],
94 ["title", "Adult Swim Metalocalypse"],
95 ["summary", "Live stream from IPTV-ORG collection"],
96 ["streaming", "https://adultswim-vodlive.cdn.turner.com/live/metalocalypse/stream.m3u8"],
97 ["starts", "1687182672"]
98 ["status", "live"],
99 ["t", "animation"],
100 ["t", "iptv"],
101 ["image", "https://i.imgur.com/CaKq6Mt.png"]
102 ],
103 "content": "",
104 "sig": "5bc7a60f5688effa5287244a24768cbe0dcd854436090abc3bef172f7f5db1410af4277508dbafc4f70a754a891c90ce3b966a7bc47e7c1eb71ff57640f3d389"
105}
106```
107
108### Live Streaming chat message
109
110```json
111{
112 "id": "97aa81798ee6c5637f7b21a411f89e10244e195aa91cb341bf49f718e36c8188",
113 "pubkey": "3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24",
114 "created_at": 1687286726,
115 "kind": 1311,
116 "tags": [
117 ["a", "30311:1597246ac22f7d1375041054f2a4986bd971d8d196d7997e48973263ac9879ec:demo-cf-stream", "", "root"]
118 ],
119 "content": "Zaps to live streams is beautiful.",
120 "sig": "997f62ddfc0827c121043074d50cfce7a528e978c575722748629a4137c45b75bdbc84170bedc723ef0a5a4c3daebf1fef2e93f5e2ddb98e5d685d022c30b622"
121}
122````