mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
Merge branch 'nostr-protocol:master' into external-content-ids
This commit is contained in:
commit
29eec055c2
10
01.md
10
01.md
|
@ -87,12 +87,12 @@ As a convention, all single-letter (only english alphabet letters: a-z, A-Z) key
|
||||||
|
|
||||||
Kinds specify how clients should interpret the meaning of each event and the other fields of each event (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002). Each NIP may define the meaning of a set of kinds that weren't defined elsewhere. This NIP defines two basic kinds:
|
Kinds specify how clients should interpret the meaning of each event and the other fields of each event (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002). Each NIP may define the meaning of a set of kinds that weren't defined elsewhere. This NIP defines two basic kinds:
|
||||||
|
|
||||||
- `0`: **metadata**: the `content` is set to a stringified JSON object `{name: <username>, about: <string>, picture: <url, string>}` describing the user who created the event. [Extra metadata fields](24.md#kind-0) may be set. A relay may delete older events once it gets a new one for the same pubkey.
|
- `0`: **user metadata**: the `content` is set to a stringified JSON object `{name: <username>, about: <string>, picture: <url, string>}` describing the user who created the event. [Extra metadata fields](24.md#kind-0) may be set. A relay may delete older events once it gets a new one for the same pubkey.
|
||||||
- `1`: **text note**: the `content` is set to the **plaintext** content of a note (anything the user wants to say). Content that must be parsed, such as Markdown and HTML, should not be used. Clients should also not parse content as those.
|
- `1`: **text note**: the `content` is set to the **plaintext** content of a note (anything the user wants to say). Content that must be parsed, such as Markdown and HTML, should not be used. Clients should also not parse content as those.
|
||||||
|
|
||||||
And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation:
|
And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation:
|
||||||
|
|
||||||
- for kind `n` such that `1000 <= n < 10000`, events are **regular**, which means they're all expected to be stored by relays.
|
- for kind `n` such that `1000 <= n < 10000 || 4 <= n < 45 || n == 1 || n == 2`, events are **regular**, which means they're all expected to be stored by relays.
|
||||||
- for kind `n` such that `10000 <= n < 20000 || n == 0 || n == 3`, events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event MUST be stored by relays, older versions MAY be discarded.
|
- for kind `n` such that `10000 <= n < 20000 || n == 0 || n == 3`, events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event MUST be stored by relays, older versions MAY be discarded.
|
||||||
- for kind `n` such that `20000 <= n < 30000`, events are **ephemeral**, which means they are not expected to be stored by relays.
|
- for kind `n` such that `20000 <= n < 30000`, events are **ephemeral**, which means they are not expected to be stored by relays.
|
||||||
- for kind `n` such that `30000 <= n < 40000`, events are **parameterized replaceable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag's first value, only the latest event MUST be stored by relays, older versions MAY be discarded.
|
- for kind `n` such that `30000 <= n < 40000`, events are **parameterized replaceable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag's first value, only the latest event MUST be stored by relays, older versions MAY be discarded.
|
||||||
|
@ -125,8 +125,8 @@ Clients can send 3 types of messages, which must be JSON arrays, according to th
|
||||||
"authors": <a list of lowercase pubkeys, the pubkey of an event must be one of these>,
|
"authors": <a list of lowercase pubkeys, the pubkey of an event must be one of these>,
|
||||||
"kinds": <a list of a kind numbers>,
|
"kinds": <a list of a kind numbers>,
|
||||||
"#<single-letter (a-zA-Z)>": <a list of tag values, for #e — a list of event ids, for #p — a list of pubkeys, etc.>,
|
"#<single-letter (a-zA-Z)>": <a list of tag values, for #e — a list of event ids, for #p — a list of pubkeys, etc.>,
|
||||||
"since": <an integer unix timestamp in seconds, events must be newer than this to pass>,
|
"since": <an integer unix timestamp in seconds. Events must have a created_at >= to this to pass>,
|
||||||
"until": <an integer unix timestamp in seconds, events must be older than this to pass>,
|
"until": <an integer unix timestamp in seconds. Events must have a created_at <= to this to pass>,
|
||||||
"limit": <maximum number of events relays SHOULD return in the initial query>
|
"limit": <maximum number of events relays SHOULD return in the initial query>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -143,7 +143,7 @@ All conditions of a filter that are specified must match for an event for it to
|
||||||
|
|
||||||
A `REQ` message may contain multiple filters. In this case, events that match any of the filters are to be returned, i.e., multiple filters are to be interpreted as `||` conditions.
|
A `REQ` message may contain multiple filters. In this case, events that match any of the filters are to be returned, i.e., multiple filters are to be interpreted as `||` conditions.
|
||||||
|
|
||||||
The `limit` property of a filter is only valid for the initial query and MUST be ignored afterwards. When `limit: n` is present it is assumed that the events returned in the initial query will be the last `n` events ordered by the `created_at`. It is safe to return less events than `limit` specifies, but it is expected that relays do not return (much) more events than requested so clients don't get unnecessarily overwhelmed by data.
|
The `limit` property of a filter is only valid for the initial query and MUST be ignored afterwards. When `limit: n` is present it is assumed that the events returned in the initial query will be the last `n` events ordered by the `created_at`. Newer events should appear first, and in the case of ties the event with the lowest id (first in lexical order) should be first. It is safe to return less events than `limit` specifies, but it is expected that relays do not return (much) more events than requested so clients don't get unnecessarily overwhelmed by data.
|
||||||
|
|
||||||
### From relay to client: sending events and notices
|
### From relay to client: sending events and notices
|
||||||
|
|
||||||
|
|
4
05.md
4
05.md
|
@ -6,11 +6,11 @@ Mapping Nostr keys to DNS-based internet identifiers
|
||||||
|
|
||||||
`final` `optional`
|
`final` `optional`
|
||||||
|
|
||||||
On events of kind `0` (`metadata`) one can specify the key `"nip05"` with an [internet identifier](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) (an email-like address) as the value. Although there is a link to a very liberal "internet identifier" specification above, NIP-05 assumes the `<local-part>` part will be restricted to the characters `a-z0-9-_.`, case-insensitive.
|
On events of kind `0` (`user metadata`) one can specify the key `"nip05"` with an [internet identifier](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) (an email-like address) as the value. Although there is a link to a very liberal "internet identifier" specification above, NIP-05 assumes the `<local-part>` part will be restricted to the characters `a-z0-9-_.`, case-insensitive.
|
||||||
|
|
||||||
Upon seeing that, the client splits the identifier into `<local-part>` and `<domain>` and use these values to make a GET request to `https://<domain>/.well-known/nostr.json?name=<local-part>`.
|
Upon seeing that, the client splits the identifier into `<local-part>` and `<domain>` and use these values to make a GET request to `https://<domain>/.well-known/nostr.json?name=<local-part>`.
|
||||||
|
|
||||||
The result should be a JSON document object with a key `"names"` that should then be a mapping of names to hex formatted public keys. If the public key for the given `<name>` matches the `pubkey` from the `metadata` event, the client then concludes that the given pubkey can indeed be referenced by its identifier.
|
The result should be a JSON document object with a key `"names"` that should then be a mapping of names to hex formatted public keys. If the public key for the given `<name>` matches the `pubkey` from the `user's metadata` event, the client then concludes that the given pubkey can indeed be referenced by its identifier.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
4
07.md
4
07.md
|
@ -24,6 +24,10 @@ async window.nostr.nip44.encrypt(pubkey, plaintext): string // returns ciphertex
|
||||||
async window.nostr.nip44.decrypt(pubkey, ciphertext): string // takes ciphertext as specified in nip-44
|
async window.nostr.nip44.decrypt(pubkey, ciphertext): string // takes ciphertext as specified in nip-44
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Recommendation to Extension Authors
|
||||||
|
To make sure that the `window.nostr` is available to nostr clients on page load, the authors who create Chromium and Firefox extensions should load their scripts by specifying `"run_at": "document_end"` in the extension's manifest.
|
||||||
|
|
||||||
|
|
||||||
### Implementation
|
### Implementation
|
||||||
|
|
||||||
See https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions.
|
See https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions.
|
||||||
|
|
8
09.md
8
09.md
|
@ -6,9 +6,7 @@ Event Deletion
|
||||||
|
|
||||||
`draft` `optional`
|
`draft` `optional`
|
||||||
|
|
||||||
A special event with kind `5`, meaning "deletion" is defined as having a list of one or more `e` tags, each referencing an event the author is requesting to be deleted.
|
A special event with kind `5`, meaning "deletion" is defined as having a list of one or more `e` or `a` tags, each referencing an event the author is requesting to be deleted. Deletion requests SHOULD include a `k` tag for the kind of each event being deleted.
|
||||||
|
|
||||||
Each tag entry must contain an "e" event id and/or `a` tags intended for deletion.
|
|
||||||
|
|
||||||
The event's `content` field MAY contain a text note describing the reason for the deletion.
|
The event's `content` field MAY contain a text note describing the reason for the deletion.
|
||||||
|
|
||||||
|
@ -21,7 +19,9 @@ For example:
|
||||||
"tags": [
|
"tags": [
|
||||||
["e", "dcd59..464a2"],
|
["e", "dcd59..464a2"],
|
||||||
["e", "968c5..ad7a4"],
|
["e", "968c5..ad7a4"],
|
||||||
["a", "<kind>:<pubkey>:<d-identifier>"]
|
["a", "<kind>:<pubkey>:<d-identifier>"],
|
||||||
|
["k", "1"],
|
||||||
|
["k", "30023"]
|
||||||
],
|
],
|
||||||
"content": "these posts were published by accident",
|
"content": "these posts were published by accident",
|
||||||
...other fields
|
...other fields
|
||||||
|
|
14
15.md
14
15.md
|
@ -6,7 +6,7 @@ Nostr Marketplace
|
||||||
|
|
||||||
`draft` `optional`
|
`draft` `optional`
|
||||||
|
|
||||||
Based on https://github.com/lnbits/Diagon-Alley.
|
Based on [Diagon-Alley](https://github.com/lnbits/Diagon-Alley).
|
||||||
|
|
||||||
Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market).
|
Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market).
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ Fields that are not self-explanatory:
|
||||||
|
|
||||||
## Checkout events
|
## Checkout events
|
||||||
|
|
||||||
All checkout events are sent as JSON strings using ([NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md)).
|
All checkout events are sent as JSON strings using [NIP-04](04.md).
|
||||||
|
|
||||||
The `merchant` and the `customer` can exchange JSON messages that represent different actions. Each `JSON` message `MUST` have a `type` field indicating the what the JSON represents. Possible types:
|
The `merchant` and the `customer` can exchange JSON messages that represent different actions. Each `JSON` message `MUST` have a `type` field indicating the what the JSON represents. Possible types:
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ The `merchant` and the `customer` can exchange JSON messages that represent diff
|
||||||
| 2 | Merchant | Order Status Update |
|
| 2 | Merchant | Order Status Update |
|
||||||
|
|
||||||
### Step 1: `customer` order (event)
|
### Step 1: `customer` order (event)
|
||||||
The below JSON goes in content of [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md).
|
The below JSON goes in content of [NIP-04](04.md).
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -182,7 +182,7 @@ _Open_: is `contact.nostr` required?
|
||||||
|
|
||||||
Sent back from the merchant for payment. Any payment option is valid that the merchant can check.
|
Sent back from the merchant for payment. Any payment option is valid that the merchant can check.
|
||||||
|
|
||||||
The below JSON goes in `content` of [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md).
|
The below JSON goes in `content` of [NIP-04](04.md).
|
||||||
|
|
||||||
`payment_options`/`type` include:
|
`payment_options`/`type` include:
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ The below JSON goes in `content` of [NIP-04](https://github.com/nostr-protocol/n
|
||||||
|
|
||||||
Once payment has been received and processed.
|
Once payment has been received and processed.
|
||||||
|
|
||||||
The below JSON goes in `content` of [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md).
|
The below JSON goes in `content` of [NIP-04](04.md).
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -231,7 +231,7 @@ The below JSON goes in `content` of [NIP-04](https://github.com/nostr-protocol/n
|
||||||
|
|
||||||
## Customize Marketplace
|
## Customize Marketplace
|
||||||
|
|
||||||
Create a customized user experience using the `naddr` from [NIP-19](https://github.com/nostr-protocol/nips/blob/master/19.md#shareable-identifiers-with-extra-metadata). The use of `naddr` enables easy sharing of marketplace events while incorporating a rich set of metadata. This metadata can include relays, merchant profiles, and more. Subsequently, it allows merchants to be grouped into a market, empowering the market creator to configure the marketplace's user interface and user experience, and share that marketplace. This customization can encompass elements such as market name, description, logo, banner, themes, and even color schemes, offering a tailored and unique marketplace experience.
|
Create a customized user experience using the `naddr` from [NIP-19](19.md#shareable-identifiers-with-extra-metadata). The use of `naddr` enables easy sharing of marketplace events while incorporating a rich set of metadata. This metadata can include relays, merchant profiles, and more. Subsequently, it allows merchants to be grouped into a market, empowering the market creator to configure the marketplace's user interface and user experience, and share that marketplace. This customization can encompass elements such as market name, description, logo, banner, themes, and even color schemes, offering a tailored and unique marketplace experience.
|
||||||
|
|
||||||
### Event `30019`: Create or update marketplace UI/UX
|
### Event `30019`: Create or update marketplace UI/UX
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ Another thing that can happen is - if bids happen very close to the end date of
|
||||||
|
|
||||||
## Customer support events
|
## Customer support events
|
||||||
|
|
||||||
Customer support is handled over whatever communication method was specified. If communicating via nostr, NIP-04 is used https://github.com/nostr-protocol/nips/blob/master/04.md.
|
Customer support is handled over whatever communication method was specified. If communicating via nostr, [NIP-04](04.md) is used.
|
||||||
|
|
||||||
## Additional
|
## Additional
|
||||||
|
|
||||||
|
|
3
19.md
3
19.md
|
@ -34,8 +34,8 @@ These are the possible bech32 prefixes with `TLV`:
|
||||||
|
|
||||||
- `nprofile`: a nostr profile
|
- `nprofile`: a nostr profile
|
||||||
- `nevent`: a nostr event
|
- `nevent`: a nostr event
|
||||||
- `nrelay`: a nostr relay
|
|
||||||
- `naddr`: a nostr _replaceable event_ coordinate
|
- `naddr`: a nostr _replaceable event_ coordinate
|
||||||
|
- `nrelay`: a nostr relay (deprecated)
|
||||||
|
|
||||||
These possible standardized `TLV` types are indicated here:
|
These possible standardized `TLV` types are indicated here:
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ These possible standardized `TLV` types are indicated here:
|
||||||
- depends on the bech32 prefix:
|
- depends on the bech32 prefix:
|
||||||
- for `nprofile` it will be the 32 bytes of the profile public key
|
- for `nprofile` it will be the 32 bytes of the profile public key
|
||||||
- for `nevent` it will be the 32 bytes of the event id
|
- for `nevent` it will be the 32 bytes of the event id
|
||||||
- for `nrelay`, this is the relay URL
|
|
||||||
- for `naddr`, it is the identifier (the `"d"` tag) of the event being referenced. For non-parameterized replaceable events, use an empty string.
|
- for `naddr`, it is the identifier (the `"d"` tag) of the event being referenced. For non-parameterized replaceable events, use an empty string.
|
||||||
- `1`: `relay`
|
- `1`: `relay`
|
||||||
- for `nprofile`, `nevent` and `naddr`, _optionally_, a relay in which the entity (profile or event) is more likely to be found, encoded as ascii
|
- for `nprofile`, `nevent` and `naddr`, _optionally_, a relay in which the entity (profile or event) is more likely to be found, encoded as ascii
|
||||||
|
|
2
21.md
2
21.md
|
@ -10,7 +10,7 @@ This NIP standardizes the usage of a common URI scheme for maximum interoperabil
|
||||||
|
|
||||||
The scheme is `nostr:`.
|
The scheme is `nostr:`.
|
||||||
|
|
||||||
The identifiers that come after are expected to be the same as those defined in [NIP-19](https://github.com/nostr-protocol/nips/blob/master/19.md) (except `nsec`).
|
The identifiers that come after are expected to be the same as those defined in [NIP-19](19.md) (except `nsec`).
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|
2
27.md
2
27.md
|
@ -20,7 +20,7 @@ A reader client that receives an event with such `nostr:...` mentions in its `.c
|
||||||
|
|
||||||
Suppose Bob is writing a note in a client that has search-and-autocomplete functionality for users that is triggered when they write the character `@`.
|
Suppose Bob is writing a note in a client that has search-and-autocomplete functionality for users that is triggered when they write the character `@`.
|
||||||
|
|
||||||
As Bob types `"hello @mat"` the client will prompt him to autocomplete with [mattn's profile](https://gateway.nostr.com/p/2c7cc62a697ea3a7826521f3fd34f0cb273693cbe5e9310f35449f43622a5cdc), showing a picture and name.
|
As Bob types `"hello @mat"` the client will prompt him to autocomplete with [mattn's profile](https://njump.me/npub1937vv2nf06360qn9y8el6d8sevnndy7tuh5nzre4gj05xc32tnwqauhaj6), showing a picture and name.
|
||||||
|
|
||||||
Bob presses "enter" and now he sees his typed note as `"hello @mattn"`, `@mattn` is highlighted, indicating that it is a mention. Internally, however, the event looks like this:
|
Bob presses "enter" and now he sees his typed note as `"hello @mattn"`, `@mattn` is highlighted, indicating that it is a mention. Internally, however, the event looks like this:
|
||||||
|
|
||||||
|
|
2
28.md
2
28.md
|
@ -37,7 +37,7 @@ In the channel creation `content` field, Client SHOULD include basic channel met
|
||||||
|
|
||||||
Update a channel's public metadata.
|
Update a channel's public metadata.
|
||||||
|
|
||||||
Clients and relays SHOULD handle kind 41 events similar to kind 33 replaceable events, where the information is used to update the metadata, without modifying the event id for the channel.Only the most recent kind 41 is needed to be stored.
|
Kind 41 is used to update the metadata without modifying the event id for the channel. Only the most recent kind 41 per `e` tag value MAY be available.
|
||||||
|
|
||||||
Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey.
|
Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey.
|
||||||
|
|
||||||
|
|
1
29.md
1
29.md
|
@ -119,6 +119,7 @@ Each moderation action uses a different kind and requires different arguments, w
|
||||||
| 9004 | `remove-permission` | `p` (pubkey), `permission` (name) |
|
| 9004 | `remove-permission` | `p` (pubkey), `permission` (name) |
|
||||||
| 9005 | `delete-event` | `e` (id hex) |
|
| 9005 | `delete-event` | `e` (id hex) |
|
||||||
| 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` |
|
| 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` |
|
||||||
|
| 9007 | `create-group` | |
|
||||||
|
|
||||||
- *group metadata* (`kind:39000`) (optional)
|
- *group metadata* (`kind:39000`) (optional)
|
||||||
|
|
||||||
|
|
19
32.md
19
32.md
|
@ -6,10 +6,9 @@ Labeling
|
||||||
|
|
||||||
`draft` `optional`
|
`draft` `optional`
|
||||||
|
|
||||||
A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases,
|
This NIP defines two new indexable tags to label events and a new event kind (`kind:1985`) to attach those labels to existing events. This supports several use cases, including distributed moderation, collection management, license assignment, and content classification.
|
||||||
including distributed moderation, collection management, license assignment, and content classification.
|
|
||||||
|
|
||||||
This NIP introduces two new tags:
|
New Tags:
|
||||||
|
|
||||||
- `L` denotes a label namespace
|
- `L` denotes a label namespace
|
||||||
- `l` denotes a label
|
- `l` denotes a label
|
||||||
|
@ -129,6 +128,20 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Author is labeling their note language as English using ISO-639-1.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 1,
|
||||||
|
"tags": [
|
||||||
|
["L", "ISO-639-1"],
|
||||||
|
["l", "en", "ISO-639-1"]
|
||||||
|
],
|
||||||
|
"content": "English text",
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Other Notes
|
Other Notes
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
32
34.md
32
34.md
|
@ -35,6 +35,36 @@ The `r` tag annotated with the `"euc"` marker should be the commit ID of the ear
|
||||||
|
|
||||||
Except `d`, all tags are optional.
|
Except `d`, all tags are optional.
|
||||||
|
|
||||||
|
## Repository state announcements
|
||||||
|
|
||||||
|
An optional source of truth for the state of branches and tags in a repository.
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"kind": 30618,
|
||||||
|
"content": "",
|
||||||
|
"tags": [
|
||||||
|
["d", "<repo-id>"], // matches the identifier in the coresponding repository announcement
|
||||||
|
["refs/<heads|tags>/<branch-or-tag-name>","<commit-id>"]
|
||||||
|
["HEAD", "ref: refs/heads/<branch-name>"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `refs` tag may appear multiple times, or none.
|
||||||
|
|
||||||
|
If no `refs` tags are present, the author is no longer tracking repository state using this event. This approach enables the author to restart tracking state at a later time unlike [NIP-09](09.md) deletion.
|
||||||
|
|
||||||
|
The `refs` tag can be optionally extended to enable clients to identify how many commits ahead a ref is:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"tags": [
|
||||||
|
["refs/<heads|tags>/<branch-or-tag-name>", "<commit-id>", "<shorthand-parent-commit-id>", "<shorthand-grandparent>", ...],
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Patches
|
## Patches
|
||||||
|
|
||||||
Patches can be sent by anyone to any repository. Patches to a specific repository SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address.
|
Patches can be sent by anyone to any repository. Patches to a specific repository SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address.
|
||||||
|
@ -53,7 +83,7 @@ The first patch revision in a patch revision SHOULD include a NIP-10 `e` `reply`
|
||||||
["p", "<repository-owner>"],
|
["p", "<repository-owner>"],
|
||||||
["p", "<other-user>"], // optionally send the patch to another user to bring it to their attention
|
["p", "<other-user>"], // optionally send the patch to another user to bring it to their attention
|
||||||
|
|
||||||
["t", "root"], // ommited for additional patches in a series
|
["t", "root"], // omitted for additional patches in a series
|
||||||
// for the first patch in a revision
|
// for the first patch in a revision
|
||||||
["t", "root-revision"],
|
["t", "root-revision"],
|
||||||
|
|
||||||
|
|
4
39.md
4
39.md
|
@ -12,9 +12,11 @@ Nostr protocol users may have other online identities such as usernames, profile
|
||||||
|
|
||||||
## `i` tag on a metadata event
|
## `i` tag on a metadata event
|
||||||
|
|
||||||
A new optional `i` tag is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md):
|
A new optional `i` tag is introduced for `kind 0` metadata event defined in [NIP-01](01.md):
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
"id": <id>,
|
||||||
|
"pubkey": <pubkey>,
|
||||||
"tags": [
|
"tags": [
|
||||||
["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
|
["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
|
||||||
["i", "twitter:semisol_public", "1619358434134196225"],
|
["i", "twitter:semisol_public", "1619358434134196225"],
|
||||||
|
|
8
46.md
8
46.md
|
@ -28,7 +28,7 @@ The remote signer would provide a connection token in the form:
|
||||||
bunker://<remote-user-pubkey>?relay=<wss://relay-to-connect-on>&relay=<wss://another-relay-to-connect-on>&secret=<optional-secret-value>
|
bunker://<remote-user-pubkey>?relay=<wss://relay-to-connect-on>&relay=<wss://another-relay-to-connect-on>&secret=<optional-secret-value>
|
||||||
```
|
```
|
||||||
|
|
||||||
This token is pasted into the client by the user and the client then uses the details to connect to the remote signer via the specified relay(s).
|
This token is pasted into the client by the user and the client then uses the details to connect to the remote signer via the specified relay(s). Optional secret can be used for single successfully established connection only, remote signer SHOULD ignore new attempts to establish connection with old optional secret.
|
||||||
|
|
||||||
### Direct connection initiated by the client
|
### Direct connection initiated by the client
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ nostrconnect://<local-keypair-pubkey>?relay=<wss://relay-to-connect-on>&metadata
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `content` field is a JSON-RPC-like message that is [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) encrypted and has the following structure:
|
The `content` field is a JSON-RPC-like message that is [NIP-04](04.md) encrypted and has the following structure:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ The `connect` method may be provided with `optional_requested_permissions` for u
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `content` field is a JSON-RPC-like message that is [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) encrypted and has the following structure:
|
The `content` field is a JSON-RPC-like message that is [NIP-04](04.md) encrypted and has the following structure:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -224,4 +224,4 @@ Coming soon...
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- [NIP-04 - Encryption](https://github.com/nostr-protocol/nips/blob/master/04.md)
|
- [NIP-04 - Encryption](04.md)
|
||||||
|
|
2
47.md
2
47.md
|
@ -38,7 +38,7 @@ a plaintext string with the supported commands, space-separated, eg. `pay_invoic
|
||||||
Both the request and response events SHOULD contain one `p` tag, containing the public key of the **wallet service** if this is a request, and the public key of the **user** if this is a response. The response event SHOULD contain an `e` tag with the id of the request event it is responding to.
|
Both the request and response events SHOULD contain one `p` tag, containing the public key of the **wallet service** if this is a request, and the public key of the **user** if this is a response. The response event SHOULD contain an `e` tag with the id of the request event it is responding to.
|
||||||
Optionally, a request can have an `expiration` tag that has a unix timestamp in seconds. If the request is received after this timestamp, it should be ignored.
|
Optionally, a request can have an `expiration` tag that has a unix timestamp in seconds. If the request is received after this timestamp, it should be ignored.
|
||||||
|
|
||||||
The content of requests and responses is encrypted with [NIP04](https://github.com/nostr-protocol/nips/blob/master/04.md), and is a JSON-RPCish object with a semi-fixed structure:
|
The content of requests and responses is encrypted with [NIP04](04.md), and is a JSON-RPCish object with a semi-fixed structure:
|
||||||
|
|
||||||
Request:
|
Request:
|
||||||
```jsonc
|
```jsonc
|
||||||
|
|
1
51.md
1
51.md
|
@ -32,6 +32,7 @@ For example, _mute list_ can contain the public keys of spammers and bad actors
|
||||||
| Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group ids + mandatory relay URL) |
|
| Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group ids + mandatory relay URL) |
|
||||||
| Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) |
|
| 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) |
|
| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) |
|
||||||
|
| DM relays | 10050 | Where to receive [NIP-17](17.md) direct messages | `"relay"` (see [NIP-17](17.md)) |
|
||||||
| Good wiki authors | 10101 | [NIP-54](54.md) user recommended wiki authors | `"p"` (pubkeys) |
|
| Good wiki authors | 10101 | [NIP-54](54.md) user recommended wiki authors | `"p"` (pubkeys) |
|
||||||
| Good wiki relays | 10102 | [NIP-54](54.md) relays deemed to only host useful articles | `"relay"` (relay URLs) |
|
| Good wiki relays | 10102 | [NIP-54](54.md) relays deemed to only host useful articles | `"relay"` (relay URLs) |
|
||||||
|
|
||||||
|
|
2
65.md
2
65.md
|
@ -37,7 +37,7 @@ When seeking events **about** a user, where the user was tagged, Clients SHOULD
|
||||||
When broadcasting an event, Clients SHOULD:
|
When broadcasting an event, Clients SHOULD:
|
||||||
|
|
||||||
- Broadcast the event to the WRITE relays of the author
|
- Broadcast the event to the WRITE relays of the author
|
||||||
- Broadcast the event all READ relays of each tagged user
|
- Broadcast the event to all READ relays of each tagged user
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
|
|
45
70.md
Normal file
45
70.md
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
NIP-70
|
||||||
|
======
|
||||||
|
|
||||||
|
Protected Events
|
||||||
|
----------------
|
||||||
|
|
||||||
|
`draft` `optional`
|
||||||
|
|
||||||
|
When the `"-"` tag is present, that means the event is "protected".
|
||||||
|
|
||||||
|
A protected event is an event that can only be published to relays by its author. This is achieved by relays ensuring that the author is [authenticated](42.md) before publishing their own events or by just rejecting events with `["-"]` outright.
|
||||||
|
|
||||||
|
The default behavior of a relay MUST be to reject any event that contains `["-"]`.
|
||||||
|
|
||||||
|
Relays that want to accept such events MUST first require that the client perform the [NIP-42](42.md) `AUTH` flow and then check if the authenticated client has the same pubkey as the event being published and only accept the event in that case.
|
||||||
|
|
||||||
|
## The tag
|
||||||
|
|
||||||
|
The tag is a simple tag with a single item: `["-"]`. It may be added to any event.
|
||||||
|
|
||||||
|
## Example flow
|
||||||
|
|
||||||
|
- User `79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798` connects to relay `wss://example.com`:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
/* client: */
|
||||||
|
["EVENT",{"id":"cb8feca582979d91fe90455867b34dbf4d65e4b86e86b3c68c368ca9f9eef6f2","pubkey":"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","created_at":1707409439,"kind":1,"tags":[["-"]],"content":"hello members of the secret group","sig":"fa163f5cfb75d77d9b6269011872ee22b34fb48d23251e9879bb1e4ccbdd8aaaf4b6dc5f5084a65ef42c52fbcde8f3178bac3ba207de827ec513a6aa39fa684c"}]
|
||||||
|
/* relay: */
|
||||||
|
["AUTH", "<challenge>"]
|
||||||
|
["OK", "cb8feca582979d91fe90455867b34dbf4d65e4b86e86b3c68c368ca9f9eef6f2", false, "auth-required: this event may only be published by its author"]
|
||||||
|
/* client: */
|
||||||
|
["AUTH", {}]
|
||||||
|
["EVENT",{"id":"cb8feca582979d91fe90455867b34dbf4d65e4b86e86b3c68c368ca9f9eef6f2","pubkey":"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","created_at":1707409439,"kind":1,"tags":[["-"]],"content":"hello members of the secret group","sig":"fa163f5cfb75d77d9b6269011872ee22b34fb48d23251e9879bb1e4ccbdd8aaaf4b6dc5f5084a65ef42c52fbcde8f3178bac3ba207de827ec513a6aa39fa684c"}]
|
||||||
|
["OK", "cb8feca582979d91fe90455867b34dbf4d65e4b86e86b3c68c368ca9f9eef6f2", true, ""]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Why
|
||||||
|
|
||||||
|
There are multiple circumstances in which it would be beneficial to prevent the unlimited spreading of an event through all relays imaginable and restrict some to only a certain demographic or to a semi-closed community relay. Even when the information is public it may make sense to keep it compartimentalized across different relays.
|
||||||
|
|
||||||
|
It's also possible to create closed access feeds with this when the publisher has some relationship with the relay and trusts the relay to not release their published events to anyone.
|
||||||
|
|
||||||
|
Even though it's ultimately impossible to restrict the spread of information on the internet (for example, one of the members of the closed group may want to take an event intended to be restricted and republish it to other relays), most relays would be happy to not facilitate the acts of these so-called "pirates", in respect to the original decision of the author and therefore gladly reject these republish acts if given the means to.
|
||||||
|
|
||||||
|
This NIP gives these authors and relays the means to clearly signal when a given event is not intended to be republished by third parties.
|
45
72.md
45
72.md
|
@ -6,11 +6,11 @@ Moderated Communities (Reddit Style)
|
||||||
|
|
||||||
`draft` `optional`
|
`draft` `optional`
|
||||||
|
|
||||||
The goal of this NIP is to create moderator-approved public communities around a topic. It defines the replaceable event `kind:34550` to define the community and the current list of moderators/administrators. Users that want to post into the community, simply tag any Nostr event with the community's `a` tag. Moderators issue an approval event `kind:4550` that links the community with the new post.
|
The goal of this NIP is to enable public communities. It defines the replaceable event `kind:34550` to define the community and the current list of moderators/administrators. Users that want to post into the community, simply tag any Nostr event with the community's `a` tag. Moderators may issue an approval event `kind:4550`.
|
||||||
|
|
||||||
# Community Definition
|
# Community Definition
|
||||||
|
|
||||||
`kind:34550` SHOULD include any field that helps define the community and the set of moderators. `relay` tags MAY be used to describe the preferred relay to download requests and approvals.
|
`Kind:34550` SHOULD include any field that helps define the community and the set of moderators. `relay` tags MAY be used to describe the preferred relay to download requests and approvals. A community definition event's `d` tag MAY double as its name, but if a `name` tag is provided, it SHOULD be displayed instead of the `d` tag.
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@ The goal of this NIP is to create moderator-approved public communities around a
|
||||||
"kind": 34550,
|
"kind": 34550,
|
||||||
"tags": [
|
"tags": [
|
||||||
["d", "<community-d-identifier>"],
|
["d", "<community-d-identifier>"],
|
||||||
|
["name", "<Community name>"],
|
||||||
["description", "<Community description>"],
|
["description", "<Community description>"],
|
||||||
["image", "<Community image url>", "<Width>x<Height>"],
|
["image", "<Community image url>", "<Width>x<Height>"],
|
||||||
|
|
||||||
|
@ -38,9 +39,9 @@ The goal of this NIP is to create moderator-approved public communities around a
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
# New Post Request
|
# Posting to a community
|
||||||
|
|
||||||
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.
|
Any Nostr event can be posted to a community. Clients MUST add one or more community `a` tags, each with a recommended relay.
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
|
@ -53,11 +54,15 @@ 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)).
|
# Moderation
|
||||||
|
|
||||||
# Post Approval by moderators
|
Anyone may issue an approval event to express their opinion that a post is appropriate for a community. Clients MAY choose which approval events to honor, but SHOULD at least use ones published by the group's defined 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.
|
An approval event MUST include one or more community `a` tags, an `e` or `a` tag pointing to the post, and the `p` tag of the author of the post (for approval notifications). `a` tag prefixes can be used to disambiguate between community and replaceable event pointers (community `a` tags always begin with `34550`).
|
||||||
|
|
||||||
|
The event SHOULD also include the JSON-stringified `post request` event inside the `.content`, and a `k` tag with the original post's event kind to allow filtering of approved posts by kind.
|
||||||
|
|
||||||
|
Moderators MAY delete their approval of a post at any time using NIP 09 event deletions.
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
|
@ -76,26 +81,16 @@ The post-approval event MUST include `a` tags of the communities the moderator i
|
||||||
|
|
||||||
It's recommended that multiple moderators approve posts to avoid deleting them from the community when a moderator is removed from the owner's list. In case the full list of moderators must be rotated, the new moderator set must sign new approvals for posts in the past or the community will restart. The owner can also periodically copy and re-sign of each moderator's approval events to make sure posts don't disappear with moderators.
|
It's recommended that multiple moderators approve posts to avoid deleting them from the community when a moderator is removed from the owner's list. In case the full list of moderators must be rotated, the new moderator set must sign new approvals for posts in the past or the community will restart. The owner can also periodically copy and re-sign of each moderator's approval events to make sure posts don't disappear with moderators.
|
||||||
|
|
||||||
Post Approvals of replaceable events can be created in three ways: (i) by tagging the replaceable event as an `e` tag if moderators want to approve each individual change to the replaceable event; (ii) by tagging the replaceable event as an `a` tag if the moderator authorizes the replaceable event author to make changes without additional approvals and (iii) by tagging the replaceable event with both its `e` and `a` tag which empowers clients to display the original and updated versions of the event, with appropriate remarks in the UI. Since relays are instructed to delete old versions of a replaceable event, the `.content` of an `e`-approval MUST have the specific version of the event or Clients might not be able to find that version of the content anywhere.
|
Approvals of replaceable events can be created in three ways:
|
||||||
|
|
||||||
Clients SHOULD evaluate any non-`34550:*` `a` tag as posts to be included in all `34550:*` `a` tags.
|
1. By tagging the replaceable event as an `e` tag if moderators want to approve each individual change to the replaceable event
|
||||||
|
2. By tagging the replaceable event as an `a` tag if the moderator authorizes the replaceable event author to make changes without additional approvals and
|
||||||
|
3. By tagging the replaceable event with both its `e` and `a` tag which empowers clients to display the original and updated versions of the event, with appropriate remarks in the UI.
|
||||||
|
|
||||||
# Displaying
|
Since relays are instructed to delete old versions of a replaceable event, the `content` of an approval using an `e` tag MUST have the specific version of the event or clients might not be able to find that version of the content anywhere.
|
||||||
|
|
||||||
Community clients SHOULD display posts that have been approved by at least 1 moderator or by the community owner.
|
Clients SHOULD evaluate any non-`34550:*` `a` tag as posts to be approved for all `34550:*` `a` tags.
|
||||||
|
|
||||||
The following filter displays the approved posts.
|
# Cross-posting
|
||||||
|
|
||||||
```json
|
Clients MAY support cross-posting between communities by posting a NIP 18 `kind 6` or `kind 16` repost to one or more communities using `a` tags as described above. The `content` of the repost MUST be the original event, not the approval event.
|
||||||
[
|
|
||||||
"REQ",
|
|
||||||
"_",
|
|
||||||
{
|
|
||||||
"authors": ["<owner-pubkey>", "<moderator1-pubkey>", "<moderator2-pubkey>", "<moderator3-pubkey>", ...],
|
|
||||||
"kinds": [4550],
|
|
||||||
"#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"],
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
Clients MAY hide approvals by blocked moderators at the user's request.
|
|
||||||
|
|
4
89.md
4
89.md
|
@ -116,7 +116,7 @@ User B might see in their timeline an event referring to a `kind:31337` event (e
|
||||||
User B's client, not knowing how to handle a `kind:31337` might display the event using its `alt` tag (as described in NIP-31). When the user clicks on the event, the application queries for a handler for this `kind`:
|
User B's client, not knowing how to handle a `kind:31337` might display the event using its `alt` tag (as described in NIP-31). When the user clicks on the event, the application queries for a handler for this `kind`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
["REQ", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']
|
["REQ", <id>, { "kinds": [31989], "#d": ["31337"], "authors": [<user>, <users-contact-list>] }]
|
||||||
```
|
```
|
||||||
|
|
||||||
User B, who follows User A, sees that `kind:31989` event and fetches the `a`-tagged event for the app and handler information.
|
User B, who follows User A, sees that `kind:31989` event and fetches the `a`-tagged event for the app and handler information.
|
||||||
|
@ -127,5 +127,5 @@ User B's client sees the application's `kind:31990` which includes the informati
|
||||||
Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms or querying high-quality restricted relays to avoid directing users to malicious handlers.
|
Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms or querying high-quality restricted relays to avoid directing users to malicious handlers.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
["REQ", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']
|
["REQ", <id>, { "kinds": [31990], "#k": [<desired-event-kind>], "authors": [...] }]
|
||||||
```
|
```
|
||||||
|
|
2
96.md
2
96.md
|
@ -301,7 +301,7 @@ Example Response:
|
||||||
// ...other metadata
|
// ...other metadata
|
||||||
]
|
]
|
||||||
"content": "haha funny meme", // caption
|
"content": "haha funny meme", // caption
|
||||||
"created_at": 1715691130 // upload timestmap
|
"created_at": 1715691130 // upload timestamp
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
]
|
]
|
||||||
|
|
3
98.md
3
98.md
|
@ -55,7 +55,8 @@ Using the `Authorization` HTTP header, the `kind 27235` event MUST be `base64` e
|
||||||
|
|
||||||
Example HTTP Authorization header:
|
Example HTTP Authorization header:
|
||||||
```
|
```
|
||||||
Authorization: Nostr eyJpZCI6ImZlOTY0ZTc1ODkwMzM2MGYyOGQ4NDI0ZDA5MmRhODQ5NGVkMjA3Y2JhODIzMTEwYmUzYTU3ZGZlNGI1Nzg3MzQiLCJwdWJrZXkiOiI2M2ZlNjMxOGRjNTg1ODNjZmUxNjgxMGY4NmRkMDllMThiZmQ3NmFhYmMyNGEwMDgxY2UyODU2ZjMzMDUwNGVkIiwiY29udGVudCI6IiIsImtpbmQiOjI3MjM1LCJjcmVhdGVkX2F0IjoxNjgyMzI3ODUyLCJ0YWdzIjpbWyJ1cmwiLCJodHRwczovL2FwaS5zbm9ydC5zb2NpYWwvYXBpL3YxL241c3AvbGlzdCJdLFsibWV0aG9kIiwiR0VUIl1dLCJzaWciOiI1ZWQ5ZDhlYzk1OGJjODU0Zjk5N2JkYzI0YWMzMzdkMDA1YWYzNzIzMjQ3NDdlZmU0YTAwZTI0ZjRjMzA0MzdmZjRkZDgzMDg2ODRiZWQ0NjdkOWQ2YmUzZTVhNTE3YmI0M2IxNzMyY2M3ZDMzOTQ5YTNhYWY4NjcwNWMyMjE4NCJ9
|
Authorization: Nostr
|
||||||
|
eyJpZCI6ImZlOTY0ZTc1ODkwMzM2MGYyOGQ4NDI0ZDA5MmRhODQ5NGVkMjA3Y2JhODIzMTEwYmUzYTU3ZGZlNGI1Nzg3MzQiLCJwdWJrZXkiOiI2M2ZlNjMxOGRjNTg1ODNjZmUxNjgxMGY4NmRkMDllMThiZmQ3NmFhYmMyNGEwMDgxY2UyODU2ZjMzMDUwNGVkIiwiY29udGVudCI6IiIsImtpbmQiOjI3MjM1LCJjcmVhdGVkX2F0IjoxNjgyMzI3ODUyLCJ0YWdzIjpbWyJ1IiwiaHR0cHM6Ly9hcGkuc25vcnQuc29jaWFsL2FwaS92MS9uNXNwL2xpc3QiXSxbIm1ldGhvZCIsIkdFVCJdXSwic2lnIjoiNWVkOWQ4ZWM5NThiYzg1NGY5OTdiZGMyNGFjMzM3ZDAwNWFmMzcyMzI0NzQ3ZWZlNGEwMGUyNGY0YzMwNDM3ZmY0ZGQ4MzA4Njg0YmVkNDY3ZDlkNmJlM2U1YTUxN2JiNDNiMTczMmNjN2QzMzk0OWEzYWFmODY3MDVjMjIxODQifQ
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference Implementations
|
## Reference Implementations
|
||||||
|
|
8
99.md
8
99.md
|
@ -8,9 +8,9 @@ Classified Listings
|
||||||
|
|
||||||
This NIP defines `kind:30402`: a parameterized replaceable event to describe classified listings that list any arbitrary product, service, or other thing for sale or offer and includes enough structured metadata to make them useful.
|
This NIP defines `kind:30402`: a parameterized replaceable event to describe classified listings that list any arbitrary product, service, or other thing for sale or offer and includes enough structured metadata to make them useful.
|
||||||
|
|
||||||
The category of classifieds includes a very broad range of physical goods, services, work opportunities, rentals, free giveaways, personals, etc. and is distinct from the more strictly structured marketplaces defined in [NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md) that often sell many units of specific products through very specific channels.
|
The category of classifieds includes a very broad range of physical goods, services, work opportunities, rentals, free giveaways, personals, etc. and is distinct from the more strictly structured marketplaces defined in [NIP-15](15.md) that often sell many units of specific products through very specific channels.
|
||||||
|
|
||||||
The structure of these events is very similar to [NIP-23](https://github.com/nostr-protocol/nips/blob/master/23.md) long-form content events.
|
The structure of these events is very similar to [NIP-23](23.md) long-form content events.
|
||||||
|
|
||||||
### Draft / Inactive Listings
|
### Draft / Inactive Listings
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ The `.pubkey` field of these events are treated as the party creating the listin
|
||||||
|
|
||||||
### Metadata
|
### Metadata
|
||||||
|
|
||||||
- For "tags"/"hashtags" (i.e. categories or keywords of relevance for the listing) the `"t"` event tag should be used, as per [NIP-12](https://github.com/nostr-protocol/nips/blob/master/12.md).
|
- For "tags"/"hashtags" (i.e. categories or keywords of relevance for the listing) the `"t"` event tag should be used, as per [NIP-12](12.md).
|
||||||
- For images, whether included in the markdown content or not, clients SHOULD use `image` tags as described in [NIP-58](https://github.com/nostr-protocol/nips/blob/master/58.md). This allows clients to display images in carousel format more easily.
|
- For images, whether included in the markdown content or not, clients SHOULD use `image` tags as described in [NIP-58](58.md). This allows clients to display images in carousel format more easily.
|
||||||
|
|
||||||
The following tags, used for structured metadata, are standardized and SHOULD be included. Other tags may be added as necessary.
|
The following tags, used for structured metadata, are standardized and SHOULD be included. Other tags may be added as necessary.
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@ reverse chronological order.
|
||||||
|
|
||||||
| Date | Commit | NIP | Change |
|
| Date | Commit | NIP | Change |
|
||||||
| ----------- | --------- | -------- | ------ |
|
| ----------- | --------- | -------- | ------ |
|
||||||
|
| 2024-07-31 | [3ea2f1a4](https://github.com/nostr-protocol/nips/commit/3ea2f1a4) | [NIP-45](45.md) | [444ad28d](https://github.com/nostr-protocol/nips/commit/444ad28d) was reverted |
|
||||||
|
| 2024-07-30 | [444ad28d](https://github.com/nostr-protocol/nips/commit/444ad28d) | [NIP-45](45.md) | NIP-45 was deprecated |
|
||||||
|
| 2024-07-26 | [ecee40df](https://github.com/nostr-protocol/nips/commit/ecee40df) | [NIP-19](19.md) | `nrelay` was deprecated |
|
||||||
|
| 2024-07-23 | [0227a2cd](https://github.com/nostr-protocol/nips/commit/0227a2cd) | [NIP-01](01.md) | events should be sorted by id after created_at |
|
||||||
| 2024-06-06 | [58e94b20](https://github.com/nostr-protocol/nips/commit/58e94b20) | [NIP-25](25.md) | [8073c848](https://github.com/nostr-protocol/nips/commit/8073c848) was reverted |
|
| 2024-06-06 | [58e94b20](https://github.com/nostr-protocol/nips/commit/58e94b20) | [NIP-25](25.md) | [8073c848](https://github.com/nostr-protocol/nips/commit/8073c848) was reverted |
|
||||||
| 2024-06-06 | [a6dfc7b5](https://github.com/nostr-protocol/nips/commit/a6dfc7b5) | [NIP-55](55.md) | NIP number was changed |
|
| 2024-06-06 | [a6dfc7b5](https://github.com/nostr-protocol/nips/commit/a6dfc7b5) | [NIP-55](55.md) | NIP number was changed |
|
||||||
| 2024-05-25 | [5d1d1c17](https://github.com/nostr-protocol/nips/commit/5d1d1c17) | [NIP-71](71.md) | 'aes-256-gcm' tag was removed |
|
| 2024-05-25 | [5d1d1c17](https://github.com/nostr-protocol/nips/commit/5d1d1c17) | [NIP-71](71.md) | 'aes-256-gcm' tag was removed |
|
||||||
|
|
219
README.md
219
README.md
|
@ -74,6 +74,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||||
- [NIP-58: Badges](58.md)
|
- [NIP-58: Badges](58.md)
|
||||||
- [NIP-59: Gift Wrap](59.md)
|
- [NIP-59: Gift Wrap](59.md)
|
||||||
- [NIP-65: Relay List Metadata](65.md)
|
- [NIP-65: Relay List Metadata](65.md)
|
||||||
|
- [NIP-70: Protected Events](70.md)
|
||||||
- [NIP-71: Video Events](71.md)
|
- [NIP-71: Video Events](71.md)
|
||||||
- [NIP-72: Moderated Communities](72.md)
|
- [NIP-72: Moderated Communities](72.md)
|
||||||
- [NIP-75: Zap Goals](75.md)
|
- [NIP-75: Zap Goals](75.md)
|
||||||
|
@ -88,112 +89,114 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||||
- [NIP-99: Classified Listings](99.md)
|
- [NIP-99: Classified Listings](99.md)
|
||||||
|
|
||||||
## Event Kinds
|
## Event Kinds
|
||||||
| kind | description | NIP |
|
|
||||||
| ------------- | -------------------------- | ------------------------ |
|
| kind | description | NIP |
|
||||||
| `0` | Metadata | [01](01.md) |
|
| ------------- | ------------------------------- | -------------------------------------- |
|
||||||
| `1` | Short Text Note | [01](01.md) |
|
| `0` | User Metadata | [01](01.md) |
|
||||||
| `2` | Recommend Relay | 01 (deprecated) |
|
| `1` | Short Text Note | [01](01.md) |
|
||||||
| `3` | Follows | [02](02.md) |
|
| `2` | Recommend Relay | 01 (deprecated) |
|
||||||
| `4` | Encrypted Direct Messages | [04](04.md) |
|
| `3` | Follows | [02](02.md) |
|
||||||
| `5` | Event Deletion | [09](09.md) |
|
| `4` | Encrypted Direct Messages | [04](04.md) |
|
||||||
| `6` | Repost | [18](18.md) |
|
| `5` | Event Deletion | [09](09.md) |
|
||||||
| `7` | Reaction | [25](25.md) |
|
| `6` | Repost | [18](18.md) |
|
||||||
| `8` | Badge Award | [58](58.md) |
|
| `7` | Reaction | [25](25.md) |
|
||||||
| `9` | Group Chat Message | [29](29.md) |
|
| `8` | Badge Award | [58](58.md) |
|
||||||
| `10` | Group Chat Threaded Reply | [29](29.md) |
|
| `9` | Group Chat Message | [29](29.md) |
|
||||||
| `11` | Group Thread | [29](29.md) |
|
| `10` | Group Chat Threaded Reply | [29](29.md) |
|
||||||
| `12` | Group Thread Reply | [29](29.md) |
|
| `11` | Group Thread | [29](29.md) |
|
||||||
| `13` | Seal | [59](59.md) |
|
| `12` | Group Thread Reply | [29](29.md) |
|
||||||
| `14` | Direct Message | [17](17.md) |
|
| `13` | Seal | [59](59.md) |
|
||||||
| `16` | Generic Repost | [18](18.md) |
|
| `14` | Direct Message | [17](17.md) |
|
||||||
| `40` | Channel Creation | [28](28.md) |
|
| `16` | Generic Repost | [18](18.md) |
|
||||||
| `41` | Channel Metadata | [28](28.md) |
|
| `40` | Channel Creation | [28](28.md) |
|
||||||
| `42` | Channel Message | [28](28.md) |
|
| `41` | Channel Metadata | [28](28.md) |
|
||||||
| `43` | Channel Hide Message | [28](28.md) |
|
| `42` | Channel Message | [28](28.md) |
|
||||||
| `44` | Channel Mute User | [28](28.md) |
|
| `43` | Channel Hide Message | [28](28.md) |
|
||||||
| `818` | Merge Requests | [54](54.md) |
|
| `44` | Channel Mute User | [28](28.md) |
|
||||||
| `1021` | Bid | [15](15.md) |
|
| `818` | Merge Requests | [54](54.md) |
|
||||||
| `1022` | Bid confirmation | [15](15.md) |
|
| `1021` | Bid | [15](15.md) |
|
||||||
| `1040` | OpenTimestamps | [03](03.md) |
|
| `1022` | Bid confirmation | [15](15.md) |
|
||||||
| `1059` | Gift Wrap | [59](59.md) |
|
| `1040` | OpenTimestamps | [03](03.md) |
|
||||||
| `1063` | File Metadata | [94](94.md) |
|
| `1059` | Gift Wrap | [59](59.md) |
|
||||||
| `1311` | Live Chat Message | [53](53.md) |
|
| `1063` | File Metadata | [94](94.md) |
|
||||||
| `1617` | Patches | [34](34.md) |
|
| `1311` | Live Chat Message | [53](53.md) |
|
||||||
| `1621` | Issues | [34](34.md) |
|
| `1617` | Patches | [34](34.md) |
|
||||||
| `1622` | Replies | [34](34.md) |
|
| `1621` | Issues | [34](34.md) |
|
||||||
| `1630`-`1633` | Status | [34](34.md) |
|
| `1622` | Replies | [34](34.md) |
|
||||||
| `1971` | Problem Tracker | [nostrocket][nostrocket] |
|
| `1630`-`1633` | Status | [34](34.md) |
|
||||||
| `1984` | Reporting | [56](56.md) |
|
| `1971` | Problem Tracker | [nostrocket][nostrocket] |
|
||||||
| `1985` | Label | [32](32.md) |
|
| `1984` | Reporting | [56](56.md) |
|
||||||
| `2003` | Torrent | [35](35.md) |
|
| `1985` | Label | [32](32.md) |
|
||||||
| `2004` | Torrent Comment | [35](35.md) |
|
| `2003` | Torrent | [35](35.md) |
|
||||||
| `2022` | Coinjoin Pool | [joinstr][joinstr] |
|
| `2004` | Torrent Comment | [35](35.md) |
|
||||||
| `4550` | Community Post Approval | [72](72.md) |
|
| `2022` | Coinjoin Pool | [joinstr][joinstr] |
|
||||||
| `5000`-`5999` | Job Request | [90](90.md) |
|
| `4550` | Community Post Approval | [72](72.md) |
|
||||||
| `6000`-`6999` | Job Result | [90](90.md) |
|
| `5000`-`5999` | Job Request | [90](90.md) |
|
||||||
| `7000` | Job Feedback | [90](90.md) |
|
| `6000`-`6999` | Job Result | [90](90.md) |
|
||||||
| `9000`-`9030` | Group Control Events | [29](29.md) |
|
| `7000` | Job Feedback | [90](90.md) |
|
||||||
| `9041` | Zap Goal | [75](75.md) |
|
| `9000`-`9030` | Group Control Events | [29](29.md) |
|
||||||
| `9734` | Zap Request | [57](57.md) |
|
| `9041` | Zap Goal | [75](75.md) |
|
||||||
| `9735` | Zap | [57](57.md) |
|
| `9734` | Zap Request | [57](57.md) |
|
||||||
| `9802` | Highlights | [84](84.md) |
|
| `9735` | Zap | [57](57.md) |
|
||||||
| `10000` | Mute list | [51](51.md) |
|
| `9802` | Highlights | [84](84.md) |
|
||||||
| `10001` | Pin list | [51](51.md) |
|
| `10000` | Mute list | [51](51.md) |
|
||||||
| `10002` | Relay List Metadata | [65](65.md) |
|
| `10001` | Pin list | [51](51.md) |
|
||||||
| `10003` | Bookmark list | [51](51.md) |
|
| `10002` | Relay List Metadata | [65](65.md) |
|
||||||
| `10004` | Communities list | [51](51.md) |
|
| `10003` | Bookmark list | [51](51.md) |
|
||||||
| `10005` | Public chats list | [51](51.md) |
|
| `10004` | Communities list | [51](51.md) |
|
||||||
| `10006` | Blocked relays list | [51](51.md) |
|
| `10005` | Public chats list | [51](51.md) |
|
||||||
| `10007` | Search relays list | [51](51.md) |
|
| `10006` | Blocked relays list | [51](51.md) |
|
||||||
| `10009` | User groups | [51](51.md), [29](29.md) |
|
| `10007` | Search relays list | [51](51.md) |
|
||||||
| `10015` | Interests list | [51](51.md) |
|
| `10009` | User groups | [51](51.md), [29](29.md) |
|
||||||
| `10030` | User emoji list | [51](51.md) |
|
| `10015` | Interests list | [51](51.md) |
|
||||||
| `10050` | Relay list to receive DMs | [17](17.md) |
|
| `10030` | User emoji list | [51](51.md) |
|
||||||
| `10096` | File storage server list | [96](96.md) |
|
| `10050` | Relay list to receive DMs | [51](51.md), [17](17.md) |
|
||||||
| `13194` | Wallet Info | [47](47.md) |
|
| `10096` | File storage server list | [96](96.md) |
|
||||||
| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] |
|
| `13194` | Wallet Info | [47](47.md) |
|
||||||
| `22242` | Client Authentication | [42](42.md) |
|
| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] |
|
||||||
| `23194` | Wallet Request | [47](47.md) |
|
| `22242` | Client Authentication | [42](42.md) |
|
||||||
| `23195` | Wallet Response | [47](47.md) |
|
| `23194` | Wallet Request | [47](47.md) |
|
||||||
| `24133` | Nostr Connect | [46](46.md) |
|
| `23195` | Wallet Response | [47](47.md) |
|
||||||
| `27235` | HTTP Auth | [98](98.md) |
|
| `24133` | Nostr Connect | [46](46.md) |
|
||||||
| `30000` | Follow sets | [51](51.md) |
|
| `27235` | HTTP Auth | [98](98.md) |
|
||||||
| `30001` | Generic lists | [51](51.md) |
|
| `30000` | Follow sets | [51](51.md) |
|
||||||
| `30002` | Relay sets | [51](51.md) |
|
| `30001` | Generic lists | [51](51.md) |
|
||||||
| `30003` | Bookmark sets | [51](51.md) |
|
| `30002` | Relay sets | [51](51.md) |
|
||||||
| `30004` | Curation sets | [51](51.md) |
|
| `30003` | Bookmark sets | [51](51.md) |
|
||||||
| `30005` | Video sets | [51](51.md) |
|
| `30004` | Curation sets | [51](51.md) |
|
||||||
| `30008` | Profile Badges | [58](58.md) |
|
| `30005` | Video sets | [51](51.md) |
|
||||||
| `30009` | Badge Definition | [58](58.md) |
|
| `30008` | Profile Badges | [58](58.md) |
|
||||||
| `30015` | Interest sets | [51](51.md) |
|
| `30009` | Badge Definition | [58](58.md) |
|
||||||
| `30017` | Create or update a stall | [15](15.md) |
|
| `30015` | Interest sets | [51](51.md) |
|
||||||
| `30018` | Create or update a product | [15](15.md) |
|
| `30017` | Create or update a stall | [15](15.md) |
|
||||||
| `30019` | Marketplace UI/UX | [15](15.md) |
|
| `30018` | Create or update a product | [15](15.md) |
|
||||||
| `30020` | Product sold as an auction | [15](15.md) |
|
| `30019` | Marketplace UI/UX | [15](15.md) |
|
||||||
| `30023` | Long-form Content | [23](23.md) |
|
| `30020` | Product sold as an auction | [15](15.md) |
|
||||||
| `30024` | Draft Long-form Content | [23](23.md) |
|
| `30023` | Long-form Content | [23](23.md) |
|
||||||
| `30030` | Emoji sets | [51](51.md) |
|
| `30024` | Draft Long-form Content | [23](23.md) |
|
||||||
| `30063` | Release artifact sets | [51](51.md) |
|
| `30030` | Emoji sets | [51](51.md) |
|
||||||
| `30078` | Application-specific Data | [78](78.md) |
|
| `30063` | Release artifact sets | [51](51.md) |
|
||||||
| `30311` | Live Event | [53](53.md) |
|
| `30078` | Application-specific Data | [78](78.md) |
|
||||||
| `30315` | User Statuses | [38](38.md) |
|
| `30311` | Live Event | [53](53.md) |
|
||||||
| `30402` | Classified Listing | [99](99.md) |
|
| `30315` | User Statuses | [38](38.md) |
|
||||||
| `30403` | Draft Classified Listing | [99](99.md) |
|
| `30402` | Classified Listing | [99](99.md) |
|
||||||
| `30617` | Repository announcements | [34](34.md) |
|
| `30403` | Draft Classified Listing | [99](99.md) |
|
||||||
| `30818` | Wiki article | [54](54.md) |
|
| `30617` | Repository announcements | [34](34.md) |
|
||||||
| `30819` | Redirects | [54](54.md) |
|
| `30618` | Repository state announcements | [34](34.md) |
|
||||||
| `31890` | Feed | [NUD: Custom Feeds](https://wikifreedia.xyz/cip-01/97c70a44366a6535c1) |
|
| `30818` | Wiki article | [54](54.md) |
|
||||||
| `31922` | Date-Based Calendar Event | [52](52.md) |
|
| `30819` | Redirects | [54](54.md) |
|
||||||
| `31923` | Time-Based Calendar Event | [52](52.md) |
|
| `31890` | Feed | [NUD: Custom Feeds][NUD: Custom Feeds] |
|
||||||
| `31924` | Calendar | [52](52.md) |
|
| `31922` | Date-Based Calendar Event | [52](52.md) |
|
||||||
| `31925` | Calendar Event RSVP | [52](52.md) |
|
| `31923` | Time-Based Calendar Event | [52](52.md) |
|
||||||
| `31989` | Handler recommendation | [89](89.md) |
|
| `31924` | Calendar | [52](52.md) |
|
||||||
| `31990` | Handler information | [89](89.md) |
|
| `31925` | Calendar Event RSVP | [52](52.md) |
|
||||||
| `34235` | Video Event | [71](71.md) |
|
| `31989` | Handler recommendation | [89](89.md) |
|
||||||
| `34236` | Short-form Portrait Video Event | [71](71.md) |
|
| `31990` | Handler information | [89](89.md) |
|
||||||
| `34237` | Video View Event | [71](71.md) |
|
| `34235` | Video Event | [71](71.md) |
|
||||||
| `34550` | Community Definition | [72](72.md) |
|
| `34236` | Short-form Portrait Video Event | [71](71.md) |
|
||||||
| `39000-9` | Group metadata events | [29](29.md) |
|
| `34237` | Video View Event | [71](71.md) |
|
||||||
|
| `34550` | Community Definition | [72](72.md) |
|
||||||
|
| `39000-9` | Group metadata events | [29](29.md) |
|
||||||
|
|
||||||
[NUD: Custom Feeds]: https://wikifreedia.xyz/cip-01/97c70a44366a6535c1
|
[NUD: Custom Feeds]: https://wikifreedia.xyz/cip-01/97c70a44366a6535c1
|
||||||
[nostrocket]: https://github.com/nostrocket/NIPS/blob/main/Problems.md
|
[nostrocket]: https://github.com/nostrocket/NIPS/blob/main/Problems.md
|
||||||
|
@ -232,7 +235,9 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||||
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md) |
|
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md) |
|
||||||
| `a` | coordinates to an event | relay URL | [01](01.md) |
|
| `a` | coordinates to an event | relay URL | [01](01.md) |
|
||||||
| `d` | identifier | -- | [01](01.md) |
|
| `d` | identifier | -- | [01](01.md) |
|
||||||
|
| `-` | -- | -- | [70](70.md) |
|
||||||
| `g` | geohash | -- | [52](52.md) |
|
| `g` | geohash | -- | [52](52.md) |
|
||||||
|
| `h` | group id | -- | [29](29.md) |
|
||||||
| `i` | identity | proof | [39](39.md) |
|
| `i` | identity | proof | [39](39.md) |
|
||||||
| `k` | kind number (string) | -- | [18](18.md), [25](25.md), [72](72.md) |
|
| `k` | kind number (string) | -- | [18](18.md), [25](25.md), [72](72.md) |
|
||||||
| `l` | label, label namespace | -- | [32](32.md) |
|
| `l` | label, label namespace | -- | [32](32.md) |
|
||||||
|
@ -259,7 +264,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||||
| `imeta` | inline metadata | -- | [92](92.md) |
|
| `imeta` | inline metadata | -- | [92](92.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) |
|
| `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) |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user