upleb.uk

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

summaryrefslogtreecommitdiff
path: root/52.md
diff options
context:
space:
mode:
Diffstat (limited to '52.md')
-rw-r--r--52.md219
1 files changed, 219 insertions, 0 deletions
diff --git a/52.md b/52.md
new file mode 100644
index 0000000..f35d904
--- /dev/null
+++ b/52.md
@@ -0,0 +1,219 @@
1NIP-52
2======
3
4Calendar Events
5---------------
6
7`draft` `optional`
8
9This specification defines calendar events representing an occurrence at a specific moment or between moments. These calendar events are _parameterized replaceable_ and deletable per [NIP-09](09.md).
10
11Unlike the term `calendar event` specific to this NIP, the term `event` is used broadly in all the NIPs to describe any Nostr event. The distinction is being made here to discern between the two terms.
12
13## Calendar Events
14
15There are two types of calendar events represented by different kinds: date-based and time-based calendar events. Calendar events are not required to be part of a [calendar](#calendar).
16
17### Date-Based Calendar Event
18
19This kind of calendar event starts on a date and ends before a different date in the future. Its use is appropriate for all-day or multi-day events where time and time zone hold no significance. e.g., anniversary, public holidays, vacation days.
20
21#### Format
22
23The format uses a parameterized replaceable event kind `31922`.
24
25The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string.
26
27The list of tags are as follows:
28* `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event.
29* `title` (required) title of the calendar event
30* `start` (required) inclusive start date in ISO 8601 format (YYYY-MM-DD). Must be less than `end`, if it exists.
31* `end` (optional) exclusive end date in ISO 8601 format (YYYY-MM-DD). If omitted, the calendar event ends on the same date as `start`.
32* `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call
33* `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location
34* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
35* `t` (optional, repeated) hashtag to categorize calendar event
36* `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc.
37
38The following tags are deprecated:
39* `name` name of the calendar event. Use only if `title` is not available.
40
41```jsonc
42{
43 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
44 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
45 "created_at": <Unix timestamp in seconds>,
46 "kind": 31922,
47 "content": "<description of calendar event>",
48 "tags": [
49 ["d", "<UUID>"],
50
51 ["title", "<title of calendar event>"],
52
53 // Dates
54 ["start", "<YYYY-MM-DD>"],
55 ["end", "<YYYY-MM-DD>"],
56
57 // Location
58 ["location", "<location>"],
59 ["g", "<geohash>"],
60
61 // Participants
62 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
63 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
64
65 // Hashtags
66 ["t", "<tag>"],
67 ["t", "<tag>"],
68
69 // Reference links
70 ["r", "<url>"],
71 ["r", "<url>"]
72 ]
73}
74```
75
76### Time-Based Calendar Event
77
78This kind of calendar event spans between a start time and end time.
79
80#### Format
81
82The format uses a parameterized replaceable event kind `31923`.
83
84The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string.
85
86The list of tags are as follows:
87* `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event.
88* `title` (required) title of the calendar event
89* `start` (required) inclusive start Unix timestamp in seconds. Must be less than `end`, if it exists.
90* `end` (optional) exclusive end Unix timestamp in seconds. If omitted, the calendar event ends instantaneously.
91* `start_tzid` (optional) time zone of the start timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`
92* `end_tzid` (optional) time zone of the end timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`. If omitted and `start_tzid` is provided, the time zone of the end timestamp is the same as the start timestamp.
93* `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call
94* `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location
95* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
96* `t` (optional, repeated) hashtag to categorize calendar event
97* `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc.
98
99The following tags are deprecated:
100* `name` name of the calendar event. Use only if `title` is not available.
101
102```jsonc
103{
104 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
105 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
106 "created_at": <Unix timestamp in seconds>,
107 "kind": 31923,
108 "content": "<description of calendar event>",
109 "tags": [
110 ["d", "<UUID>"],
111
112 ["title", "<title of calendar event>"],
113
114 // Timestamps
115 ["start", "<Unix timestamp in seconds>"],
116 ["end", "<Unix timestamp in seconds>"],
117
118 ["start_tzid", "<IANA Time Zone Database identifier>"],
119 ["end_tzid", "<IANA Time Zone Database identifier>"],
120
121 // Location
122 ["location", "<location>"],
123 ["g", "<geohash>"],
124
125 // Participants
126 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
127 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
128
129 // Hashtags
130 ["t", "<tag>"],
131 ["t", "<tag>"],
132
133 // Reference links
134 ["r", "<url>"],
135 ["r", "<url>"]
136 ]
137}
138```
139
140## Calendar
141
142A calendar is a collection of calendar events, represented as a custom replaceable list event using kind `31924`. A user can have multiple calendars. One may create a calendar to segment calendar events for specific purposes. e.g., personal, work, travel, meetups, and conferences.
143
144### Format
145
146The `.content` of these events should be a detailed description of the calendar. It is required but can be an empty string.
147
148The format uses a custom replaceable list of kind `31924` with a list of tags as described below:
149* `d` (required) universally unique identifier. Generated by the client creating the calendar.
150* `title` (required) calendar title
151* `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to
152
153```json
154{
155 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
156 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
157 "created_at": <Unix timestamp in seconds>,
158 "kind": 31924,
159 "content": "<description of calendar>",
160 "tags": [
161 ["d", "<UUID>"],
162 ["title", "<calendar title>"],
163 ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"],
164 ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"]
165 ]
166}
167```
168
169## Calendar Event RSVP
170
171A calendar event RSVP is a response to a calendar event to indicate a user's attendance intention.
172
173If a calendar event tags a pubkey, that can be interpreted as the calendar event creator inviting that user to attend. Clients MAY choose to prompt the user to RSVP for the calendar event.
174
175Any user may RSVP, even if they were not tagged on the calendar event. Clients MAY choose to prompt the calendar event creator to invite the user who RSVP'd. Clients also MAY choose to ignore these RSVPs.
176
177This NIP is intentionally not defining who is authorized to attend a calendar event if the user who RSVP'd has not been tagged. It is up to the calendar event creator to determine the semantics.
178
179This NIP is also intentionally not defining what happens if a calendar event changes after an RSVP is submitted.
180
181### Format
182
183The format uses a parameterized replaceable event kind `31925`.
184
185The `.content` of these events is optional and should be a free-form note that adds more context to this calendar event response.
186
187The list of tags are as follows:
188* `a` (required) reference tag to kind `31922` or `31923` calendar event being responded to.
189* `d` (required) universally unique identifier. Generated by the client creating the calendar event RSVP.
190* `status` (required) `accepted`, `declined`, or `tentative`. Determines attendance status to the referenced calendar event.
191* `fb` (optional) `free` or `busy`. Determines if the user would be free or busy for the duration of the calendar event. This tag must be omitted or ignored if the `status` label is set to `declined`.
192
193```json
194{
195 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
196 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
197 "created_at": <Unix timestamp in seconds>,
198 "kind": 31925,
199 "content": "<note>",
200 "tags": [
201 ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"],
202 ["d", "<UUID>"],
203 ["status", "<accepted/declined/tentative>"],
204 ["fb", "<free/busy>"],
205 ]
206}
207```
208
209## Unsolved Limitations
210
211* No private events
212
213## Intentionally Unsupported Scenarios
214
215### Recurring Calendar Events
216
217Recurring calendar events come with a lot of complexity, making it difficult for software and humans to deal with. This complexity includes time zone differences between invitees, daylight savings, leap years, multiple calendar systems, one-off changes in schedule or other metadata, etc.
218
219This NIP intentionally omits support for recurring calendar events and pushes that complexity up to clients to manually implement if they desire. i.e., individual calendar events with duplicated metadata represent recurring calendar events.