nips/63.md

96 lines
2.6 KiB
Markdown
Raw Normal View History

2024-11-23 19:28:52 -05:00
NIP-63
2024-11-23 17:55:35 -05:00
======
Interactive Stories
-------------------
2024-11-23 17:55:35 -05:00
`draft` `optional`
This NIP introduces `kind:30296` and `kind:30297` as living notes designed to create interactive stories. These notes include `option` tags for navigating to subsequent notes, allowing readers to continue exploring the story. `Kind:30296` serves as starting events for the reader, while `kind:30297` represents individual scenes within the narrative.
2024-11-23 17:55:35 -05:00
The modularity of this approach allows Scenes from multiple authors to be combined into bigger stories.
2024-11-23 17:55:35 -05:00
### Prologue (kind:30296)
2024-11-25 16:34:15 -05:00
Prologue events are entry points in the story.
They SHOULD contain `title`, `summary` and `image` to help clients render a preview of the story.
2024-11-23 17:55:35 -05:00
`option` tags include a description for the action button, an address and the relay to find the next scene.
2024-11-23 17:55:35 -05:00
```jsonc
{
"kind": 30296,
2024-11-23 19:25:36 -05:00
"content": "<the beginning of the story>",
2024-11-23 17:55:35 -05:00
"tags": [
["d", "<unique identifier>"],
2024-11-25 16:34:15 -05:00
["title", "<short title for the prologue>"],
["summary", "<summary for preview>"],
["image", "<image url for preview>"],
2024-11-23 17:55:35 -05:00
["option", "<description>", "<kind:pubkey:d-tag>", "<relay_hint>"],
["option", "<description>", "<kind:pubkey:d-tag>", "<relay_hint>"],
2024-11-23 17:55:35 -05:00
// ...
]
}
```
### Scene (kind:30297)
2024-11-25 15:57:56 -05:00
Scenes describe a given point in a story with potential options and SHOULD include an optional `title` tag.
2024-11-25 16:34:15 -05:00
2024-11-23 19:25:36 -05:00
```jsonc
{
"kind": 30297,
2024-11-25 16:34:15 -05:00
"content": "<description of the scene>",
2024-11-23 19:25:36 -05:00
"tags": [
["d", "<unique identifier>"],
2024-11-25 16:34:15 -05:00
["title", "<short title for this scene>"],
2024-11-23 19:25:36 -05:00
["option", "<description>", "<kind:pubkey:d-tag>", "<relay_hint>"],
["option", "<description>", "<kind:pubkey:d-tag>", "<relay_hint>"],
2024-11-23 19:25:36 -05:00
// ...
]
}
```
2024-11-25 15:57:56 -05:00
The story concludes when no `option` tags are present.
2024-11-23 19:25:36 -05:00
The `.content` field does not accept markdown.
2024-11-25 16:34:15 -05:00
## Reading State
Kind `30298` stores the latest state of the story.
2024-11-25 16:34:15 -05:00
The `d` tag of the replaceable event MUST match the root event's id.
The `a` tag points to the latest scene the user has read.
2024-11-25 16:34:15 -05:00
```jsonc
{
"kind": 30298,
2024-11-25 16:34:15 -05:00
"tags": [
// d-tag defines the starting point so that if the user sees an interative post again, the client can find it.
["d", "<kind:pubkey:d-tag>"],
2024-11-25 16:34:15 -05:00
// cached to simplify preview purposes
["title", "<root_event_title>"],
["summary", "<root_event_summary>"],
["image", "<image url for preview>"],
// root with relay hint
["A", "<kind:pubkey:d-tag>", "<relay_hint>"],
2024-11-25 16:34:15 -05:00
// current scene with relay hint
["a", "<kind:pubkey:d-tag>", "<relay_hint>"],
2024-11-25 16:34:15 -05:00
// reading status
["status", "<new|reading|done>"]
]
}
```
## Replies
Replies to all kinds here should use [NIP-22](22.md).