mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-08 16:18:50 +00:00
Compare commits
5 Commits
no-uuid
...
stream-ext
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2803560465 | ||
|
|
c1c6ccecf7 | ||
|
|
1c61ac29aa | ||
|
|
553c1c77c0 | ||
|
|
7555a93f90 |
7
51.md
7
51.md
@@ -60,6 +60,7 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti
|
||||
| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) |
|
||||
| Release artifact sets | 30063 | group of artifacts of a software release | `"e"` (kind:1063 [file metadata](94.md) events), `"a"` (software application event) |
|
||||
| App curation sets | 30267 | references to multiple software applications | `"a"` (software application event) |
|
||||
| Calendar | 31924 | a set of events categorized in any way | `"a"` (calendar event event) |
|
||||
| Starter packs | 39089 | a named set of profiles to be shared around with the goal of being followed together | `"p"` (pubkeys) |
|
||||
| Media starter packs | 39092 | same as above, but specific to multimedia (photos, short video) clients | `"p"` (pubkeys) |
|
||||
|
||||
@@ -103,9 +104,9 @@ Some clients have used these lists in the past, but they should work on transiti
|
||||
"kind": 30004,
|
||||
"tags": [
|
||||
["d", "jvdy9i4"],
|
||||
["name", "Yaks"],
|
||||
["picture", "https://cdn.britannica.com/40/188540-050-9AC748DE/Yak-Himalayas-Nepal.jpg"],
|
||||
["about", "The domestic yak, also known as the Tartary ox, grunting ox, or hairy cattle, is a species of long-haired domesticated cattle found throughout the Himalayan region of the Indian subcontinent, the Tibetan Plateau, Gilgit-Baltistan, Tajikistan and as far north as Mongolia and Siberia."],
|
||||
["title", "Yaks"],
|
||||
["image", "https://cdn.britannica.com/40/188540-050-9AC748DE/Yak-Himalayas-Nepal.jpg"],
|
||||
["description", "The domestic yak, also known as the Tartary ox, grunting ox, or hairy cattle, is a species of long-haired domesticated cattle found throughout the Himalayan region of the Indian subcontinent, the Tibetan Plateau, Gilgit-Baltistan, Tajikistan and as far north as Mongolia and Siberia."],
|
||||
["a", "30023:26dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:95ODQzw3ajNoZ8SyMDOzQ"],
|
||||
["a", "30023:54af95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:1-MYP8dAhramH9J5gJWKx"],
|
||||
["a", "30023:f8fe95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:D2Tbd38bGrFvU0bIbvSMt"],
|
||||
|
||||
129
52.md
129
52.md
@@ -12,23 +12,14 @@ Unlike the term `calendar event` specific to this NIP, the term `event` is used
|
||||
|
||||
## Calendar Events
|
||||
|
||||
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).
|
||||
There are two types of calendar events represented by different kinds: _date-based_ and _time-based_ calendar events.
|
||||
|
||||
### Date-Based Calendar Event
|
||||
These tags are common to both types of calendar events:
|
||||
|
||||
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.
|
||||
|
||||
#### Format
|
||||
|
||||
The format uses an _addressable event_ of `kind:31922`.
|
||||
|
||||
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:
|
||||
* `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event.
|
||||
* `d` (required) a short unique string identifier. Generated by the client creating the calendar event.
|
||||
* `title` (required) title of the calendar event
|
||||
* `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`.
|
||||
* `summary` (optional) brief description of the calendar event
|
||||
* `image` (optional) url of an image to use for the event
|
||||
* `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
|
||||
* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
|
||||
@@ -36,39 +27,49 @@ The list of tags are as follows:
|
||||
* `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc.
|
||||
|
||||
The following tags are deprecated:
|
||||
|
||||
* `name` name of the calendar event. Use only if `title` is not available.
|
||||
|
||||
```jsonc
|
||||
Calendar events are _not_ required to be part of a [calendar](#calendar).
|
||||
|
||||
### Date-Based Calendar Event
|
||||
|
||||
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.
|
||||
|
||||
It's an _addressable event_ of `kind:31922`.
|
||||
|
||||
The `.content` of these events SHOULD be a description of the calendar event.
|
||||
|
||||
Aside from the common tags, this also takes the following tags:
|
||||
|
||||
* `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`.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
{
|
||||
"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>,
|
||||
"created_at": <unix timestamp in seconds>,
|
||||
"kind": 31922,
|
||||
"content": "<description of calendar event>",
|
||||
"tags": [
|
||||
["d", "<UUID>"],
|
||||
["d", "<random-identifier>"],
|
||||
|
||||
["title", "<title of calendar event>"],
|
||||
|
||||
// Dates
|
||||
// dates
|
||||
["start", "<YYYY-MM-DD>"],
|
||||
["end", "<YYYY-MM-DD>"],
|
||||
|
||||
// Location
|
||||
// location
|
||||
["location", "<location>"],
|
||||
["g", "<geohash>"],
|
||||
|
||||
// Participants
|
||||
// participants
|
||||
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
|
||||
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
|
||||
|
||||
// Hashtags
|
||||
["t", "<tag>"],
|
||||
["t", "<tag>"],
|
||||
|
||||
// Reference links
|
||||
["r", "<url>"],
|
||||
["r", "<url>"]
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -77,97 +78,68 @@ The following tags are deprecated:
|
||||
|
||||
This kind of calendar event spans between a start time and end time.
|
||||
|
||||
#### Format
|
||||
It's an _addressable event_ of `kind:31923`.
|
||||
|
||||
The format uses an _addressable event_ kind `31923`.
|
||||
The `.content` of these events should be a description of the calendar event. It is required but can be an empty string.
|
||||
|
||||
The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string.
|
||||
Aside from the common tags, this also takes the following tags:
|
||||
|
||||
The list of tags are as follows:
|
||||
* `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event.
|
||||
* `title` (required) title of the calendar event
|
||||
* `start` (required) inclusive start Unix timestamp in seconds. Must be less than `end`, if it exists.
|
||||
* `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`
|
||||
* `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.
|
||||
* `summary` (optional) brief description of the calendar event
|
||||
* `image` (optional) url of an image to use for the event
|
||||
* `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
|
||||
* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
|
||||
* `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
|
||||
* `t` (optional, repeated) hashtag to categorize calendar event
|
||||
* `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc.
|
||||
|
||||
The following tags are deprecated:
|
||||
* `name` name of the calendar event. Use only if `title` is not available.
|
||||
|
||||
```jsonc
|
||||
```yaml
|
||||
{
|
||||
"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>,
|
||||
"created_at": <unix timestamp in seconds>,
|
||||
"kind": 31923,
|
||||
"content": "<description of calendar event>",
|
||||
"tags": [
|
||||
["d", "<UUID>"],
|
||||
["d", "<random-identifier>"],
|
||||
|
||||
["title", "<title of calendar event>"],
|
||||
["summary", "<brief description of the calendar event>"],
|
||||
["image", "<string with image URI>"],
|
||||
|
||||
// Timestamps
|
||||
["start", "<Unix timestamp in seconds>"],
|
||||
["end", "<Unix timestamp in seconds>"],
|
||||
// timestamps
|
||||
["start", "<unix timestamp in seconds>"],
|
||||
["end", "<unix timestamp in seconds>"],
|
||||
|
||||
["start_tzid", "<IANA Time Zone Database identifier>"],
|
||||
["end_tzid", "<IANA Time Zone Database identifier>"],
|
||||
|
||||
// Location
|
||||
// location
|
||||
["location", "<location>"],
|
||||
["g", "<geohash>"],
|
||||
|
||||
// Participants
|
||||
// participants
|
||||
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
|
||||
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
|
||||
|
||||
// Labels (example using com.cornychat namespace denoting the event as an audiospace)
|
||||
["L", "com.cornychat"],
|
||||
["l", "audiospace", "com.cornychat"],
|
||||
|
||||
// Hashtags
|
||||
["t", "<tag>"],
|
||||
["t", "<tag>"],
|
||||
|
||||
// Reference links
|
||||
["r", "<url>"],
|
||||
["r", "<url>"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Calendar
|
||||
|
||||
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.
|
||||
|
||||
### Format
|
||||
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.
|
||||
|
||||
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:
|
||||
* `d` (required) universally unique identifier. Generated by the client creating the calendar.
|
||||
* `title` (required) calendar title
|
||||
* `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to
|
||||
|
||||
```json
|
||||
```yaml
|
||||
{
|
||||
"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>,
|
||||
"created_at": <unix timestamp in seconds>,
|
||||
"kind": 31924,
|
||||
"content": "<description of calendar>",
|
||||
"tags": [
|
||||
["d", "<UUID>"],
|
||||
["d", "<random-identifier>"],
|
||||
["title", "<calendar title>"],
|
||||
["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>"]
|
||||
@@ -191,13 +163,12 @@ The RSVP MUST have an `a` tag of the event coordinates to the calendar event, an
|
||||
|
||||
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.
|
||||
|
||||
### Format
|
||||
|
||||
The format uses an _addressable event_ kind `31925`.
|
||||
The RSVP is an _addressable event_ of `kind:31925`.
|
||||
|
||||
The `.content` of these events is optional and should be a free-form note that adds more context to this calendar event response.
|
||||
|
||||
The list of tags are as follows:
|
||||
The list of tags is as follows:
|
||||
|
||||
* `a` (required) coordinates to a kind `31922` or `31923` calendar event being responded to.
|
||||
* `e` (optional) event id of a kind `31922` or `31923` calendar event being responded to.
|
||||
* `d` (required) universally unique identifier. Generated by the client creating the calendar event RSVP.
|
||||
@@ -205,17 +176,17 @@ The list of tags are as follows:
|
||||
* `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`.
|
||||
* `p` (optional) pubkey of the author of the calendar event being responded to.
|
||||
|
||||
```json
|
||||
```yaml
|
||||
{
|
||||
"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>,
|
||||
"created_at": <unix timestamp in seconds>,
|
||||
"kind": 31925,
|
||||
"content": "<note>",
|
||||
"tags": [
|
||||
["e", "<kind 31922 or 31923 event id", "<optional recommended relay URL>"]
|
||||
["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional recommended relay URL>"],
|
||||
["d", "<UUID>"],
|
||||
["d", "<random-identifier>"],
|
||||
["status", "<accepted/declined/tentative>"],
|
||||
["fb", "<free/busy>"],
|
||||
["p", "<hex pubkey of kind 31922 or 31923 event>", "<optional recommended relay URL>"]
|
||||
|
||||
73
53.md
73
53.md
@@ -84,6 +84,79 @@ Event `kind:1311` is live chat's channel message. Clients MUST include the `a` t
|
||||
|
||||
Hosts may choose to pin one or more live chat messages by updating the `pinned` tags in the live event kind `30311`.
|
||||
|
||||
### Stream Raids
|
||||
|
||||
Event `kind:1312` is a live stream raid (redirect viewers to another stream).
|
||||
|
||||
Clients MUST include two `a` tags, one marked as `from` and the other marked as `to` which redirects viewers to a new live stream.
|
||||
The `content` MAY contain a raid message.
|
||||
|
||||
Clients SHOULD automatically redirect viewers from one stream to another.
|
||||
This is a similar function used on Twitch also called raids.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 1312,
|
||||
"tags": [
|
||||
["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "from"],
|
||||
["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "to"],
|
||||
],
|
||||
"content": "Zap this epic streamer!",
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
### Stream Clips
|
||||
|
||||
Event `kind:1313` is a live stream clip.
|
||||
|
||||
A clip is a small video clip taken from the live stream used to highlight a specific memorable or entertaining part of the stream.
|
||||
|
||||
Clients MUST include one `a` tag which points to the live stream event which the clip was taken from.
|
||||
|
||||
Clients MUST include one `r` tag which is a URL pointing to the video clip file, preferably in MP4 format for maximum compatibility.
|
||||
|
||||
Clients MAY also include a message about the clip in the `title` tag.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 1313,
|
||||
"tags": [
|
||||
["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"],
|
||||
["r", "https://example.com/my-clip.mp4"],
|
||||
["title", "Streamer gets rekt by bot!"]
|
||||
],
|
||||
"content": "",
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
### Stream Timeout
|
||||
|
||||
Event `kind:1314` is a live chat moderation event that temporarily mutes a user from chatting.
|
||||
|
||||
Clients MUST include one or more `p` tags of the timed out users.
|
||||
|
||||
Clients MUST include a [NIP-40](./40.md) expiration timestamp which signals when the timeout will end.
|
||||
|
||||
Clients SHOULD enfore timeouts by disabling chat functions in their apps and not displaying any chat messages from the user during their timeout.
|
||||
|
||||
Clients SHOULD listen for timeout events published by the stream host.
|
||||
|
||||
Clients MAY include a reason for the timeout in the `content` field.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 1314,
|
||||
"tags": [
|
||||
["p", "<pubkey-of-muted-user>"],
|
||||
["expiration", "1747658333"]
|
||||
],
|
||||
"content": "Rude",
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
## Use Cases
|
||||
|
||||
Common use cases include meeting rooms/workshops, watch-together activities, or event spaces, such as [zap.stream](https://zap.stream).
|
||||
|
||||
@@ -150,7 +150,10 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `1063` | File Metadata | [94](94.md) |
|
||||
| `1068` | Poll | [88](88.md) |
|
||||
| `1111` | Comment | [22](22.md) |
|
||||
| `1311` | Live Chat Message | [53](53.md) |
|
||||
| `1311` | Live Stream Chat Message | [53](53.md) |
|
||||
| `1312` | Live Stream Raid | [53](53.md) |
|
||||
| `1313` | Live Stream Clip | [53](53.md) |
|
||||
| `1314` | Live Stream Timeout | [53](53.md) |
|
||||
| `1337` | Code Snippet | [C0](C0.md) |
|
||||
| `1617` | Patches | [34](34.md) |
|
||||
| `1621` | Issues | [34](34.md) |
|
||||
|
||||
Reference in New Issue
Block a user