mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 00:28:51 +00:00
Compare commits
1 Commits
mplorentz-
...
stories
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b5337d096 |
1
24.md
1
24.md
@@ -17,7 +17,6 @@ These are extra fields not specified in NIP-01 that may be present in the string
|
|||||||
- `website`: a web URL related in any way to the event author.
|
- `website`: a web URL related in any way to the event author.
|
||||||
- `banner`: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen.
|
- `banner`: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen.
|
||||||
- `bot`: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.
|
- `bot`: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.
|
||||||
- `birthday`: an object representing the author's birth date. The format is { "year": number, "month": number, "day": number }. Each field MAY be omitted.
|
|
||||||
|
|
||||||
### Deprecated fields
|
### Deprecated fields
|
||||||
|
|
||||||
|
|||||||
3
29.md
3
29.md
@@ -153,7 +153,6 @@ When this event is not found, clients may still connect to the group, but treat
|
|||||||
["name", "Pizza Lovers"],
|
["name", "Pizza Lovers"],
|
||||||
["picture", "https://pizza.com/pizza.png"],
|
["picture", "https://pizza.com/pizza.png"],
|
||||||
["about", "a group for people who love pizza"],
|
["about", "a group for people who love pizza"],
|
||||||
["guidelines", "Rule #1: No pineapple"]
|
|
||||||
["public"], // or ["private"]
|
["public"], // or ["private"]
|
||||||
["open"] // or ["closed"]
|
["open"] // or ["closed"]
|
||||||
]
|
]
|
||||||
@@ -161,7 +160,7 @@ When this event is not found, clients may still connect to the group, but treat
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`name`, `picture`, `about`, and `guidelines` are basic metadata for the group for display purposes. `public` signals the group can be _read_ by anyone, while `private` signals that only AUTHed users can read. `open` signals that anyone can request to join and the request will be automatically granted, while `closed` signals that members must be pre-approved or that requests to join will be manually handled.
|
`name`, `picture` and `about` are basic metadata for the group for display purposes. `public` signals the group can be _read_ by anyone, while `private` signals that only AUTHed users can read. `open` signals that anyone can request to join and the request will be automatically granted, while `closed` signals that members must be pre-approved or that requests to join will be manually handled.
|
||||||
|
|
||||||
- *group admins* (`kind:39001`) (optional)
|
- *group admins* (`kind:39001`) (optional)
|
||||||
|
|
||||||
|
|||||||
19
34.md
19
34.md
@@ -125,7 +125,24 @@ Issues may have a `subject` tag, which clients can utilize to display a header.
|
|||||||
|
|
||||||
## Replies
|
## Replies
|
||||||
|
|
||||||
Replies to either a `kind:1621` _issue_ or a `kind:1617` _patch_ event should follow [NIP-22 comment](22.md).
|
Replies are also Markdown text. The difference is that they MUST be issued as replies to either a `kind:1621` _issue_ or a `kind:1617` _patch_ event. The threading of replies and patches should follow NIP-10 rules.
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"kind": 1622,
|
||||||
|
"content": "<markdown text>",
|
||||||
|
"tags": [
|
||||||
|
["a", "30617:<base-repo-owner-pubkey>:<base-repo-id>", "<relay-url>"],
|
||||||
|
["e", "<issue-or-patch-id-hex>", "", "root"],
|
||||||
|
|
||||||
|
// other "e" and "p" tags should be applied here when necessary, following the threading rules of NIP-10
|
||||||
|
["p", "<patch-author-pubkey-hex>", "", "mention"],
|
||||||
|
["e", "<previous-reply-id-hex>", "", "reply"],
|
||||||
|
// rest of tags...
|
||||||
|
],
|
||||||
|
// other fields...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
|
|||||||
2
65.md
2
65.md
@@ -63,8 +63,6 @@ This NIP allows Clients to connect directly with the most up-to-date relay set f
|
|||||||
|
|
||||||
6. Clients SHOULD deduplicate connections by normalizing relay URIs according to [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-6).
|
6. Clients SHOULD deduplicate connections by normalizing relay URIs according to [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-6).
|
||||||
|
|
||||||
7. When publishing to a relay, clients SHOULD ensure the user's `kind 10002` is also available on that relay. Relays SHOULD accept and serve `kind 10002` notes for any pubkey whose notes they store. Relays MAY scrape the network for missing `kind 10002` events. The goal here is that for any note served from a relay the user can also request the author's relay selections as a way of bootstrapping further context discovery.
|
|
||||||
|
|
||||||
## Related articles
|
## Related articles
|
||||||
- [Outbox model](https://mikedilger.com/gossip-model/)
|
- [Outbox model](https://mikedilger.com/gossip-model/)
|
||||||
- [What is the Outbox Model?](https://habla.news/u/hodlbod@coracle.social/8YjqXm4SKY-TauwjOfLXS)
|
- [What is the Outbox Model?](https://habla.news/u/hodlbod@coracle.social/8YjqXm4SKY-TauwjOfLXS)
|
||||||
|
|||||||
83
73.md
83
73.md
@@ -13,32 +13,29 @@ There are certain established global content identifiers such as [Book ISBNs](ht
|
|||||||
|
|
||||||
## Supported IDs
|
## Supported IDs
|
||||||
|
|
||||||
| Type | `i` tag | `k` tag |
|
| Type | `i` tag | `k` tag |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| URLs | "`<URL, normalized, no fragment>`" | "web" |
|
| URLs | "`<URL, normalized, no fragment>`" | "web" |
|
||||||
| Books | "isbn:`<id, without hyphens>`" | "isbn" |
|
| Hashtags | "#`<topic, lowercase>`" | "#" |
|
||||||
| Geohashes | "geo:`<geohash, lowercase>`" | "geo" |
|
| Geohashes | "geo:`<geohash, lowercase>`" | "geo" |
|
||||||
| Movies | "isan:`<id, without version part>`" | "isan" |
|
| Books | "isbn:`<id, without hyphens>`" | "isbn" |
|
||||||
| Papers | "doi:`<id, lowercase>`" | "doi" |
|
| Podcast Feeds | "podcast:guid:`<guid>`" | "podcast:guid" |
|
||||||
| Hashtags | "#`<topic, lowercase>`" | "#" |
|
| Podcast Episodes | "podcast:item:guid:`<guid>`" | "podcast:item:guid" |
|
||||||
| Podcast Feeds | "podcast:guid:`<guid>`" | "podcast:guid" |
|
| Podcast Publishers | "podcast:publisher:guid:`<guid>`" | "podcast:publisher:guid" |
|
||||||
| Podcast Episodes | "podcast:item:guid:`<guid>`" | "podcast:item:guid" |
|
| Movies | "isan:`<id, without version part>`" | "isan" |
|
||||||
| Podcast Publishers | "podcast:publisher:guid:`<guid>`" | "podcast:publisher:guid" |
|
| Papers | "doi:`<id, lowercase>`" | "doi" |
|
||||||
| Blockchain Transaction | "`<blockchain>`:[`<chainId>`:]tx:`<txid, hex, lowercase>`" | "`<blockchain>`:tx" |
|
|
||||||
| Blockchain Address | "`<blockchain>`:[`<chainId>`:]address:`<address>`" | "`<blockchain>`:address" |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|
||||||
### Webpages
|
### Webpages
|
||||||
|
|
||||||
For the webpage "https://myblog.example.com/post/2012-03-27/hello-world" the "i" and "k" tags are:
|
For the webpage "https://myblog.example.com/post/2012-03-27/hello-world" the "i" and "k" tags are:
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
[
|
[
|
||||||
["i", "https://myblog.example.com/post/2012-03-27/hello-world"],
|
["i","https://myblog.example.com/post/2012-03-27/hello-world"],
|
||||||
["k", "web"]
|
["k", "web"]
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
@@ -61,62 +58,6 @@ Book ISBNs MUST be referenced _**without hyphens**_ as many book search APIs ret
|
|||||||
|
|
||||||
Movie ISANs SHOULD be referenced _**without the version part**_ as the versions / edits of movies are not relevant. More info on ISAN parts here - https://support.isan.org/hc/en-us/articles/360002783131-Records-relations-and-hierarchies-in-the-ISAN-Registry
|
Movie ISANs SHOULD be referenced _**without the version part**_ as the versions / edits of movies are not relevant. More info on ISAN parts here - https://support.isan.org/hc/en-us/articles/360002783131-Records-relations-and-hierarchies-in-the-ISAN-Registry
|
||||||
|
|
||||||
### Blockchain
|
|
||||||
|
|
||||||
`<blockchain>` can be any layer 1 chain (`bitcoin`, `ethereum`, `solana`, ...). If necessary (e.g. for ethereum), you can specify a `<chainId>`.
|
|
||||||
|
|
||||||
#### Bitcoin
|
|
||||||
|
|
||||||
```
|
|
||||||
bitcoin:address:<bech32, lowercase | base58, case sensitive>
|
|
||||||
bitcoin:tx:<txid, hex, lowercase>
|
|
||||||
```
|
|
||||||
|
|
||||||
E.g. https://blockstream.info/tx/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
[
|
|
||||||
["i", "bitcoin:tx:a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"],
|
|
||||||
["k", "bitcoin:tx"]
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
E.g. https://blockstream.info/address/1HQ3Go3ggs8pFnXuHVHRytPCq5fGG8Hbhx
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
[
|
|
||||||
["i", "bitcoin:address:1HQ3Go3ggs8pFnXuHVHRytPCq5fGG8Hbhx"],
|
|
||||||
["k", "bitcoin:address"]
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Ethereum (and other EVM chains)
|
|
||||||
|
|
||||||
```
|
|
||||||
ethereum:<chainId, integer>:tx:<txHash, hex, lowercase>
|
|
||||||
ethereum:<chainId, integer>:address:<hex, lowercase>
|
|
||||||
```
|
|
||||||
|
|
||||||
E.g. https://etherscan.io/address/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
[
|
|
||||||
["i", "ethereum:1:address:0xd8da6bf26964af9d7eed9e03e53415d37aa96045"],
|
|
||||||
["k", "ethereum:address"]
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
E.g. https://gnosisscan.io/tx/0x98f7812be496f97f80e2e98d66358d1fc733cf34176a8356d171ea7fbbe97ccd
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
[
|
|
||||||
["i", "ethereum:100:tx:0x98f7812be496f97f80e2e98d66358d1fc733cf34176a8356d171ea7fbbe97ccd"],
|
|
||||||
["k", "ethereum:tx"]
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Optional URL Hints
|
### Optional URL Hints
|
||||||
|
|||||||
201
83.md
Normal file
201
83.md
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
# NIP-83: Stories
|
||||||
|
|
||||||
|
`draft` `optional`
|
||||||
|
|
||||||
|
This NIP defines a standard for "stories" content.
|
||||||
|
|
||||||
|
## Abstract
|
||||||
|
|
||||||
|
Stories allow users to share, usually time-limited, visual content that can be enhanced with interactive elements called "stickers".
|
||||||
|
|
||||||
|
## Specification
|
||||||
|
|
||||||
|
### Event Structure
|
||||||
|
|
||||||
|
Stories are represented as events with kind `23`.
|
||||||
|
|
||||||
|
### Tags
|
||||||
|
|
||||||
|
- `dim`: MUST be present, this is the story canvas in the format `["dim", "<width>x<height>"]`, which defines the coordinate system for all stickers and elements.
|
||||||
|
- `imeta` tags as defined in NIP-92.
|
||||||
|
- `dur` duration of the story in seconds.
|
||||||
|
|
||||||
|
#### Sticker Tags
|
||||||
|
|
||||||
|
Stickers are interactive elements placed on the story. They use the format:
|
||||||
|
|
||||||
|
```
|
||||||
|
["sticker", "<type>", "value", "<x>,<y>", "<width>x<height>", "key1 value1", "key2 value2", ...]
|
||||||
|
```
|
||||||
|
|
||||||
|
Where:
|
||||||
|
|
||||||
|
- `<type>`: The sticker type (see below)
|
||||||
|
- `<value>`: The main value of the sticker.
|
||||||
|
- `<x>,<y>`: Position coordinates relative to the story canvas
|
||||||
|
- `<width>x<height>`: Dimensions of the sticker
|
||||||
|
- Additional key-value pairs with the key and value combined in a single element, separated by a space, like `imeta` tags.
|
||||||
|
|
||||||
|
##### Sticker Types
|
||||||
|
|
||||||
|
- `pubkey`: Mentions a user. Requires a `p` tag with the same index.
|
||||||
|
- `event`: Embeds a Nostr event. Requires an `e` tag with the same index.
|
||||||
|
- `prompt`: Requests user input with optional placeholder text.
|
||||||
|
- `text`: Renders text on the story. The text content is specified using a `"text <value>"` property.
|
||||||
|
- `countdown`: Displays a countdown timer to a specific Unix timestamp. The value should be a valid Unix timestamp in seconds.
|
||||||
|
|
||||||
|
### Styling Properties
|
||||||
|
|
||||||
|
Stickers can have additional properties:
|
||||||
|
|
||||||
|
- `style`: A named style identifier. Clients are encouraged to mimic common style implementations from other clients.
|
||||||
|
- `rot`: Rotation in degrees (0-360).
|
||||||
|
|
||||||
|
Additional properties may be defined by clients, with common practices expected to emerge over time.
|
||||||
|
|
||||||
|
## Design Considerations
|
||||||
|
|
||||||
|
This NIP intentionally avoids highly specific styling mechanisms (like CSS) to ensure compatibility across different platforms, device types, and technologies. Instead, it provides foundational positioning and sizing with named styles that clients can interpret according to their capabilities.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
A basic story with an image and a text sticker:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 23,
|
||||||
|
"content": "",
|
||||||
|
"tags": [
|
||||||
|
["dim", "1080x1920"],
|
||||||
|
[
|
||||||
|
"imeta",
|
||||||
|
"url",
|
||||||
|
"https://example.com/image.jpg",
|
||||||
|
"m",
|
||||||
|
"image/jpeg",
|
||||||
|
"blurhash",
|
||||||
|
"UBL_:rOpGG-;0g9FD%IA4oIpELxu"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"sticker",
|
||||||
|
"text",
|
||||||
|
"Hello Nostr!",
|
||||||
|
"540,960",
|
||||||
|
"600x200",
|
||||||
|
"style emphasis",
|
||||||
|
"rot 5"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
A story with a user mention:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 23,
|
||||||
|
"content": "",
|
||||||
|
"tags": [
|
||||||
|
["dim", "1080x1920"],
|
||||||
|
["expiration", "<timestampp>"],
|
||||||
|
["imeta", "url", "https://example.com/image.jpg", "m", "image/jpeg"],
|
||||||
|
["p", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"],
|
||||||
|
[
|
||||||
|
"sticker",
|
||||||
|
"pubkey",
|
||||||
|
"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52",
|
||||||
|
"540,960",
|
||||||
|
"300x300",
|
||||||
|
"style flou"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"a",
|
||||||
|
"30023:6260f29fa75c91aaa292f082e5e87b438d2ab4fdf96af398567b01802ee2fcd4:7b734cf9"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"sticker",
|
||||||
|
"event",
|
||||||
|
"30023:6260f29fa75c91aaa292f082e5e87b438d2ab4fdf96af398567b01802ee2fcd4:7b734cf9",
|
||||||
|
"540,960",
|
||||||
|
"300x300",
|
||||||
|
"style flou"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
A story with a countdown timer:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 23,
|
||||||
|
"content": "",
|
||||||
|
"tags": [
|
||||||
|
["expiration", "<timestamp>"],
|
||||||
|
["dim", "1080x1920"],
|
||||||
|
["imeta", "url", "https://example.com/event-image.jpg", "m", "image/jpeg"],
|
||||||
|
[
|
||||||
|
"sticker",
|
||||||
|
"countdown",
|
||||||
|
"1718486400",
|
||||||
|
"540,800",
|
||||||
|
"400x150",
|
||||||
|
"style emphasis",
|
||||||
|
"text Event starts in"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Client Behavior
|
||||||
|
|
||||||
|
Clients SHOULD respect the coordinate system defined by the `dim` tag. When displaying stories on screens with different aspect ratios, clients SHOULD maintain the relative positioning of all elements.
|
||||||
|
|
||||||
|
## Implementation Notes
|
||||||
|
|
||||||
|
- Stories are ephemeral by nature. Clients MAY choose to display stories for a limited time (typically 24 hours).
|
||||||
|
- For consistent rendering across platforms, measurements and coordinates SHOULD be treated as logical units rather than specific pixel values.
|
||||||
|
- Clients SHOULD make reasonable attempts to reproduce named styles consistently with other implementations.
|
||||||
|
|
||||||
|
## A note about `style`
|
||||||
|
|
||||||
|
Stickers use a very ambiguous `style` with just a name. Clients can interpret what the name represents in their users screens freely, but clients should strive for consistency and sane defaults. Styles can emerge in the wild and clients are
|
||||||
|
encouraged to work on supporting what their users want.
|
||||||
|
|
||||||
|
The reason to avoid providing precise definitions and styling attributes is because recoinciling different platforms, native, web would end up yielding something as complicated as CSS which would be an overkill and, just like CSS has shown, an ever-shifting goal post.
|
||||||
|
|
||||||
|
## Appendix 1: Sticker Type Examples
|
||||||
|
|
||||||
|
### Mentions
|
||||||
|
|
||||||
|
```
|
||||||
|
["sticker", "pubkey", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", "540,960", "300x300", "style default"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
An event to be embedded. Addressable events should use the `<kind>:<pubkey>:<d-tag>` format.
|
||||||
|
|
||||||
|
Additionally, event stickers should include the corresponding `a` and/or `e` tag to help find the event (relay hint, etc.).
|
||||||
|
|
||||||
|
```
|
||||||
|
["sticker", "event", "1a5f6849cef16334e1a73f289d457d54833769731c0631a39ca9631a6575e91d", "200,500", "400x200", "style card"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ask for a reply
|
||||||
|
|
||||||
|
```
|
||||||
|
["sticker", "prompt", "Ask me a question", "540,1200", "600x100", "style rounded"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Embed text
|
||||||
|
|
||||||
|
```
|
||||||
|
["sticker", "text", "Hello world!", "540,960", "500x150", "style bold", "rot 15"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Timer countdown
|
||||||
|
|
||||||
|
```
|
||||||
|
["sticker", "countdown", "1718486400", "540,700", "400x100", "text Event starts in"]
|
||||||
|
```
|
||||||
65
C0.md
65
C0.md
@@ -1,65 +0,0 @@
|
|||||||
# NIP-C0: Code Snippets
|
|
||||||
|
|
||||||
`draft` `optional`
|
|
||||||
|
|
||||||
## Abstract
|
|
||||||
|
|
||||||
This NIP defines a new event kind for sharing and storing code snippets. Unlike regular text notes (`kind:1`), code snippets have specialized metadata like language, extension, and other code-specific attributes that enhance discoverability, syntax highlighting, and improved user experience.
|
|
||||||
|
|
||||||
## Event Kind
|
|
||||||
|
|
||||||
This NIP defines `kind:1337` as a code snippet event.
|
|
||||||
|
|
||||||
The `.content` field contains the actual code snippet text.
|
|
||||||
|
|
||||||
## Optional Tags
|
|
||||||
|
|
||||||
- `l` - Programming language name (lowercase). Examples: "javascript", "python", "rust"
|
|
||||||
- `name` - Name of the code snippet, commonly a filename. Examples: "hello-world.js", "quick-sort.py"
|
|
||||||
- `extension` - File extension (without the dot). Examples: "js", "py", "rs"
|
|
||||||
- `description` - Brief description of what the code does
|
|
||||||
- `runtime` - Runtime or environment specification (e.g., "node v18.15.0", "python 3.11")
|
|
||||||
- `license` - License under which the code is shared (e.g., "MIT", "GPL-3.0", "Apache-2.0")
|
|
||||||
- `dep` - Dependency required for the code to run (can be repeated)
|
|
||||||
- `repo` - Reference to a repository where this code originates
|
|
||||||
|
|
||||||
## Format
|
|
||||||
|
|
||||||
```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": 1337,
|
|
||||||
"content": "function helloWorld() {\n console.log('Hello, Nostr!');\n}\n\nhelloWorld();",
|
|
||||||
"tags": [
|
|
||||||
["l", "javascript"],
|
|
||||||
["extension", "js"],
|
|
||||||
["name", "hello-world.js"],
|
|
||||||
["description", "A basic JavaScript function that prints 'Hello, Nostr!' to the console"],
|
|
||||||
["runtime", "node v18.15.0"],
|
|
||||||
["license", "MIT"],
|
|
||||||
["repo", "https://github.com/nostr-protocol/nostr"]
|
|
||||||
],
|
|
||||||
"sig": "<64-bytes signature of the id>"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Client Behavior
|
|
||||||
|
|
||||||
Clients that support this NIP SHOULD:
|
|
||||||
|
|
||||||
1. Display code snippets with proper syntax highlighting based on the language.
|
|
||||||
2. Allow copying the full code snippet with a single action.
|
|
||||||
3. Render the code with appropriate formatting, preserving whitespace and indentation.
|
|
||||||
4. Display the language and extension prominently.
|
|
||||||
5. Provide "run" functionality for supported languages when possible.
|
|
||||||
6. Display the description (if available) as part of the snippet presentation.
|
|
||||||
|
|
||||||
Clients MAY provide additional functionality such as:
|
|
||||||
|
|
||||||
1. Code editing capabilities
|
|
||||||
2. Forking/modifying snippets
|
|
||||||
3. Creating executable environments based on the runtime/dependencies
|
|
||||||
4. Downloading the snippet as a file using the provided extension
|
|
||||||
5. Sharing the snippet with attribution
|
|
||||||
17
README.md
17
README.md
@@ -100,7 +100,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
- [NIP-98: HTTP Auth](98.md)
|
- [NIP-98: HTTP Auth](98.md)
|
||||||
- [NIP-99: Classified Listings](99.md)
|
- [NIP-99: Classified Listings](99.md)
|
||||||
- [NIP-7D: Threads](7D.md)
|
- [NIP-7D: Threads](7D.md)
|
||||||
- [NIP-C0: Code Snippets](C0.md)
|
|
||||||
- [NIP-C7: Chats](C7.md)
|
- [NIP-C7: Chats](C7.md)
|
||||||
|
|
||||||
## Event Kinds
|
## Event Kinds
|
||||||
@@ -149,10 +148,9 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
| `1068` | Poll | [88](88.md) |
|
| `1068` | Poll | [88](88.md) |
|
||||||
| `1111` | Comment | [22](22.md) |
|
| `1111` | Comment | [22](22.md) |
|
||||||
| `1311` | Live Chat Message | [53](53.md) |
|
| `1311` | Live Chat Message | [53](53.md) |
|
||||||
| `1337` | Code Snippet | [C0](C0.md) |
|
|
||||||
| `1617` | Patches | [34](34.md) |
|
| `1617` | Patches | [34](34.md) |
|
||||||
| `1621` | Issues | [34](34.md) |
|
| `1621` | Issues | [34](34.md) |
|
||||||
| `1622` | Git Replies (deprecated) | [34](34.md) |
|
| `1622` | Replies | [34](34.md) |
|
||||||
| `1630`-`1633` | Status | [34](34.md) |
|
| `1630`-`1633` | Status | [34](34.md) |
|
||||||
| `1971` | Problem Tracker | [nostrocket][nostrocket] |
|
| `1971` | Problem Tracker | [nostrocket][nostrocket] |
|
||||||
| `1984` | Reporting | [56](56.md) |
|
| `1984` | Reporting | [56](56.md) |
|
||||||
@@ -300,7 +298,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
| `I` | root external identity | -- | [22](22.md) |
|
| `I` | root external identity | -- | [22](22.md) |
|
||||||
| `k` | kind | -- | [18](18.md), [25](25.md), [72](72.md), [73](73.md) |
|
| `k` | kind | -- | [18](18.md), [25](25.md), [72](72.md), [73](73.md) |
|
||||||
| `K` | root scope | -- | [22](22.md) |
|
| `K` | root scope | -- | [22](22.md) |
|
||||||
| `l` | label, label namespace, language name| -- | [32](32.md), [C0](C0.md) |
|
| `l` | label, label namespace | -- | [32](32.md) |
|
||||||
| `L` | label namespace | -- | [32](32.md) |
|
| `L` | label namespace | -- | [32](32.md) |
|
||||||
| `m` | MIME type | -- | [94](94.md) |
|
| `m` | MIME type | -- | [94](94.md) |
|
||||||
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md), [22](22.md) |
|
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md), [22](22.md) |
|
||||||
@@ -323,20 +321,17 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
| `clone` | git clone URL | -- | [34](34.md) |
|
| `clone` | git clone URL | -- | [34](34.md) |
|
||||||
| `content-warning` | reason | -- | [36](36.md) |
|
| `content-warning` | reason | -- | [36](36.md) |
|
||||||
| `delegation` | pubkey, conditions, delegation token | -- | [26](26.md) |
|
| `delegation` | pubkey, conditions, delegation token | -- | [26](26.md) |
|
||||||
| `dep` | Required dependency | -- | [C0](C0.md) |
|
| `description` | description | -- | [34](34.md), [57](57.md), [58](58.md) |
|
||||||
| `description` | description | -- | [34](34.md), [57](57.md), [58](58.md), [C0](C0.md) |
|
|
||||||
| `emoji` | shortcode, image URL | -- | [30](30.md) |
|
| `emoji` | shortcode, image URL | -- | [30](30.md) |
|
||||||
| `encrypted` | -- | -- | [90](90.md) |
|
| `encrypted` | -- | -- | [90](90.md) |
|
||||||
| `extension` | File extension | -- | [C0](C0.md) |
|
|
||||||
| `expiration` | unix timestamp (string) | -- | [40](40.md) |
|
| `expiration` | unix timestamp (string) | -- | [40](40.md) |
|
||||||
| `file` | full path (string) | -- | [35](35.md) |
|
| `file` | full path (string) | -- | [35](35.md) |
|
||||||
| `goal` | event id (hex) | relay URL | [75](75.md) |
|
| `goal` | event id (hex) | relay URL | [75](75.md) |
|
||||||
| `image` | image URL | dimensions in pixels | [23](23.md), [52](52.md), [58](58.md) |
|
| `image` | image URL | dimensions in pixels | [23](23.md), [52](52.md), [58](58.md) |
|
||||||
| `imeta` | inline metadata | -- | [92](92.md) |
|
| `imeta` | inline metadata | -- | [92](92.md) |
|
||||||
| `license` | License of the shared content | -- | [C0](C0.md) |
|
|
||||||
| `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) |
|
| `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) |
|
||||||
| `location` | location string | -- | [52](52.md), [99](99.md) |
|
| `location` | location string | -- | [52](52.md), [99](99.md) |
|
||||||
| `name` | name | -- | [34](34.md), [58](58.md), [72](72.md), [C0](C0.md) |
|
| `name` | name | -- | [34](34.md), [58](58.md), [72](72.md) |
|
||||||
| `nonce` | random | difficulty | [13](13.md) |
|
| `nonce` | random | difficulty | [13](13.md) |
|
||||||
| `preimage` | hash of `bolt11` invoice | -- | [57](57.md) |
|
| `preimage` | hash of `bolt11` invoice | -- | [57](57.md) |
|
||||||
| `price` | price | currency, frequency | [99](99.md) |
|
| `price` | price | currency, frequency | [99](99.md) |
|
||||||
@@ -344,8 +339,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
| `published_at` | unix timestamp (string) | -- | [23](23.md) |
|
| `published_at` | unix timestamp (string) | -- | [23](23.md) |
|
||||||
| `relay` | relay url | -- | [42](42.md), [17](17.md) |
|
| `relay` | relay url | -- | [42](42.md), [17](17.md) |
|
||||||
| `relays` | relay list | -- | [57](57.md) |
|
| `relays` | relay list | -- | [57](57.md) |
|
||||||
| `repo` | Reference to the origin repository | -- | [C0](C0.md) |
|
|
||||||
| `runtime` | Runtime or environment specification | -- | [C0](C0.md) |
|
|
||||||
| `server` | file storage server url | -- | [96](96.md) |
|
| `server` | file storage server url | -- | [96](96.md) |
|
||||||
| `subject` | subject | -- | [14](14.md), [17](17.md), [34](34.md) |
|
| `subject` | subject | -- | [14](14.md), [17](17.md), [34](34.md) |
|
||||||
| `summary` | summary | -- | [23](23.md), [52](52.md) |
|
| `summary` | summary | -- | [23](23.md), [52](52.md) |
|
||||||
@@ -391,4 +384,4 @@ All NIPs are public domain.
|
|||||||
|
|
||||||
<a align="center" href="https://github.com/nostr-protocol/nips/graphs/contributors">
|
<a align="center" href="https://github.com/nostr-protocol/nips/graphs/contributors">
|
||||||
<img src="https://contrib.rocks/image?repo=nostr-protocol/nips" />
|
<img src="https://contrib.rocks/image?repo=nostr-protocol/nips" />
|
||||||
</a>
|
</a>
|
||||||
Reference in New Issue
Block a user