diff options
Diffstat (limited to '52.md')
| -rw-r--r-- | 52.md | 144 |
1 files changed, 61 insertions, 83 deletions
| @@ -12,63 +12,71 @@ Unlike the term `calendar event` specific to this NIP, the term `event` is used | |||
| 12 | 12 | ||
| 13 | ## Calendar Events | 13 | ## Calendar Events |
| 14 | 14 | ||
| 15 | There 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). | 15 | There are two types of calendar events represented by different kinds: _date-based_ and _time-based_ calendar events. |
| 16 | 16 | ||
| 17 | ### Date-Based Calendar Event | 17 | These tags are common to both types of calendar events: |
| 18 | |||
| 19 | This 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 | |||
| 23 | The format uses an _addressable event_ of `kind:31922`. | ||
| 24 | |||
| 25 | The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string. | ||
| 26 | 18 | ||
| 27 | The list of tags are as follows: | 19 | * `d` (required) a short unique string identifier. Generated by the client creating the calendar event. |
| 28 | * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. | ||
| 29 | * `title` (required) title of the calendar event | 20 | * `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. | 21 | * `summary` (optional) brief description of the calendar event |
| 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`. | 22 | * `image` (optional) url of an image to use for the event |
| 32 | * `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call | 23 | * `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 | 24 | * `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 | 25 | * `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 | 26 | * `t` (optional, repeated) hashtag to categorize calendar event |
| 36 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. | 27 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. |
| 28 | * `a` (repeated) reference tag to kind `31924` calendar event requesting to be included in Calendar | ||
| 37 | 29 | ||
| 38 | The following tags are deprecated: | 30 | The following tags are deprecated: |
| 31 | |||
| 39 | * `name` name of the calendar event. Use only if `title` is not available. | 32 | * `name` name of the calendar event. Use only if `title` is not available. |
| 40 | 33 | ||
| 41 | ```jsonc | 34 | Calendar events are _not_ required to be part of a [calendar](#calendar). |
| 35 | |||
| 36 | ## Collaborative Calendar Event Requests | ||
| 37 | |||
| 38 | Calendar events can include an `a` tag referencing a calendar (kind 31924) to request addition to that calendar. When a calendar event includes such a reference, clients should interpret this as a request to add the event to the referenced calendar by referencing it with an `a` tag. | ||
| 39 | |||
| 40 | This enables collaborative calendar management where multiple users can contribute events to calendars they do not own, subject to the calendar owner's approval. | ||
| 41 | |||
| 42 | ### Date-Based Calendar Event | ||
| 43 | |||
| 44 | This 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. | ||
| 45 | |||
| 46 | It's an _addressable event_ of `kind:31922`. | ||
| 47 | |||
| 48 | The `.content` of these events SHOULD be a description of the calendar event. | ||
| 49 | |||
| 50 | Aside from the common tags, this also takes the following tags: | ||
| 51 | |||
| 52 | * `start` (required) inclusive start date in ISO 8601 format (YYYY-MM-DD). Must be less than `end`, if it exists. | ||
| 53 | * `end` (optional) exclusive end date in ISO 8601 format (YYYY-MM-DD). If omitted, the calendar event ends on the same date as `start`. | ||
| 54 | |||
| 55 | Example: | ||
| 56 | |||
| 57 | ```yaml | ||
| 42 | { | 58 | { |
| 43 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | 59 | "id": <32-bytes lowercase hex-encoded SHA-256 of the serialized event data>, |
| 44 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | 60 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, |
| 45 | "created_at": <Unix timestamp in seconds>, | 61 | "created_at": <unix timestamp in seconds>, |
| 46 | "kind": 31922, | 62 | "kind": 31922, |
| 47 | "content": "<description of calendar event>", | 63 | "content": "<description of calendar event>", |
| 48 | "tags": [ | 64 | "tags": [ |
| 49 | ["d", "<UUID>"], | 65 | ["d", "<random-identifier>"], |
| 50 | 66 | ||
| 51 | ["title", "<title of calendar event>"], | 67 | ["title", "<title of calendar event>"], |
| 52 | 68 | ||
| 53 | // Dates | 69 | // dates |
| 54 | ["start", "<YYYY-MM-DD>"], | 70 | ["start", "<YYYY-MM-DD>"], |
| 55 | ["end", "<YYYY-MM-DD>"], | 71 | ["end", "<YYYY-MM-DD>"], |
| 56 | 72 | ||
| 57 | // Location | 73 | // location |
| 58 | ["location", "<location>"], | 74 | ["location", "<location>"], |
| 59 | ["g", "<geohash>"], | 75 | ["g", "<geohash>"], |
| 60 | 76 | ||
| 61 | // Participants | 77 | // participants |
| 62 | ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"], | 78 | ["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>"], | 79 | ["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 | ] | 80 | ] |
| 73 | } | 81 | } |
| 74 | ``` | 82 | ``` |
| @@ -77,97 +85,72 @@ The following tags are deprecated: | |||
| 77 | 85 | ||
| 78 | This kind of calendar event spans between a start time and end time. | 86 | This kind of calendar event spans between a start time and end time. |
| 79 | 87 | ||
| 80 | #### Format | 88 | It's an _addressable event_ of `kind:31923`. |
| 81 | 89 | ||
| 82 | The format uses an _addressable event_ kind `31923`. | 90 | The `.content` of these events should be a description of the calendar event. It is required but can be an empty string. |
| 83 | 91 | ||
| 84 | The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string. | 92 | Aside from the common tags, this also takes the following tags: |
| 85 | 93 | ||
| 86 | The 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. | 94 | * `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. | 95 | * `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` | 96 | * `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. | 97 | * `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 | * `summary` (optional) brief description of the calendar event | 98 | * `D` (required) the day-granularity unix timestamp on which the event takes place, calculated as `floor(unix_seconds() / seconds_in_one_day)`. Multiple tags SHOULD be included to cover the event's timeframe. |
| 94 | * `image` (optional) url of an image to use for the event | ||
| 95 | * `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call | ||
| 96 | * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location | ||
| 97 | * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting | ||
| 98 | * `l` (optional, repeated) label to categorize calendar event. e.g. `audiospace` to denote a scheduled event from a live audio space implementation such as cornychat.com | ||
| 99 | * `t` (optional, repeated) hashtag to categorize calendar event | ||
| 100 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. | ||
| 101 | |||
| 102 | The following tags are deprecated: | ||
| 103 | * `name` name of the calendar event. Use only if `title` is not available. | ||
| 104 | 99 | ||
| 105 | ```jsonc | 100 | ```yaml |
| 106 | { | 101 | { |
| 107 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | 102 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, |
| 108 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | 103 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, |
| 109 | "created_at": <Unix timestamp in seconds>, | 104 | "created_at": <unix timestamp in seconds>, |
| 110 | "kind": 31923, | 105 | "kind": 31923, |
| 111 | "content": "<description of calendar event>", | 106 | "content": "<description of calendar event>", |
| 112 | "tags": [ | 107 | "tags": [ |
| 113 | ["d", "<UUID>"], | 108 | ["d", "<random-identifier>"], |
| 114 | 109 | ||
| 115 | ["title", "<title of calendar event>"], | 110 | ["title", "<title of calendar event>"], |
| 116 | ["summary", "<brief description of the calendar event>"], | 111 | ["summary", "<brief description of the calendar event>"], |
| 117 | ["image", "<string with image URI>"], | 112 | ["image", "<string with image URI>"], |
| 118 | 113 | ||
| 119 | // Timestamps | 114 | // timestamps |
| 120 | ["start", "<Unix timestamp in seconds>"], | 115 | ["start", "<unix timestamp in seconds>"], |
| 121 | ["end", "<Unix timestamp in seconds>"], | 116 | ["end", "<unix timestamp in seconds>"], |
| 117 | ["D", "82549"], | ||
| 122 | 118 | ||
| 123 | ["start_tzid", "<IANA Time Zone Database identifier>"], | 119 | ["start_tzid", "<IANA Time Zone Database identifier>"], |
| 124 | ["end_tzid", "<IANA Time Zone Database identifier>"], | 120 | ["end_tzid", "<IANA Time Zone Database identifier>"], |
| 125 | 121 | ||
| 126 | // Location | 122 | // location |
| 127 | ["location", "<location>"], | 123 | ["location", "<location>"], |
| 128 | ["g", "<geohash>"], | 124 | ["g", "<geohash>"], |
| 129 | 125 | ||
| 130 | // Participants | 126 | // participants |
| 131 | ["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>"], |
| 132 | ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"], | 128 | ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"], |
| 133 | |||
| 134 | // Labels (example using com.cornychat namespace denoting the event as an audiospace) | ||
| 135 | ["L", "com.cornychat"], | ||
| 136 | ["l", "audiospace", "com.cornychat"], | ||
| 137 | |||
| 138 | // Hashtags | ||
| 139 | ["t", "<tag>"], | ||
| 140 | ["t", "<tag>"], | ||
| 141 | |||
| 142 | // Reference links | ||
| 143 | ["r", "<url>"], | ||
| 144 | ["r", "<url>"] | ||
| 145 | ] | 129 | ] |
| 146 | } | 130 | } |
| 147 | ``` | 131 | ``` |
| 148 | 132 | ||
| 149 | ## Calendar | 133 | ## Calendar |
| 150 | 134 | ||
| 151 | A 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. | 135 | A calendar is a collection of calendar events, represented as a custom _addressable 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. |
| 152 | 136 | ||
| 153 | ### Format | 137 | Calendars can accept event requests from other users. When calendar events reference a calendar via an `a` tag, this represents a request for inclusion. |
| 154 | 138 | ||
| 155 | The `.content` of these events should be a detailed description of the calendar. It is required but can be an empty string. | 139 | The `.content` of these events should be a detailed description of the calendar. It is required but can be an empty string. |
| 156 | 140 | ||
| 157 | The format uses a custom replaceable list of kind `31924` with a list of tags as described below: | ||
| 158 | * `d` (required) universally unique identifier. Generated by the client creating the calendar. | 141 | * `d` (required) universally unique identifier. Generated by the client creating the calendar. |
| 159 | * `title` (required) calendar title | 142 | * `title` (required) calendar title |
| 160 | * `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to | 143 | * `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to |
| 161 | 144 | ||
| 162 | ```json | 145 | ```yaml |
| 163 | { | 146 | { |
| 164 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | 147 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, |
| 165 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | 148 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, |
| 166 | "created_at": <Unix timestamp in seconds>, | 149 | "created_at": <unix timestamp in seconds>, |
| 167 | "kind": 31924, | 150 | "kind": 31924, |
| 168 | "content": "<description of calendar>", | 151 | "content": "<description of calendar>", |
| 169 | "tags": [ | 152 | "tags": [ |
| 170 | ["d", "<UUID>"], | 153 | ["d", "<random-identifier>"], |
| 171 | ["title", "<calendar title>"], | 154 | ["title", "<calendar title>"], |
| 172 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"], | 155 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"], |
| 173 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"] | 156 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"] |
| @@ -191,13 +174,12 @@ The RSVP MUST have an `a` tag of the event coordinates to the calendar event, an | |||
| 191 | 174 | ||
| 192 | The RSVP MAY tag the author of the calendar event it is in response to using a `p` tag so that clients can easily query all RSVPs that pertain to the author. | 175 | The RSVP MAY tag the author of the calendar event it is in response to using a `p` tag so that clients can easily query all RSVPs that pertain to the author. |
| 193 | 176 | ||
| 194 | ### Format | 177 | The RSVP is an _addressable event_ of `kind:31925`. |
| 195 | |||
| 196 | The format uses an _addressable event_ kind `31925`. | ||
| 197 | 178 | ||
| 198 | The `.content` of these events is optional and should be a free-form note that adds more context to this calendar event response. | 179 | The `.content` of these events is optional and should be a free-form note that adds more context to this calendar event response. |
| 199 | 180 | ||
| 200 | The list of tags are as follows: | 181 | The list of tags is as follows: |
| 182 | |||
| 201 | * `a` (required) coordinates to a kind `31922` or `31923` calendar event being responded to. | 183 | * `a` (required) coordinates to a kind `31922` or `31923` calendar event being responded to. |
| 202 | * `e` (optional) event id of a kind `31922` or `31923` calendar event being responded to. | 184 | * `e` (optional) event id of a kind `31922` or `31923` calendar event being responded to. |
| 203 | * `d` (required) universally unique identifier. Generated by the client creating the calendar event RSVP. | 185 | * `d` (required) universally unique identifier. Generated by the client creating the calendar event RSVP. |
| @@ -205,17 +187,17 @@ The list of tags are as follows: | |||
| 205 | * `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`. | 187 | * `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`. |
| 206 | * `p` (optional) pubkey of the author of the calendar event being responded to. | 188 | * `p` (optional) pubkey of the author of the calendar event being responded to. |
| 207 | 189 | ||
| 208 | ```json | 190 | ```yaml |
| 209 | { | 191 | { |
| 210 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | 192 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, |
| 211 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | 193 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, |
| 212 | "created_at": <Unix timestamp in seconds>, | 194 | "created_at": <unix timestamp in seconds>, |
| 213 | "kind": 31925, | 195 | "kind": 31925, |
| 214 | "content": "<note>", | 196 | "content": "<note>", |
| 215 | "tags": [ | 197 | "tags": [ |
| 216 | ["e", "<kind 31922 or 31923 event id", "<optional recommended relay URL>"] | 198 | ["e", "<kind 31922 or 31923 event id", "<optional recommended relay URL>"] |
| 217 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional recommended relay URL>"], | 199 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional recommended relay URL>"], |
| 218 | ["d", "<UUID>"], | 200 | ["d", "<random-identifier>"], |
| 219 | ["status", "<accepted/declined/tentative>"], | 201 | ["status", "<accepted/declined/tentative>"], |
| 220 | ["fb", "<free/busy>"], | 202 | ["fb", "<free/busy>"], |
| 221 | ["p", "<hex pubkey of kind 31922 or 31923 event>", "<optional recommended relay URL>"] | 203 | ["p", "<hex pubkey of kind 31922 or 31923 event>", "<optional recommended relay URL>"] |
| @@ -223,10 +205,6 @@ The list of tags are as follows: | |||
| 223 | } | 205 | } |
| 224 | ``` | 206 | ``` |
| 225 | 207 | ||
| 226 | ## Unsolved Limitations | ||
| 227 | |||
| 228 | * No private events | ||
| 229 | |||
| 230 | ## Intentionally Unsupported Scenarios | 208 | ## Intentionally Unsupported Scenarios |
| 231 | 209 | ||
| 232 | ### Recurring Calendar Events | 210 | ### Recurring Calendar Events |