mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 08:38:50 +00:00
Compare commits
2 Commits
alt-urls
...
communitie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bac93607f | ||
|
|
2f403e1e95 |
7
11.md
7
11.md
@@ -79,7 +79,6 @@ are rejected or fail immediately.
|
||||
"min_pow_difficulty": 30,
|
||||
"auth_required": true,
|
||||
"payment_required": true,
|
||||
"restricted_writes": true,
|
||||
"created_at_lower_limit": 31536000,
|
||||
"created_at_upper_limit": 3
|
||||
},
|
||||
@@ -125,12 +124,6 @@ Even if set to False, authentication may be required for specific actions.
|
||||
|
||||
- `payment_required`: this relay requires payment before a new connection may perform any action.
|
||||
|
||||
- `restricted_writes`: this relay requires some kind of condition to be fulfilled in order to
|
||||
accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`).
|
||||
This should only be set to `true` when users are expected to know the relay policy before trying
|
||||
to write to it -- like belonging to a special pubkey-based whitelist or writing only events of
|
||||
a specific niche kind or content. Normal anti-spam heuristics, for example, do not qualify.
|
||||
|
||||
- `created_at_lower_limit`: 'created_at' lower limit as defined in [NIP-22](22.md)
|
||||
|
||||
- `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md)
|
||||
|
||||
205
51.md
205
51.md
@@ -6,107 +6,148 @@ Lists
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines lists of things that users can create. Lists can contain references to anything, and these references can be **public** or **private**.
|
||||
A "list" event is defined as having a list of public and/or private tags. Public tags will be listed in the event `tags`. Private tags will be encrypted in the event `content`. Encryption for private tags will use [NIP-04 - Encrypted Direct Message](04.md) encryption, using the list author's private and public key for the shared secret. A distinct event kind should be used for each list type created.
|
||||
|
||||
Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted using the same scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and stored in the `.content`.
|
||||
If a list should only be defined once per user (like the "mute" list) the list is declared as a _replaceable event_. These lists may be referred to as "replaceable lists". Otherwise, the list is a _parameterized replaceable event_ and the list name will be used as the `d` tag. These lists may be referred to as "parameterized replaceable lists".
|
||||
|
||||
## Types of lists
|
||||
## Replaceable List Event Example
|
||||
|
||||
## Standard lists
|
||||
Lets say a user wants to create a 'Mute' list and has keys:
|
||||
```
|
||||
priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
|
||||
pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
|
||||
```
|
||||
The user wants to publicly include these users:
|
||||
|
||||
Standard lists use non-parameterized replaceable events, meaning users may only have a single list of each kind. They have special meaning and clients may rely on them to augment a user's profile or browsing experience.
|
||||
```json
|
||||
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
|
||||
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
|
||||
```
|
||||
and privately include these users (below is the JSON that would be encrypted and placed in the event content):
|
||||
|
||||
For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from.
|
||||
```json
|
||||
[
|
||||
["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
|
||||
["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
|
||||
]
|
||||
```
|
||||
|
||||
| name | kind | description | expected tag items |
|
||||
| --- | --- | --- | --- |
|
||||
| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags), `"word"` (lowercase string), `"e"` (threads) |
|
||||
| Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) |
|
||||
| Bookmarks | 10003 | uncategorized, "global" list of things a user wants to save | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r" (URLs)` |
|
||||
| Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) |
|
||||
| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) |
|
||||
| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) |
|
||||
| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) |
|
||||
| Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a" (kind:30015 interest set)` |
|
||||
| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) |
|
||||
|
||||
## Sets
|
||||
|
||||
Sets are lists with well-defined meaning that can enhance the functionality and the UI of clients that rely on them. Unlike standard lists, users are expected to have more than one set of each kind, therefore each of them must be assigned a different `"d"` identifier.
|
||||
|
||||
For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which relays they will publish an event or from which relays they will read the replies to an event; _curation sets_ can be used by apps to showcase curations made by others tagged to different topics.
|
||||
|
||||
Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tags that can be used to enhance their UI.
|
||||
|
||||
| name | kind | description | expected tag items |
|
||||
| --- | --- | --- | --- |
|
||||
| Follow sets | 30000 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) |
|
||||
| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during various operations | `"relay"` (relay URLs) |
|
||||
| Bookmark sets | 30003 | user-defined bookmarks categories , for when bookmarks must be in labeled separate groups | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r" (URLs)` |
|
||||
| Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) |
|
||||
| Interest sets | 30015 | interest topics represented by a bunch of "hashtags" | `"t"` (hashtags) |
|
||||
| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) |
|
||||
|
||||
## Deprecated standard lists
|
||||
|
||||
Some clients have used these lists in the past, but they should work on transitioning to the [standard formats](#standard-lists) above.
|
||||
|
||||
| kind | "d" tag | use instead |
|
||||
| --- | --- | --- |
|
||||
| 30000 | `"mute"` | kind 10000 _mute list_ |
|
||||
| 30001 | `"pin"` | kind 10001 _pin list_ |
|
||||
| 30001 | `"bookmark"` | kind 10003 _bookmarks list_ |
|
||||
| 30001 | `"communities"` | kind 10004 _communities list_ |
|
||||
|
||||
## Examples
|
||||
|
||||
### A _mute list_ with some public items and some encrypted items
|
||||
Then the user would create a 'Mute' list event like below:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "a92a316b75e44cfdc19986c634049158d4206fcc0b7b9c7ccbcdabe28beebcd0",
|
||||
"pubkey": "854043ae8f1f97430ca8c1f1a090bdde6488bd5115c7a45307a2a212750ae4cb",
|
||||
"created_at": 1699597889,
|
||||
"kind": 10000,
|
||||
"tags": [
|
||||
["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"],
|
||||
["p", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"]
|
||||
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
|
||||
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
|
||||
],
|
||||
"content": "TJob1dQrf2ndsmdbeGU+05HT5GMnBSx3fx8QdDY/g3NvCa7klfzgaQCmRZuo1d3WQjHDOjzSY1+MgTK5WjewFFumCcOZniWtOMSga9tJk1ky00tLoUUzyLnb1v9x95h/iT/KpkICJyAwUZ+LoJBUzLrK52wNTMt8M5jSLvCkRx8C0BmEwA/00pjOp4eRndy19H4WUUehhjfV2/VV/k4hMAjJ7Bb5Hp9xdmzmCLX9+64+MyeIQQjQAHPj8dkSsRahP7KS3MgMpjaF8nL48Bg5suZMxJayXGVp3BLtgRZx5z5nOk9xyrYk+71e2tnP9IDvSMkiSe76BcMct+m7kGVrRcavDI4n62goNNh25IpghT+a1OjjkpXt9me5wmaL7fxffV1pchdm+A7KJKIUU3kLC7QbUifF22EucRA9xiEyxETusNludBXN24O3llTbOy4vYFsq35BeZl4v1Cse7n2htZicVkItMz3wjzj1q1I1VqbnorNXFgllkRZn4/YXfTG/RMnoK/bDogRapOV+XToZ+IvsN0BqwKSUDx+ydKpci6htDRF2WDRkU+VQMqwM0CoLzy2H6A2cqyMMMD9SLRRzBg==?iv=S3rFeFr1gsYqmQA7bNnNTQ==",
|
||||
"sig": "1173822c53261f8cffe7efbf43ba4a97a9198b3e402c2a1df130f42a8985a2d0d3430f4de350db184141e45ca844ab4e5364ea80f11d720e36357e1853dba6ca"
|
||||
"content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
|
||||
...other fields
|
||||
}
|
||||
```
|
||||
|
||||
### A _curation set_ of articles and notes about yaks
|
||||
|
||||
## Parameterized Replaceable List Event Example
|
||||
|
||||
Lets say a user wants to create a 'Categorized People' list of `nostr` people and has keys:
|
||||
```
|
||||
{
|
||||
"id": "567b41fc9060c758c4216fe5f8d3df7c57daad7ae757fa4606f0c39d4dd220ef",
|
||||
"pubkey": "d6dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c",
|
||||
"created_at": 1695327657,
|
||||
"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."],
|
||||
["a", "30023:26dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:95ODQzw3ajNoZ8SyMDOzQ"],
|
||||
["a", "30023:54af95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:1-MYP8dAhramH9J5gJWKx"],
|
||||
["a", "30023:f8fe95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:D2Tbd38bGrFvU0bIbvSMt"],
|
||||
["e", "d78ba0d5dce22bfff9db0a9e996c9ef27e2c91051de0c4e1da340e0326b4941e"]
|
||||
],
|
||||
"content": "",
|
||||
"sig": "a9a4e2192eede77e6c9d24ddfab95ba3ff7c03fbd07ad011fff245abea431fb4d3787c2d04aad001cb039cb8de91d83ce30e9a94f82ac3c5a2372aa1294a96bd"
|
||||
}
|
||||
priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
|
||||
pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
|
||||
```
|
||||
The user wants to publicly include these users:
|
||||
|
||||
## Encryption process pseudocode
|
||||
```json
|
||||
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
|
||||
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
|
||||
```
|
||||
and privately include these users (below is the JSON that would be encrypted and placed in the event content):
|
||||
|
||||
```scala
|
||||
val private_items = [
|
||||
["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"],
|
||||
["a", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"],
|
||||
```json
|
||||
[
|
||||
["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
|
||||
["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
|
||||
]
|
||||
val base64blob = nip04.encrypt(json.encode_to_string(private_items))
|
||||
event.content = base64blob
|
||||
```
|
||||
|
||||
Then the user would create a 'Categorized People' list event like below:
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 30000,
|
||||
"tags": [
|
||||
["d", "nostr"],
|
||||
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
|
||||
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
|
||||
],
|
||||
"content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==",
|
||||
...other fields
|
||||
}
|
||||
```
|
||||
|
||||
Lets say a user wants to create a 'Categorized Bookmarks' list of `bookmarks` and has keys:
|
||||
```
|
||||
priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
|
||||
pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
|
||||
```
|
||||
The user wants to publicly include these bookmarks:
|
||||
|
||||
```json
|
||||
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"],
|
||||
["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"],
|
||||
["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"],
|
||||
```
|
||||
and privately include these bookmarks (below is the JSON that would be encrypted and placed in the event content):
|
||||
|
||||
```json
|
||||
[
|
||||
["r", "https://my-private.bookmark", "My private bookmark"],
|
||||
["a", "30001:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"],
|
||||
]
|
||||
```
|
||||
|
||||
Then the user would create a 'Categorized Bookmarks' list event like below:
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 30001,
|
||||
"tags": [
|
||||
["d", "bookmarks"],
|
||||
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"],
|
||||
["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"],
|
||||
["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"],
|
||||
],
|
||||
"content": "y3AyaLJfnmYr9x9Od9o4aYrmL9+Ynmsim5y2ONrU0urOTq+V81CyAthQ2mUOWE9xwGgrizhY7ILdQwWhy6FK0sA33GHtC0egUJw1zIdknPe7BZjznD570yk/8RXYgGyDKdexME+RMYykrnYFxq1+y/h00kmJg4u+Gpn+ZjmVhNYxl9b+TiBOAXG9UxnK/H0AmUqDpcldn6+j1/AiStwYZhD1UZ3jzDIk2qcCDy7MlGnYhSP+kNmG+2b0T/D1L0Z7?iv=PGJJfPE84gacAh7T0e6duQ==",
|
||||
...other fields
|
||||
}
|
||||
```
|
||||
|
||||
## List Event Kinds
|
||||
|
||||
| kind | list type |
|
||||
| ------ | ----------------------- |
|
||||
| 10000 | Mute |
|
||||
| 10001 | Pin |
|
||||
| 30000 | Categorized People |
|
||||
| 30001 | Categorized Bookmarks |
|
||||
| 30002 | Categorized Relay Sets |
|
||||
|
||||
|
||||
### Mute List
|
||||
|
||||
An event with kind `10000` is defined as a replaceable list event for listing content a user wants to mute. Any standardized tag can be included in a Mute List.
|
||||
|
||||
### Pin List
|
||||
|
||||
An event with kind `10001` is defined as a replaceable list event for listing content a user wants to pin. Any standardized tag can be included in a Pin List.
|
||||
|
||||
### Categorized People List
|
||||
|
||||
An event with kind `30000` is defined as a parameterized replaceable list event for categorizing people. The 'd' parameter for this event holds the category name of the list. The tags included in these lists MUST follow the format of kind 3 events as defined in [NIP-02 - Contact List and Petnames](02.md).
|
||||
|
||||
### Categorized Bookmarks List
|
||||
|
||||
An event of kind `30001` is defined as a parameterized replaceable list event for categorizing bookmarks. The 'd' parameter for this event holds the category name of the list. The bookmark lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). Any standardized tag can be included in a Categorized Bookmark List.
|
||||
|
||||
### Categorized Relay Set
|
||||
|
||||
An event of kind `30002` is defined as a parameterized replaceable list event for categorizing relays. The 'd' parameter for this event holds the category name of the list. The relays lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). These sets can be used by clients in order to determine which relays to query in different scenarios.
|
||||
|
||||
19
72.md
19
72.md
@@ -14,7 +14,6 @@ The goal of this NIP is to create moderator-approved public communities around a
|
||||
|
||||
```json
|
||||
{
|
||||
"created_at": <Unix timestamp in seconds>,
|
||||
"kind": 34550,
|
||||
"tags": [
|
||||
["d", "<community-d-identifier>"],
|
||||
@@ -40,11 +39,23 @@ The goal of this NIP is to create moderator-approved public communities around a
|
||||
|
||||
# New Post Request
|
||||
|
||||
Any Nostr event can be submitted to a community by anyone for approval. Clients MUST add the community's `a` tag to the new post event in order to be presented for the moderator's approval.
|
||||
A "post request" is an event that can be published by anyone with the intention to be displayed inside a community. Moderators will be notified of this request and decide about approving it or not. Only after approval these posts will be displayed inside the communities.
|
||||
|
||||
Event kinds defined in other NIPs can be supported inside communities, but here we defined kind translations for them such that they don't get confused with events published outside communities.
|
||||
|
||||
| Community-scoped Kind | Description | Original Kind | Original NIP |
|
||||
| --- | --- | --- | --- |
|
||||
| 11 | Community post | 1 | 1 |
|
||||
| 10500 | Community-scoped user metadata | 0 | 1 |
|
||||
| 10501 | Community-scoped follow list | 3 | 2 |
|
||||
| 4548 | Community file metadata | 1063 | 94 |
|
||||
| 30500 | Community long-form article | 23 | 23 |
|
||||
|
||||
So, for example, in order to publish a "text note" (`kind:1`) inside a community one must use the `kind:11` instead.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 1,
|
||||
"kind": 11,
|
||||
"tags": [
|
||||
["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
|
||||
],
|
||||
@@ -53,8 +64,6 @@ Any Nostr event can be submitted to a community by anyone for approval. Clients
|
||||
}
|
||||
```
|
||||
|
||||
Community management clients MAY filter all mentions to a given `kind:34550` event and request moderators to approve each submission. Moderators MAY delete his/her approval of a post at any time using event deletions (See [NIP-09](09.md)).
|
||||
|
||||
# Post Approval by moderators
|
||||
|
||||
The post-approval event MUST include `a` tags of the communities the moderator is posting into (one or more), the `e` tag of the post and `p` tag of the author of the post (for approval notifications). The event SHOULD also include the stringified `post request` event inside the `.content` ([NIP-18-style](18.md)) and a `k` tag with the original post's event kind to allow filtering of approved posts by kind.
|
||||
|
||||
57
93.md
57
93.md
@@ -1,57 +0,0 @@
|
||||
NIP-93
|
||||
======
|
||||
|
||||
Alternative URLs
|
||||
----------------
|
||||
|
||||
Whenever there is a URL linked to in an event, alternative versions of that same URL can be given as `alturl` tags in that same event. For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 1,
|
||||
"content": "I just painted this: https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
|
||||
"tags": [
|
||||
[
|
||||
"alturl",
|
||||
"https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
|
||||
"http://images5.fanpop.com/image/photos/31600000/The-Starry-Night-by-Vincent-van-Gogh-1889-fine-art-31674050-2560-2027.jpg",
|
||||
"https://www.paintingmania.com/arts/vincent-van-gogh/large/starry-night-6_2843.jpg?version=09.12.13"
|
||||
]
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
The second element in the tag is the original URL that is in the content, the remaining elements are alternative sources for the same content.
|
||||
|
||||
Alternative URLs do not have to contain exactly the same content, byte-for-byte.
|
||||
|
||||
## Fixing other people's events
|
||||
|
||||
When someone else publishes an event containing URLs, other people can reference it in an event that adds alternative URLs for them, thus preventing the original event from losing its meaning once its referenced URL becomes inaccessible.
|
||||
|
||||
For example, in response to an event
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076",
|
||||
"kind": 1,
|
||||
"content": "I just painted this: https://wallpapercave.com/wp/wp5960277.jpg",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Other people (or the same person) could publish events of kind `4001` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 4001,
|
||||
"tags": [
|
||||
["alt", "alternative image for event ad77..."],
|
||||
["e", "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076"],
|
||||
["alturl", "https://wallpapercave.com/wp/wp5960277.jpg", "https://wallpapercave.com/wp/wp5960312.jpg"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Then clients, when finding out that the original URL of the event is no longer available, could try to load an alternative from one of the `kind:4001` events that reference the original one. They should prioritize replacements from the original author and then use some kind of heuristics to prevent misleading replacements (only load `kind:4001` events from trustworthy friends or friends of the original author, for example).
|
||||
25
README.md
25
README.md
@@ -96,10 +96,9 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `1063` | File Metadata | [94](94.md) |
|
||||
| `1311` | Live Chat Message | [53](53.md) |
|
||||
| `1040` | OpenTimestamps | [03](03.md) |
|
||||
| `1971` | Problem Tracker | [nostrocket-1971][nostrocket-1971] |
|
||||
| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) |
|
||||
| `1984` | Reporting | [56](56.md) |
|
||||
| `1985` | Label | [32](32.md) |
|
||||
| `4001` | URL Alternative | [93](93.md) |
|
||||
| `4550` | Community Post Approval | [72](72.md) |
|
||||
| `5000`-`5999` | Job Request | [90](90.md) |
|
||||
| `6000`-`6999` | Job Result | [90](90.md) |
|
||||
@@ -108,31 +107,19 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `9734` | Zap Request | [57](57.md) |
|
||||
| `9735` | Zap | [57](57.md) |
|
||||
| `9802` | Highlights | [84](84.md) |
|
||||
| `10000` | Mute list | [51](51.md) |
|
||||
| `10001` | Pin list | [51](51.md) |
|
||||
| `10000` | Mute List | [51](51.md) |
|
||||
| `10001` | Pin List | [51](51.md) |
|
||||
| `10002` | Relay List Metadata | [65](65.md) |
|
||||
| `10003` | Bookmark list | [51](51.md) |
|
||||
| `10004` | Communities list | [51](51.md) |
|
||||
| `10005` | Public chats list | [51](51.md) |
|
||||
| `10006` | Blocked relays list | [51](51.md) |
|
||||
| `10007` | Search relays list | [51](51.md) |
|
||||
| `10015` | Interests list | [51](51.md) |
|
||||
| `10030` | User emoji list | [51](51.md) |
|
||||
| `13194` | Wallet Info | [47](47.md) |
|
||||
| `22242` | Client Authentication | [42](42.md) |
|
||||
| `23194` | Wallet Request | [47](47.md) |
|
||||
| `23195` | Wallet Response | [47](47.md) |
|
||||
| `24133` | Nostr Connect | [46](46.md) |
|
||||
| `27235` | HTTP Auth | [98](98.md) |
|
||||
| `30000` | Follow sets | [51](51.md) |
|
||||
| `30001` | Generic lists | [51](51.md) |
|
||||
| `30002` | Relay sets | [51](51.md) |
|
||||
| `30003` | Bookmark sets | [51](51.md) |
|
||||
| `30004` | Curation sets | [51](51.md) |
|
||||
| `30000` | Categorized People List | [51](51.md) |
|
||||
| `30001` | Categorized Bookmark List | [51](51.md) |
|
||||
| `30008` | Profile Badges | [58](58.md) |
|
||||
| `30009` | Badge Definition | [58](58.md) |
|
||||
| `30015` | Interest sets | [51](51.md) |
|
||||
| `30030` | Emoji sets | [51](51.md) |
|
||||
| `30017` | Create or update a stall | [15](15.md) |
|
||||
| `30018` | Create or update a product | [15](15.md) |
|
||||
| `30023` | Long-form Content | [23](23.md) |
|
||||
@@ -150,8 +137,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `31990` | Handler information | [89](89.md) |
|
||||
| `34550` | Community Definition | [72](72.md) |
|
||||
|
||||
[nostrocket-1971]: https://github.com/nostrocket/NIPS/blob/main/Problems.md
|
||||
|
||||
## Message types
|
||||
|
||||
### Client to Relay
|
||||
|
||||
Reference in New Issue
Block a user