Amend NIP-52 to require the content field to be provided, and decouple calendar identifier from calendar name

This commit is contained in:
Terry Yiu 2023-12-03 10:29:59 +00:00
parent ef106eccca
commit b8308a9a04
No known key found for this signature in database
GPG Key ID: 108645AE8A19B71A

20
52.md
View File

@ -22,14 +22,14 @@ This kind of calendar event starts on a date and ends before a different date in
The format uses a parameterized replaceable event kind `31922`. The format uses a parameterized replaceable event kind `31922`.
The `.content` of these events is optional and should be a detailed description of the calendar event. The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string.
The list of tags are as follows: The list of tags are as follows:
* `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event.
* `name` (required) name of the calendar event * `name` (required) name of the calendar event
* `start` (required) inclusive start date in ISO 8601 format (YYYY-MM-DD). Must be less than `end`, if it exists. * `start` (required) inclusive start date in ISO 8601 format (YYYY-MM-DD). Must be less than `end`, if it exists.
* `end` (optional) exclusive end date in ISO 8601 format (YYYY-MM-DD). If omitted, the calendar event ends on the same date as `start`. * `end` (optional) exclusive end date in ISO 8601 format (YYYY-MM-DD). If omitted, the calendar event ends on the same date as `start`.
* `location` (optional) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call * `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call
* `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location
* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
* `t` (optional, repeated) hashtag to categorize calendar event * `t` (optional, repeated) hashtag to categorize calendar event
@ -78,7 +78,7 @@ This kind of calendar event spans between a start time and end time.
The format uses a parameterized replaceable event kind `31923`. The format uses a parameterized replaceable event kind `31923`.
The `.content` of these events is optional and should be a detailed description of the calendar event. The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string.
The list of tags are as follows: The list of tags are as follows:
* `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event.
@ -87,7 +87,7 @@ The list of tags are as follows:
* `end` (optional) exclusive end Unix timestamp in seconds. If omitted, the calendar event ends instantaneously. * `end` (optional) exclusive end Unix timestamp in seconds. If omitted, the calendar event ends instantaneously.
* `start_tzid` (optional) time zone of the start timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica` * `start_tzid` (optional) time zone of the start timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`
* `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. * `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.
* `location` (optional) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call * `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call
* `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location
* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
* `t` (optional, repeated) hashtag to categorize calendar event * `t` (optional, repeated) hashtag to categorize calendar event
@ -137,15 +137,23 @@ A calendar is a collection of calendar events, represented as a custom replaceab
### Format ### Format
The `.content` of these events should be a detailed description of the calendar. It is required but can be an empty string.
The format uses a custom replaceable list of kind `31924` with a list of tags as described below: The format uses a custom replaceable list of kind `31924` with a list of tags as described below:
* `d` (required) calendar name * `d` (required) universally unique identifier. Generated by the client creating the calendar.
* `name` (required) calendar name
* `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to * `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to
```json ```json
{ {
"id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
"created_at": <Unix timestamp in seconds>,
"kind": 31924, "kind": 31924,
"content": "<description of calendar>",
"tags": [ "tags": [
["d", "<calendar name>"], ["d", "<UUID>"],
["name", "<calendar name>"],
["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"], ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"],
["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"] ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"]
] ]