mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-08 16:18:50 +00:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faefbcd68e | ||
|
|
37f6cbb775 | ||
|
|
2e1c4b0c69 | ||
|
|
f1433e0f0c | ||
|
|
77b9973cb3 | ||
|
|
b06375d164 | ||
|
|
b6c7a25510 | ||
|
|
8e2f3aa60a | ||
|
|
cbdca1e964 | ||
|
|
b303240a2b | ||
|
|
e7777c3031 | ||
|
|
2e652f03d5 | ||
|
|
c945d8bd9d | ||
|
|
05cad663f8 | ||
|
|
4beaae1084 | ||
|
|
2392dfc9a8 | ||
|
|
c5930de107 | ||
|
|
d85f9269ca | ||
|
|
b128ad98ad | ||
|
|
7e3b7cd90c | ||
|
|
56dbb7722c | ||
|
|
108b7f16f9 | ||
|
|
6b566e897c | ||
|
|
749c9b0a2d | ||
|
|
c2020929fb | ||
|
|
08d3eff350 | ||
|
|
b14b9d2120 | ||
|
|
cee6977347 | ||
|
|
a328831a07 | ||
|
|
4b9f13d983 | ||
|
|
ad019ee067 | ||
|
|
7a2de8ab25 | ||
|
|
435147149a | ||
|
|
c88a620fe7 | ||
|
|
ca73c5dd5e | ||
|
|
4216f0bf2f | ||
|
|
cf672b764b | ||
|
|
9f4a4cf9d2 | ||
|
|
a482f47ae4 | ||
|
|
142cb8d655 | ||
|
|
d9400e1e7b | ||
|
|
202e18f2b2 | ||
|
|
5026747008 | ||
|
|
9fa9045d19 | ||
|
|
948ee24775 | ||
|
|
7231035060 | ||
|
|
4cb3ac871f | ||
|
|
280483adc5 | ||
|
|
d8b0e7d757 | ||
|
|
53bd97373b | ||
|
|
e9924bdcde | ||
|
|
def620e1ce | ||
|
|
a9dd557453 | ||
|
|
c1b8d98b26 | ||
|
|
5f27121c98 | ||
|
|
83e9b58401 | ||
|
|
667c700c1c | ||
|
|
ce552554a0 | ||
|
|
71803c21a6 | ||
|
|
67e950a200 |
8
01.md
8
01.md
@@ -4,7 +4,7 @@ NIP-01
|
||||
Basic protocol flow description
|
||||
-------------------------------
|
||||
|
||||
`draft` `mandatory` `author:fiatjaf` `author:distbit` `author:scsibug` `author:kukks` `author:jb55` `author:semisol` `author:cameri` `author:Giszmo`
|
||||
`draft` `mandatory`
|
||||
|
||||
This NIP defines the basic protocol that should be implemented by everybody. New NIPs may add new optional (or mandatory) fields and messages and features to the structures and flows described here.
|
||||
|
||||
@@ -29,9 +29,9 @@ The only object type that exists is the `event`, which has the following format
|
||||
}
|
||||
```
|
||||
|
||||
To obtain the `event.id`, we `sha256` the serialized event. The serialization is done over the UTF-8 JSON-serialized string (with no white space or line breaks) of the following structure:
|
||||
To obtain the `event.id`, we `sha256` the serialized event. The serialization is done over the UTF-8 JSON-serialized string (with no white space or line breaks between the fields) of the following structure:
|
||||
|
||||
```json
|
||||
```
|
||||
[
|
||||
0,
|
||||
<pubkey, as a lowercase hex string>,
|
||||
@@ -150,7 +150,7 @@ Relays can send 4 types of messages, which must also be JSON arrays, according t
|
||||
This NIP defines no rules for how `NOTICE` messages should be sent or treated.
|
||||
|
||||
- `EVENT` messages MUST be sent only with a subscription ID related to a subscription previously initiated by the client (using the `REQ` message above).
|
||||
- `OK` messages MUST be sent in response to `EVENT` messages received from clients, they must have the 3rd parameter set to `true` when an event has been accepted by the relay, `false` otherwise. The 4th parameter MAY be empty when the 3rd is `true`, otherwise it MUST be a string containing a machine-readable single-word prefix followed by a `:` and then a human-readable message. The standardized machine-readable prefixes are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, and `error` for when none of that fits. Some examples:
|
||||
- `OK` messages MUST be sent in response to `EVENT` messages received from clients, they must have the 3rd parameter set to `true` when an event has been accepted by the relay, `false` otherwise. The 4th parameter MUST always be present, but MAY be an empty string when the 3rd is `true`, otherwise it MUST be a string formed by a machine-readable single-word prefix followed by a `:` and then a human-readable message. The standardized machine-readable prefixes are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, and `error` for when none of that fits. Some examples:
|
||||
|
||||
* `["OK", "b1a649ebe8...", true, ""]`
|
||||
* `["OK", "b1a649ebe8...", true, "pow: difficulty 25>=24"]`
|
||||
|
||||
2
02.md
2
02.md
@@ -4,7 +4,7 @@ NIP-02
|
||||
Contact List and Petnames
|
||||
-------------------------
|
||||
|
||||
`final` `optional` `author:fiatjaf` `author:arcbtc`
|
||||
`final` `optional`
|
||||
|
||||
A special event with kind `3`, meaning "contact list" is defined as having a list of `p` tags, one for each of the followed/known profiles one is following.
|
||||
|
||||
|
||||
4
03.md
4
03.md
@@ -4,7 +4,7 @@ NIP-03
|
||||
OpenTimestamps Attestations for Events
|
||||
--------------------------------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf` `author:constant`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](https://opentimestamps.org/) proof for any other event:
|
||||
|
||||
@@ -13,7 +13,6 @@ This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](
|
||||
"kind": 1040
|
||||
"tags": [
|
||||
["e", <event-id>, <relay-url>],
|
||||
["block", <block-height-as-string>, <block-hash>],
|
||||
["alt", "opentimestamps attestation"]
|
||||
],
|
||||
"content": <base64-encoded OTS file data>
|
||||
@@ -21,7 +20,6 @@ This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](
|
||||
```
|
||||
|
||||
- The OpenTimestamps proof MUST prove the referenced `e` event id as its digest.
|
||||
- The `block` tag is optional, it exists to establish a minimum date since which the given event has existed.
|
||||
- The `content` MUST be the full content of an `.ots` file containing at least one Bitcoin attestation. This file SHOULD contain a **single** Bitcoin attestation and no reference to "pending" attestations since they are useless in this context.
|
||||
|
||||
### Example OpenTimestamps proof verification flow
|
||||
|
||||
2
04.md
2
04.md
@@ -4,7 +4,7 @@ NIP-04
|
||||
Encrypted Direct Message
|
||||
------------------------
|
||||
|
||||
`final` `optional` `author:arcbtc`
|
||||
`final` `optional`
|
||||
|
||||
A special event with kind `4`, meaning "encrypted direct message". It is supposed to have the following attributes:
|
||||
|
||||
|
||||
2
05.md
2
05.md
@@ -4,7 +4,7 @@ NIP-05
|
||||
Mapping Nostr keys to DNS-based internet identifiers
|
||||
----------------------------------------------------
|
||||
|
||||
`final` `optional` `author:fiatjaf` `author:mikedilger`
|
||||
`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.
|
||||
|
||||
|
||||
18
06.md
18
06.md
@@ -4,7 +4,7 @@ NIP-06
|
||||
Basic key derivation from mnemonic seed phrase
|
||||
----------------------------------------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
[BIP39](https://bips.xyz/39) is used to generate mnemonic seed words and derive a binary seed from them.
|
||||
|
||||
@@ -13,3 +13,19 @@ Basic key derivation from mnemonic seed phrase
|
||||
A basic client can simply use an `account` of `0` to derive a single key. For more advanced use-cases you can increment `account`, allowing generation of practically infinite keys from the 5-level path with hardened derivation.
|
||||
|
||||
Other types of clients can still get fancy and use other derivation paths for their own other purposes.
|
||||
|
||||
### Test vectors
|
||||
|
||||
mnemonic: leader monkey parrot ring guide accident before fence cannon height naive bean\
|
||||
private key (hex): 7f7ff03d123792d6ac594bfa67bf6d0c0ab55b6b1fdb6249303fe861f1ccba9a\
|
||||
nsec: nsec10allq0gjx7fddtzef0ax00mdps9t2kmtrldkyjfs8l5xruwvh2dq0lhhkp\
|
||||
public key (hex): 17162c921dc4d2518f9a101db33695df1afb56ab82f5ff3e5da6eec3ca5cd917\
|
||||
npub: npub1zutzeysacnf9rru6zqwmxd54mud0k44tst6l70ja5mhv8jjumytsd2x7nu
|
||||
|
||||
---
|
||||
|
||||
mnemonic: what bleak badge arrange retreat wolf trade produce cricket blur garlic valid proud rude strong choose busy staff weather area salt hollow arm fade\
|
||||
private key (hex): c15d739894c81a2fcfd3a2df85a0d2c0dbc47a280d092799f144d73d7ae78add\
|
||||
nsec: nsec1c9wh8xy5eqdzln7n5t0ctgxjcrdug73gp5yj0x03gntn67h83twssdfhel\
|
||||
public key (hex): d41b22899549e1f3d335a31002cfd382174006e166d3e658e3a5eecdb6463573\
|
||||
npub: npub16sdj9zv4f8sl85e45vgq9n7nsgt5qphpvmf7vk8r5hhvmdjxx4es8rq74h
|
||||
|
||||
6
07.md
6
07.md
@@ -4,7 +4,7 @@ NIP-07
|
||||
`window.nostr` capability for web browsers
|
||||
------------------------------------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
The `window.nostr` object may be made available by web browsers or extensions and websites or web-apps may make use of it after checking its availability.
|
||||
|
||||
@@ -12,7 +12,7 @@ That object must define the following methods:
|
||||
|
||||
```
|
||||
async window.nostr.getPublicKey(): string // returns a public key as hex
|
||||
async window.nostr.signEvent(event: Event): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it
|
||||
async window.nostr.signEvent(event: { created_at: number, kind: number, tags: string[][], content: string }): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it
|
||||
```
|
||||
|
||||
Aside from these two basic above, the following functions can also be implemented optionally:
|
||||
@@ -34,3 +34,5 @@ async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext
|
||||
- [TokenPocket](https://www.tokenpocket.pro/) (Android, IOS, Chrome and derivatives)
|
||||
- [Nostrmo](https://github.com/haorendashu/nostrmo_faq#download) (Android, IOS)
|
||||
- [Spring Browser](https://spring.site) (Android)
|
||||
- [nodestr](https://github.com/lightning-digital-entertainment/nodestr) (NodeJS polyfill)
|
||||
- [Nostore](https://apps.apple.com/us/app/nostore/id1666553677) (Safari on iOS/MacOS)
|
||||
|
||||
2
08.md
2
08.md
@@ -6,7 +6,7 @@ NIP-08
|
||||
Handling Mentions
|
||||
-----------------
|
||||
|
||||
`final` `unrecommended` `optional` `author:fiatjaf` `author:scsibug`
|
||||
`final` `unrecommended` `optional`
|
||||
|
||||
This document standardizes the treatment given by clients of inline mentions of other events and pubkeys inside the content of `text_note`s.
|
||||
|
||||
|
||||
2
09.md
2
09.md
@@ -4,7 +4,7 @@ NIP-09
|
||||
Event Deletion
|
||||
--------------
|
||||
|
||||
`draft` `optional` `author:scsibug`
|
||||
`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.
|
||||
|
||||
|
||||
2
10.md
2
10.md
@@ -5,7 +5,7 @@ NIP-10
|
||||
On "e" and "p" tags in Text Events (kind 1).
|
||||
--------------------------------------------
|
||||
|
||||
`draft` `optional` `author:unclebobmartin`
|
||||
`draft` `optional`
|
||||
|
||||
## Abstract
|
||||
This NIP describes how to use "e" and "p" tags in text events, especially those that are replies to other text events. It helps clients thread the replies into a tree rooted at the original event.
|
||||
|
||||
2
11.md
2
11.md
@@ -4,7 +4,7 @@ NIP-11
|
||||
Relay Information Document
|
||||
---------------------------
|
||||
|
||||
`draft` `optional` `author:scsibug` `author:doc-hex` `author:cameri`
|
||||
`draft` `optional`
|
||||
|
||||
Relays may provide server metadata to clients to inform them of capabilities, administrative contacts, and various server attributes. This is made available as a JSON document over HTTP, on the same URI as the relay's websocket.
|
||||
|
||||
|
||||
2
12.md
2
12.md
@@ -4,6 +4,6 @@ NIP-12
|
||||
Generic Tag Queries
|
||||
-------------------
|
||||
|
||||
`final` `mandatory` `author:scsibug` `author:fiatjaf`
|
||||
`final` `mandatory`
|
||||
|
||||
Moved to [NIP-01](01.md).
|
||||
|
||||
2
13.md
2
13.md
@@ -4,7 +4,7 @@ NIP-13
|
||||
Proof of Work
|
||||
-------------
|
||||
|
||||
`draft` `optional` `author:jb55` `author:cameri`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines a way to generate and interpret Proof of Work for nostr notes. Proof of Work (PoW) is a way to add a proof of computational work to a note. This is a bearer proof that all relays and clients can universally validate with a small amount of code. This proof can be used as a means of spam deterrence.
|
||||
|
||||
|
||||
2
14.md
2
14.md
@@ -4,7 +4,7 @@ NIP-14
|
||||
Subject tag in Text events
|
||||
--------------------------
|
||||
|
||||
`draft` `optional` `author:unclebobmartin`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines the use of the "subject" tag in text (kind: 1) events.
|
||||
(implemented in more-speech)
|
||||
|
||||
5
15.md
5
15.md
@@ -4,7 +4,7 @@ NIP-15
|
||||
Nostr Marketplace (for resilient marketplaces)
|
||||
-----------------------------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf` `author:benarc` `author:motorina0` `author:talvasconcelos`
|
||||
`draft` `optional`
|
||||
|
||||
> Based on https://github.com/lnbits/Diagon-Alley
|
||||
|
||||
@@ -88,7 +88,7 @@ Fields that are not self-explanatory:
|
||||
"images": <[String], array of image URLs, optional>,
|
||||
"currency": <String, currency used>,
|
||||
"price": <float, cost of product>,
|
||||
"quantity": <int, available items>,
|
||||
"quantity": <int or null, available items>,
|
||||
"specs": [
|
||||
[<String, spec key>, <String, spec value>]
|
||||
],
|
||||
@@ -102,6 +102,7 @@ Fields that are not self-explanatory:
|
||||
```
|
||||
|
||||
Fields that are not self-explanatory:
|
||||
- `quantity` can be null in the case of items with unlimited abailability, like digital items, or services
|
||||
- `specs`:
|
||||
- an optional array of key pair values. It allows for the Customer UI to present product specifications in a structure mode. It also allows comparison between products
|
||||
- eg: `[["operating_system", "Android 12.0"], ["screen_size", "6.4 inches"], ["connector_type", "USB Type C"]]`
|
||||
|
||||
2
16.md
2
16.md
@@ -4,6 +4,6 @@ NIP-16
|
||||
Event Treatment
|
||||
---------------
|
||||
|
||||
`final` `mandatory` `author:Semisol`
|
||||
`final` `mandatory`
|
||||
|
||||
Moved to [NIP-01](01.md).
|
||||
|
||||
2
18.md
2
18.md
@@ -4,7 +4,7 @@ NIP-18
|
||||
Reposts
|
||||
-------
|
||||
|
||||
`draft` `optional` `author:jb55` `author:fiatjaf` `author:arthurfranca`
|
||||
`draft` `optional`
|
||||
|
||||
A repost is a `kind 6` event that is used to signal to followers
|
||||
that a `kind 1` text note is worth reading.
|
||||
|
||||
21
19.md
21
19.md
@@ -4,7 +4,7 @@ NIP-19
|
||||
bech32-encoded entities
|
||||
-----------------------
|
||||
|
||||
`draft` `optional` `author:jb55` `author:fiatjaf` `author:Semisol`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP standardizes bech32-formatted strings that can be used to display keys, ids and other information in clients. These formats are not meant to be used anywhere in the core protocol, they are only meant for displaying to users, copy-pasting, sharing, rendering QR codes and inputting data.
|
||||
|
||||
@@ -33,9 +33,10 @@ For these events, the contents are a binary-encoded list of `TLV` (type-length-v
|
||||
These are the possible bech32 prefixes with `TLV`:
|
||||
|
||||
- `nprofile`: a nostr profile
|
||||
- `nevent`: a nostr event
|
||||
- `nevent`: a nostr event pointer
|
||||
- `nrelay`: a nostr relay
|
||||
- `naddr`: a nostr _replaceable event_ coordinate
|
||||
- `nreq`: a nostr filter
|
||||
|
||||
These possible standardized `TLV` types are indicated here:
|
||||
|
||||
@@ -46,14 +47,28 @@ These possible standardized `TLV` types are indicated here:
|
||||
- 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.
|
||||
- `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`, `naddr`, `nreq`, _optionally_, a relay in which the entity (profile or event) is more likely to be found, encoded as ascii
|
||||
- this may be included multiple times
|
||||
- `2`: `author`
|
||||
- for `naddr`, the 32 bytes of the pubkey of the event
|
||||
- for `nevent`, _optionally_, the 32 bytes of the pubkey of the event
|
||||
- for `nreq`, _optionally_, 32 bytes of one entry in the `"authors"` field, can be specified multiple times
|
||||
- `3`: `kind`
|
||||
- for `naddr`, the 32-bit unsigned integer of the kind, big-endian
|
||||
- for `nevent`, _optionally_, the 32-bit unsigned integer of the kind, big-endian
|
||||
- for `nreq`, _optionally_, 32-bit unsigned integer representing one entry in the `"kinds"` field, can be specified multiple times
|
||||
- `4`: `id`
|
||||
- for `nreq`, _optionally_, 32 bytes of one entry in the `"authors"` field, can be specified multiple times
|
||||
- `5`: `tag`
|
||||
- for `nreq`, _optionally_, the UTF-8 encoded single-letter of the tag to be searched (the `*` in a `"#*"` field) followed by one entry in this `#*` field, can be specified multiple times
|
||||
- `6`: `limit`
|
||||
- for `nreq`, _optionally_, 32-bit unsigned integer representing the `"limit"` field
|
||||
- `7`: `since`
|
||||
- for `nreq`, _optionally_, 32-bit unsigned integer representing the `"since"` field
|
||||
- `8`: `until`
|
||||
- for `nreq`, _optionally_, 32-bit unsigned integer representing the `"until"` field
|
||||
- `9`: `search`
|
||||
- for `nreq`, _optionally_, the UTF-8 encoded string of the `"search"` field
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
2
20.md
2
20.md
@@ -4,6 +4,6 @@ NIP-20
|
||||
Command Results
|
||||
---------------
|
||||
|
||||
`final` `mandatory` `author:jb55`
|
||||
`final` `mandatory`
|
||||
|
||||
Moved to [NIP-01](01.md).
|
||||
|
||||
2
21.md
2
21.md
@@ -4,7 +4,7 @@ NIP-21
|
||||
`nostr:` URI scheme
|
||||
-------------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP standardizes the usage of a common URI scheme for maximum interoperability and openness in the network.
|
||||
|
||||
|
||||
2
22.md
2
22.md
@@ -4,7 +4,7 @@ NIP-22
|
||||
Event `created_at` Limits
|
||||
-------------------------
|
||||
|
||||
`draft` `optional` `author:jeffthibault` `author:Giszmo`
|
||||
`draft` `optional`
|
||||
|
||||
Relays may define both upper and lower limits within which they will consider an event's `created_at` to be acceptable. Both the upper and lower limits MUST be unix timestamps in seconds as defined in [NIP-01](01.md).
|
||||
|
||||
|
||||
2
23.md
2
23.md
@@ -4,7 +4,7 @@ NIP-23
|
||||
Long-form Content
|
||||
-----------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines `kind:30023` (a _parameterized replaceable event_) for long-form text content, generally referred to as "articles" or "blog posts". `kind:30024` has the same structure as `kind:30023` and is used to save long form drafts.
|
||||
|
||||
|
||||
4
24.md
4
24.md
@@ -4,7 +4,7 @@ NIP-24
|
||||
Extra metadata fields and tags
|
||||
------------------------------
|
||||
|
||||
`draft` `optional` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines extra optional fields added to events.
|
||||
|
||||
@@ -13,7 +13,7 @@ kind 0
|
||||
|
||||
These are extra fields not specified in NIP-01 that may be present in the stringified JSON of metadata events:
|
||||
|
||||
- `display_name`: a bigger name with richer characters than `name`. Implementations should fallback to `name` when this is not available.
|
||||
- `display_name`: an alternative, bigger name with richer characters than `name`. `name` should always be set regardless of the presence of `display_name` in the metadata.
|
||||
- `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.
|
||||
|
||||
|
||||
2
25.md
2
25.md
@@ -5,7 +5,7 @@ NIP-25
|
||||
Reactions
|
||||
---------
|
||||
|
||||
`draft` `optional` `author:jb55`
|
||||
`draft` `optional`
|
||||
|
||||
A reaction is a `kind 7` event that is used to react to other events.
|
||||
|
||||
|
||||
2
26.md
2
26.md
@@ -4,7 +4,7 @@ NIP-26
|
||||
Delegated Event Signing
|
||||
-----
|
||||
|
||||
`draft` `optional` `author:markharding` `author:minds`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines how events can be delegated so that they can be signed by other keypairs.
|
||||
|
||||
|
||||
2
27.md
2
27.md
@@ -4,7 +4,7 @@ NIP-27
|
||||
Text Note References
|
||||
--------------------
|
||||
|
||||
`draft` `optional` `author:arthurfranca` `author:hodlbod` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
This document standardizes the treatment given by clients of inline references of other events and profiles inside the `.content` of any event that has readable text in its `.content` (such as kinds 1 and 30023).
|
||||
|
||||
|
||||
2
28.md
2
28.md
@@ -5,7 +5,7 @@ NIP-28
|
||||
Public Chat
|
||||
-----------
|
||||
|
||||
`draft` `optional` `author:ChristopherDavid` `author:fiatjaf` `author:jb55` `author:Cameri`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines new event kinds for public chat channels, channel messages, and basic client-side moderation.
|
||||
|
||||
|
||||
2
30.md
2
30.md
@@ -4,7 +4,7 @@ NIP-30
|
||||
Custom Emoji
|
||||
------------
|
||||
|
||||
`draft` `optional` `author:alexgleason`
|
||||
`draft` `optional`
|
||||
|
||||
Custom emoji may be added to **kind 0** and **kind 1** events by including one or more `"emoji"` tags, in the form:
|
||||
|
||||
|
||||
2
31.md
2
31.md
@@ -4,7 +4,7 @@ NIP-31
|
||||
Dealing with unknown event kinds
|
||||
--------------------------------
|
||||
|
||||
`draft` `optional` `author:pablof7z` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
When creating a new custom event kind that is part of a custom protocol and isn't meant to be read as text (like `kind:1`), clients should use an `alt` tag to write a short human-readable plaintext summary of what that event is about.
|
||||
|
||||
|
||||
124
32.md
124
32.md
@@ -4,9 +4,32 @@ NIP-32
|
||||
Labeling
|
||||
---------
|
||||
|
||||
`draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay`
|
||||
`draft` `optional`
|
||||
|
||||
A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, from distributed moderation and content recommendations to reviews and ratings.
|
||||
A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases,
|
||||
including distributed moderation, collection management, license assignment, and content classification.
|
||||
|
||||
This NIP introduces two new tags:
|
||||
|
||||
- `L` denotes a label namespace
|
||||
- `l` denotes a label
|
||||
|
||||
Label Namespace Tag
|
||||
----
|
||||
|
||||
An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace
|
||||
(such as an ISO standard) or reverse domain name notation.
|
||||
|
||||
`L` tags are REQUIRED in order to support searching by namespace rather than by a specific tag. The special `ugc`
|
||||
("user generated content") namespace MAY be used when the label content is provided by an end user.
|
||||
|
||||
`L` tags starting with `#` indicate that the label target should be associated with the label's value.
|
||||
This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc.
|
||||
|
||||
Label Tag
|
||||
----
|
||||
|
||||
An `l` tag's value can be any string. `l` tags MUST include a `mark` matching an `L` tag value in the same event.
|
||||
|
||||
Label Target
|
||||
----
|
||||
@@ -16,47 +39,18 @@ labeled: `e`, `p`, `a`, `r`, or `t` tags. This allows for labeling of events, pe
|
||||
or topics respectively. As with NIP-01, a relay hint SHOULD be included when using `e` and
|
||||
`p` tags.
|
||||
|
||||
Label Tag
|
||||
----
|
||||
|
||||
This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace.
|
||||
A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature
|
||||
external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD
|
||||
ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation.
|
||||
|
||||
Namespaces starting with `#` indicate that the label target should be associated with the label's value.
|
||||
This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc.
|
||||
|
||||
Some examples:
|
||||
|
||||
- `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied.
|
||||
- `["l", "<pubkey>", "#p"]` - the publisher thinks the given entity is related to `<pubkey>`
|
||||
- `["l", "IT-MI", "ISO-3166-2"]` - Milano, Italy using ISO 3166-2.
|
||||
- `["l", "VI-hum", "com.example.ontology"]` - Violence toward a human being as defined by ontology.example.com.
|
||||
|
||||
`L` tags containing the label namespaces MUST be included in order to support searching by
|
||||
namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace
|
||||
MAY be used when the label content is provided by an end user.
|
||||
|
||||
`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events
|
||||
with a kind other than 1985, labels refer to the event itself.
|
||||
|
||||
Label Annotations
|
||||
-----
|
||||
|
||||
A label tag MAY include a 4th positional element detailing extra metadata about the label in question. This string
|
||||
should be a json-encoded object. Any key MAY be used, but the following are recommended:
|
||||
|
||||
- `quality` may have a value of 0 to 1. This allows for an absolute, granular scale that can be represented in any way (5 stars, color scale, etc).
|
||||
- `confidence` may have a value of 0 to 1. This indicates the certainty which the author has about their rating.
|
||||
- `context` may be an array of urls (including NIP-21 urls) indicating other context that should be considered when interpreting labels.
|
||||
|
||||
Content
|
||||
-------
|
||||
|
||||
Labels should be short, meaningful strings. Longer discussions, such as for a review, or an
|
||||
explanation of why something was labeled the way it was, should go in the event's `content` field.
|
||||
|
||||
Self-Reporting
|
||||
-------
|
||||
|
||||
`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events
|
||||
with a kind other than 1985, labels refer to the event itself.
|
||||
|
||||
Example events
|
||||
--------------
|
||||
|
||||
@@ -70,38 +64,61 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
|
||||
["l", "permies", "#t"],
|
||||
["p", <pubkey1>, <relay_url>],
|
||||
["p", <pubkey2>, <relay_url>]
|
||||
],
|
||||
"content": "",
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
A review of a relay.
|
||||
A report flagging violence toward a human being as defined by ontology.example.com.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 1985,
|
||||
"tags": [
|
||||
["L", "com.example.ontology"],
|
||||
["l", "relay/review", "com.example.ontology", "{\"quality\": 0.1}"],
|
||||
["r", <relay_url>]
|
||||
],
|
||||
"content": "This relay is full of mean people.",
|
||||
...
|
||||
["l", "VI-hum", "com.example.ontology"],
|
||||
["p", <pubkey1>, <relay_url>],
|
||||
["p", <pubkey2>, <relay_url>]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Publishers can self-label by adding `l` tags to their own non-1985 events.
|
||||
A moderation suggestion for a chat event.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 1985,
|
||||
"tags": [
|
||||
["L", "nip28.moderation"],
|
||||
["l", "approve", "nip28.moderation"],
|
||||
["e", <kind40_event_id>, <relay_url>]
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Assignment of a license to an event.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 1985,
|
||||
"tags": [
|
||||
["L", "license"],
|
||||
["l", "MIT", "license"],
|
||||
["e", <event_id>, <relay_url>]
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author
|
||||
is labeling their note as being related to Milan, Italy using ISO 3166-2.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 1,
|
||||
"tags": [
|
||||
["L", "com.example.ontology"],
|
||||
["l", "IL-frd", "com.example.ontology"]
|
||||
["L", "ISO-3166-2"],
|
||||
["l", "IT-MI", "ISO-3166-2"]
|
||||
],
|
||||
"content": "Send me 100 sats and I'll send you 200 back",
|
||||
...
|
||||
"content": "It's beautiful here in Milan!",
|
||||
}
|
||||
```
|
||||
|
||||
@@ -124,3 +141,8 @@ Vocabularies MAY choose to fully qualify all labels within a namespace (for exam
|
||||
formal vocabularies that should not be confused with another namespace when querying
|
||||
without an `L` tag. For these vocabularies, all labels SHOULD include the namespace
|
||||
(rather than mixing qualified and unqualified labels).
|
||||
|
||||
A good heuristic for whether a use case fits this NIP is whether labels would ever be unique.
|
||||
For example, many events might be labeled with a particular place, topic, or pubkey, but labels
|
||||
with specific values like "John Doe" or "3.18743" are not labels, they are values, and should
|
||||
be handled in some other way.
|
||||
|
||||
2
33.md
2
33.md
@@ -4,6 +4,6 @@ NIP-33
|
||||
Parameterized Replaceable Events
|
||||
--------------------------------
|
||||
|
||||
`final` `mandatory` `author:Semisol` `author:Kukks` `author:Cameri` `author:Giszmo`
|
||||
`final` `mandatory`
|
||||
|
||||
Moved to [NIP-01](01.md).
|
||||
|
||||
2
36.md
2
36.md
@@ -4,7 +4,7 @@ NIP-36
|
||||
Sensitive Content / Content Warning
|
||||
-----------------------------------
|
||||
|
||||
`draft` `optional` `author:fernandolguevara`
|
||||
`draft` `optional`
|
||||
|
||||
The `content-warning` tag enables users to specify if the event's content needs to be approved by readers to be shown.
|
||||
Clients can hide the content until the user acts on it.
|
||||
|
||||
2
38.md
2
38.md
@@ -5,7 +5,7 @@ NIP-38
|
||||
User Statuses
|
||||
--------------
|
||||
|
||||
`draft` `optional` `author:jb55`
|
||||
`draft` `optional`
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
2
39.md
2
39.md
@@ -4,7 +4,7 @@ NIP-39
|
||||
External Identities in Profiles
|
||||
-------------------------------
|
||||
|
||||
`draft` `optional` `author:pseudozach` `author:Semisol`
|
||||
`draft` `optional`
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
2
40.md
2
40.md
@@ -4,7 +4,7 @@ NIP-40
|
||||
Expiration Timestamp
|
||||
-----------------------------------
|
||||
|
||||
`draft` `optional` `author:0xtlt`
|
||||
`draft` `optional`
|
||||
|
||||
The `expiration` tag enables users to specify a unix timestamp at which the message SHOULD be considered expired (by relays and clients) and SHOULD be deleted by relays.
|
||||
|
||||
|
||||
2
42.md
2
42.md
@@ -4,7 +4,7 @@ NIP-42
|
||||
Authentication of clients to relays
|
||||
-----------------------------------
|
||||
|
||||
`draft` `optional` `author:Semisol` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines a way for clients to authenticate to relays by signing an ephemeral event.
|
||||
|
||||
|
||||
2
45.md
2
45.md
@@ -4,7 +4,7 @@ NIP-45
|
||||
Event Counts
|
||||
--------------
|
||||
|
||||
`draft` `optional` `author:staab`
|
||||
`draft` `optional`
|
||||
|
||||
Relays may support the verb `COUNT`, which provides a mechanism for obtaining event counts.
|
||||
|
||||
|
||||
2
46.md
2
46.md
@@ -4,7 +4,7 @@ NIP-46
|
||||
Nostr Connect
|
||||
------------------------
|
||||
|
||||
`draft` `optional` `author:tiero` `author:giowe` `author:vforvalerio87`
|
||||
`draft` `optional`
|
||||
|
||||
## Rationale
|
||||
|
||||
|
||||
2
47.md
2
47.md
@@ -4,7 +4,7 @@ NIP-47
|
||||
Nostr Wallet Connect
|
||||
--------------------
|
||||
|
||||
`draft` `optional` `author:kiwiidb` `author:bumi` `author:semisol` `author:vitorpamplona`
|
||||
`draft` `optional`
|
||||
|
||||
## Rationale
|
||||
|
||||
|
||||
2
48.md
2
48.md
@@ -4,7 +4,7 @@ NIP-48
|
||||
Proxy Tags
|
||||
----------
|
||||
|
||||
`draft` `optional` `author:alexgleason`
|
||||
`draft` `optional`
|
||||
|
||||
Nostr events bridged from other protocols such as ActivityPub can link back to the source object by including a `"proxy"` tag, in the form:
|
||||
|
||||
|
||||
2
50.md
2
50.md
@@ -4,7 +4,7 @@ NIP-50
|
||||
Search Capability
|
||||
-----------------
|
||||
|
||||
`draft` `optional` `author:brugeman` `author:mikedilger` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
9
51.md
9
51.md
@@ -4,7 +4,7 @@ NIP-51
|
||||
Lists
|
||||
-----
|
||||
|
||||
`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus`
|
||||
`draft` `optional`
|
||||
|
||||
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.
|
||||
|
||||
@@ -129,6 +129,7 @@ Then the user would create a 'Categorized Bookmarks' list event like below:
|
||||
| 10001 | Pin |
|
||||
| 30000 | Categorized People |
|
||||
| 30001 | Categorized Bookmarks |
|
||||
| 30002 | Categorized Relay Sets |
|
||||
|
||||
|
||||
### Mute List
|
||||
@@ -145,4 +146,8 @@ An event with kind `30000` is defined as a parameterized replaceable list event
|
||||
|
||||
### 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.
|
||||
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.
|
||||
|
||||
8
52.md
8
52.md
@@ -4,7 +4,7 @@ NIP-52
|
||||
Calendar Events
|
||||
---------------
|
||||
|
||||
`draft` `optional` `author:tyiu`
|
||||
`draft` `optional`
|
||||
|
||||
This specification defines calendar events representing an occurrence at a specific moment or between moments. These calendar events are _parameterized replaceable_ and deletable per [NIP-09](09.md).
|
||||
|
||||
@@ -40,7 +40,7 @@ The list of tags are as follows:
|
||||
"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": "31922",
|
||||
"kind": 31922,
|
||||
"content": "<description of calendar event>",
|
||||
"tags": [
|
||||
["d", "<UUID>"],
|
||||
@@ -98,7 +98,7 @@ The list of tags are as follows:
|
||||
"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": "31923",
|
||||
"kind": 31923,
|
||||
"content": "<description of calendar event>",
|
||||
"tags": [
|
||||
["d", "<UUID>"],
|
||||
@@ -183,7 +183,7 @@ The list of tags are as follows:
|
||||
"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": "31925",
|
||||
"kind": 31925,
|
||||
"content": "<note>",
|
||||
"tags": [
|
||||
["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"],
|
||||
|
||||
2
53.md
2
53.md
@@ -4,7 +4,7 @@ NIP-53
|
||||
Live Activities
|
||||
---------------
|
||||
|
||||
`draft` `optional` `author:vitorpamplona` `author:v0l`
|
||||
`draft` `optional`
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
2
56.md
2
56.md
@@ -5,7 +5,7 @@ NIP-56
|
||||
Reporting
|
||||
---------
|
||||
|
||||
`draft` `optional` `author:jb55`
|
||||
`draft` `optional`
|
||||
|
||||
A report is a `kind 1984` note that is used to report other notes for spam,
|
||||
illegal and explicit content.
|
||||
|
||||
2
57.md
2
57.md
@@ -4,7 +4,7 @@ NIP-57
|
||||
Lightning Zaps
|
||||
--------------
|
||||
|
||||
`draft` `optional` `author:jb55` `author:kieran`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines two new event types for recording lightning payments between users. `9734` is a `zap request`, representing a payer's request to a recipient's lightning wallet for an invoice. `9735` is a `zap receipt`, representing the confirmation by the recipient's lightning wallet that the invoice issued in response to a `zap request` has been paid.
|
||||
|
||||
|
||||
2
58.md
2
58.md
@@ -4,7 +4,7 @@ NIP-58
|
||||
Badges
|
||||
------
|
||||
|
||||
`draft` `optional` `author:cameri`
|
||||
`draft` `optional`
|
||||
|
||||
Three special events are used to define, award and display badges in
|
||||
user profiles:
|
||||
|
||||
17
65.md
17
65.md
@@ -4,11 +4,11 @@ NIP-65
|
||||
Relay List Metadata
|
||||
-------------------
|
||||
|
||||
`draft` `optional` `author:mikedilger` `author:vitorpamplona`
|
||||
`draft` `optional`
|
||||
|
||||
Defines a replaceable event using `kind:10002` to advertise preferred relays for discovering a user's content and receiving fresh content from others.
|
||||
|
||||
The event MUST include a list of `r` tags with relay URIs and a `read` or `write` marker. If the marker is omitted, the relay is used for both purposes.
|
||||
The event MUST include a list of `r` tags with relay URIs and a `read` or `write` marker. Relays marked as `read` / `write` are called READ / WRITE relays, respectively. If the marker is omitted, the relay is used for both purposes.
|
||||
|
||||
The `.content` is not used.
|
||||
|
||||
@@ -23,26 +23,27 @@ The `.content` is not used.
|
||||
],
|
||||
"content": "",
|
||||
...other fields
|
||||
}
|
||||
```
|
||||
|
||||
This NIP doesn't fully replace relay lists that are designed to configure a client's usage of relays (such as `kind:3` style relay lists). Clients MAY use other relay lists in situations where a `kind:10002` relay list cannot be found.
|
||||
|
||||
## When to Use Read and Write
|
||||
## When to Use Read and Write Relays
|
||||
|
||||
When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002`
|
||||
When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002`.
|
||||
|
||||
When seeking events **about** a user, where the user was tagged, Clients SHOULD use the READ relays of the user's `kind:10002`
|
||||
When seeking events **about** a user, where the user was tagged, Clients SHOULD use the READ relays of the user's `kind:10002`.
|
||||
|
||||
When broadcasting an event, Clients SHOULD:
|
||||
|
||||
- Broadcast the event to the WRITE relays of the author
|
||||
- Broadcast the event all READ relays of each tagged user.
|
||||
- Broadcast the event all READ relays of each tagged user
|
||||
|
||||
## Motivation
|
||||
|
||||
The old model of using a fixed relay list per user centralizes in large relay operators:
|
||||
|
||||
- Most users submit their posts to the same highly popular relays, aiming to achieve greater visibility among a broader audience.
|
||||
- Most users submit their posts to the same highly popular relays, aiming to achieve greater visibility among a broader audience
|
||||
- Many users are pulling events from a large number of relays in order to get more data at the expense of duplication
|
||||
- Events are being copied between relays, oftentimes to many different relays
|
||||
|
||||
@@ -52,7 +53,7 @@ This NIP allows Clients to connect directly with the most up-to-date relay set f
|
||||
|
||||
1. Clients SHOULD guide users to keep `kind:10002` lists small (2-4 relays).
|
||||
|
||||
2. Clients SHOULD spread an author's `kind:10002` events to as many relays as viable.
|
||||
2. Clients SHOULD spread an author's `kind:10002` event to as many relays as viable.
|
||||
|
||||
3. `kind:10002` events should primarily be used to advertise the user's preferred relays to others. A user's own client may use other heuristics for selecting relays for fetching data.
|
||||
|
||||
|
||||
2
72.md
2
72.md
@@ -4,7 +4,7 @@ NIP-72
|
||||
Moderated Communities (Reddit Style)
|
||||
------------------------------------
|
||||
|
||||
`draft` `optional` `author:vitorpamplona` `author:arthurfranca`
|
||||
`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.
|
||||
|
||||
|
||||
2
75.md
2
75.md
@@ -2,7 +2,7 @@
|
||||
|
||||
## Zap Goals
|
||||
|
||||
`draft` `optional` `author:verbiricha`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines an event for creating fundraising goals. Users can contribute funds towards the goal by zapping the goal event.
|
||||
|
||||
|
||||
2
78.md
2
78.md
@@ -4,7 +4,7 @@ NIP-78
|
||||
Arbitrary custom app data
|
||||
-------------------------
|
||||
|
||||
`draft` `optional` `author:sandwich` `author:fiatjaf`
|
||||
`draft` `optional`
|
||||
|
||||
The goal of this NIP is to enable [remoteStorage](https://remotestorage.io/)-like capabilities for custom applications that do not care about interoperability.
|
||||
|
||||
|
||||
37
84.md
Normal file
37
84.md
Normal file
@@ -0,0 +1,37 @@
|
||||
NIP-84
|
||||
======
|
||||
|
||||
Highlights
|
||||
----------
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines `kind:9802`, a "highlight" event, to signal content a user finds valuable.
|
||||
|
||||
## Format
|
||||
The `.content` of these events is the highlighted portion of the text.
|
||||
|
||||
`.content` might be empty for highlights of non-text based media (e.g. NIP-94 audio/video).
|
||||
|
||||
### References
|
||||
Events SHOULD tag the source of the highlight, whether nostr-native or not.
|
||||
`a` or `e` tags should be used for nostr events and `r` tags for URLs.
|
||||
|
||||
When tagging a URL, clients generating these events SHOULD do a best effort of cleaning the URL from trackers
|
||||
or obvious non-useful information from the query string.
|
||||
|
||||
### Attribution
|
||||
Clients MAY include one or more `p` tags, tagging the original authors of the material being highlighted; this is particularly
|
||||
useful when highlighting non-nostr content for which the client might be able to get a nostr pubkey somehow
|
||||
(e.g. prompting the user or reading a `<meta name="nostr:nprofile1..." />` tag on the document). A role MAY be included as the
|
||||
last value of the tag.
|
||||
|
||||
```json
|
||||
[ "p", "<pubkey-hex>", "<relay-url>", "author" ],
|
||||
[ "p", "<pubkey-hex>", "<relay-url>", "author" ],
|
||||
[ "p", "<pubkey-hex>", "<relay-url>", "editor" ],
|
||||
```
|
||||
|
||||
### Context
|
||||
Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the
|
||||
surrounding content might be beneficial to give context to the higlight.
|
||||
2
89.md
2
89.md
@@ -4,7 +4,7 @@ NIP-89
|
||||
Recommended Application Handlers
|
||||
--------------------------------
|
||||
|
||||
`draft` `optional` `author:pablof7z`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds.
|
||||
|
||||
|
||||
225
90.md
Normal file
225
90.md
Normal file
@@ -0,0 +1,225 @@
|
||||
NIP-90
|
||||
======
|
||||
|
||||
Data Vending Machine
|
||||
--------------------
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines the interaction between customers and Service Providers for performing on-demand computation.
|
||||
|
||||
Money in, data out.
|
||||
|
||||
## Kinds
|
||||
This NIP reserves the range `5000-7000` for data vending machine use.
|
||||
|
||||
| Kind | Description |
|
||||
| ---- | ----------- |
|
||||
| 5000-5999 | Job request kinds |
|
||||
| 6000-6999 | Job result |
|
||||
| 7000 | Job feedback |
|
||||
|
||||
Job results always use a kind number that is `1000` higher than the job request kind. (e.g. request: `kind:5001` gets a result: `kind:6001`).
|
||||
|
||||
Job request types are defined [separately](https://github.com/nostr-protocol/data-vending-machines/tree/master/kinds).
|
||||
|
||||
## Rationale
|
||||
Nostr can act as a marketplace for data processing, where users request jobs to be processed in certain ways (e.g., "speech-to-text", "summarization", etc.), but they don't necessarily care about "who" processes the data.
|
||||
|
||||
This NIP is not to be confused with a 1:1 marketplace; instead, it describes a flow where a user announces a desired output, willingness to pay, and service providers compete to fulfill the job requirement in the best way possible.
|
||||
|
||||
### Actors
|
||||
There are two actors in the workflow described in this NIP:
|
||||
* Customers (npubs who request a job)
|
||||
* Service providers (npubs who fulfill jobs)
|
||||
|
||||
## Job request (`kind:5000-5999`)
|
||||
A request to process data, published by a customer. This event signals that an customer is interested in receiving the result of some kind of compute.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 5xxx, // kind in 5000-5999 range
|
||||
"content": "",
|
||||
"tags": [
|
||||
[ "i", "<data>", "<input-type>", "<relay>", "<marker>" ],
|
||||
[ "output", "<mime-type>" ],
|
||||
[ "relays", "wss://..." ],
|
||||
[ "bid", "<msat-amount>" ],
|
||||
[ "t", "bitcoin" ]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
All tags are optional.
|
||||
|
||||
* `i` tag: Input data for the job (zero or more inputs)
|
||||
* `<data>`: The argument for the input
|
||||
* `<input-type>`: The way this argument should be interpreted. MUST be one of:
|
||||
* `url`: A URL to be fetched of the data that should be processed.
|
||||
* `event`: A Nostr event ID.
|
||||
* `job`: The output of a previous job with the specified event ID. The dermination of which output to build upon is up to the service provider to decide (e.g. waiting for a signaling from the customer, waiting for a payment, etc.)
|
||||
* `text`: `<data>` is the value of the input, no resolution is needed
|
||||
* `<relay>`: If `event` or `job` input-type, the relay where the event/job was published, otherwise optional or empty string
|
||||
* `<marker>`: An optional field indicating how this input should be used within the context of the job
|
||||
* `output`: Expected output format. Different job request `kind` defines this more precisely.
|
||||
* `param`: Optional parameters for the job as key (first argument)/value (second argument). Different job request `kind` defines this more precisely. (e.g. `[ "param", "lang", "es" ]`)
|
||||
* `bid`: Customer MAY specify a maximum amount (in millisats) they are willing to pay
|
||||
* `relays`: List of relays where Service Providers SHOULD publish responses to
|
||||
* `p`: Service Providers the customer is interested in. Other SPs MIGHT still choose to process the job
|
||||
|
||||
## Encrypted Params
|
||||
|
||||
If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. Add a tag `encrypted` as tags. Encryption for private tags will use [NIP-04 - Encrypted Direct Message encryption](https://github.com/nostr-protocol/nips/blob/master/04.md), using the user's private and service provider's public key for the shared secret
|
||||
|
||||
```json
|
||||
[
|
||||
[ "i", "what is the capital of France? ", "text" ],
|
||||
[ "param", "model", "LLaMA-2" ],
|
||||
[ "param", "max_tokens", "512" ],
|
||||
[ "param", "temperature", "0.5" ],
|
||||
[ "param", "top-k", "50" ],
|
||||
[ "param", "top-p", "0.7" ],
|
||||
[ "param", "frequency_penalty", "1" ]
|
||||
|
||||
]
|
||||
|
||||
```
|
||||
|
||||
This param data will be encrypted and added to the `content` field and `p` tag should be present
|
||||
|
||||
```
|
||||
"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
|
||||
"tags": [
|
||||
["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
|
||||
["encrypted"]
|
||||
]
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Job result (`kind:6000-6999`)
|
||||
|
||||
Service providers publish job results, providing the output of the job result. They should tag the original job request event id as well as the customer's pubkey.
|
||||
|
||||
```json
|
||||
{
|
||||
"pubkey": "<service-provider pubkey>",
|
||||
"content": "<payload>",
|
||||
"kind": 6xxx,
|
||||
"tags": [
|
||||
[ "request", "<job-request>" ],
|
||||
[ "e", "<job-request-id>", "<relay-hint>" ],
|
||||
[ "i", "<input-data>" ],
|
||||
[ "p", "<customer's-pubkey>" ],
|
||||
[ "amount", "requested-payment-amount", "<optional-bolt11>" ]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
* `request`: The job request event stringified-JSON.
|
||||
* `amount`: millisats that the Service Provider is requesting to be paid. An optional third value can be a bolt11 invoice.
|
||||
* `i`: The original input(s) specified in the request.
|
||||
|
||||
## Encrypted Output
|
||||
|
||||
If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text.
|
||||
Add a tag encrypted to mark the output content as `encrypted`
|
||||
```json
|
||||
{
|
||||
"pubkey": "<service-provider pubkey>",
|
||||
"content": "<encrypted payload>",
|
||||
"kind": 6xxx,
|
||||
"tags": [
|
||||
[ "request", "<job-request>" ],
|
||||
[ "e", "<job-request-id>", "<relay-hint>" ],
|
||||
[ "p", "<customer's-pubkey>" ],
|
||||
[ "amount", "requested-payment-amount", "<optional-bolt11>" ],
|
||||
["encrypted"]
|
||||
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Job feedback
|
||||
Service providers can give feedback about a job back to the customer.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 7000,
|
||||
"content": "<empty-or-payload>",
|
||||
"tags": [
|
||||
[ "status", "<status>", "<extra-info>" ],
|
||||
[ "amount", "requested-payment-amount", "<bolt11>" ],
|
||||
[ "e", "<job-request-id>", "<relay-hint>" ],
|
||||
[ "p", "<customer's-pubkey>" ],
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
* `content`: Either empty or a job-result (e.g. for partial-result samples)
|
||||
* `amount` tag: as defined in the [Job Result](#job-result) section.
|
||||
* `status` tag: Service Providers SHOULD indicate what this feedback status refers to. [Appendix 1](#appendix-1-job-feedback-status) defines status. Extra human-readable information can be added as an extra argument.
|
||||
|
||||
* NOTE: If the input params requires input to be encryped, then `content` field will have encrypted payload with `p` tag as key.
|
||||
|
||||
### Job feedback status
|
||||
|
||||
| status | description |
|
||||
|--------|-------------|
|
||||
| `payment-required` | Service Provider requires payment before continuing. |
|
||||
| `processing` | Service Provider is processing the job. |
|
||||
| `error` | Service Provider was unable to process the job. |
|
||||
| `success` | Service Provider successfully processed the job. |
|
||||
| `partial` | Service Provider partially processed the job. The `.content` might include a sample of the partial results. |
|
||||
|
||||
Any job feedback event MIGHT include results in the `.content` field, as described in the [Job Result](#job-result) section. This is useful for service providers to provide a sample of the results that have been processed so far.
|
||||
|
||||
|
||||
# Protocol Flow
|
||||
* Customer publishes a job request (e.g. `kind:5000` speech-to-text).
|
||||
* Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.).
|
||||
* Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event.
|
||||
* At any point, if there is an `amount` pending to be paid as instructed by the service provider, the user can pay the included `bolt11` or zap the job result event the service provider has sent to the user
|
||||
|
||||
Job feedback (`kind:7000`) and Job Results (`kind:6000-6999`) events MAY include an `amount` tag, this can be interpreted as a suggestion to pay. Service Providers MUST use the `payment-required` feedback event to signal that a payment is required and no further actions will be performed until the payment is sent.
|
||||
|
||||
Customers can always either pay the included `bolt11` invoice or zap the event requesting the payment and service providers should monitor for both if they choose to include a bolt11 invoice.
|
||||
|
||||
## Notes about the protocol flow
|
||||
The flow is deliberately ambiguous, allowing vast flexibility for the interaction between customers and service providers so that service providers can model their behavior based on their own decisions/perceptions of risk.
|
||||
|
||||
Some service providers might choose to submit a `payment-required` as the first reaction before sending a `processing` or before delivering results, some might choose to serve partial results for the job (e.g. a sample), send a `payment-required` to deliver the rest of the results, and some service providers might choose to assess likelihood of payment based on an npub's past behavior and thus serve the job results before requesting payment for the best possible UX.
|
||||
|
||||
It's not up to this NIP to define how individual vending machines should choose to run their business.
|
||||
|
||||
# Cancellation
|
||||
A job request might be cancelled by publishing a `kind:5` delete request event tagging the job request event.
|
||||
|
||||
# Appendix 1: Job chaining
|
||||
A Customer MAY request multiple jobs to be processed as a chain, where the output of a job is the input of another job. (e.g. podcast transcription -> summarization of the transcription). This is done by specifying as input an event id of a different job with the `job` type.
|
||||
|
||||
Service Providers MAY begin processing a subsequent job the moment they see the prior job's result, but they will likely wait for a zap to be published first. This introduces a risk that Service Provider of job #1 might delay publishing the zap event in order to have an advantage. This risk is up to Service Providers to mitigate or to decide whether the service provider of job #1 tends to have good-enough results so as to not wait for an explicit zap to assume the job was accepted.
|
||||
|
||||
This gives a higher level of flexibility to service providers (which sophisticated service providers would take anyway).
|
||||
|
||||
# Appendix 2: Service provider discoverability
|
||||
Service Providers MAY use NIP-89 announcements to advertise their support for job kinds:
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 31990,
|
||||
"pubkey": "<pubkey>",
|
||||
"content": "{
|
||||
\"name\": \"Translating DVM\",
|
||||
\"about\": \"I'm a DVM specialized in translating Bitcoin content.\"
|
||||
}",
|
||||
"tags": [
|
||||
[ "k", "5005" ], // e.g. translation
|
||||
[ "t", "bitcoin" ] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Customers can use NIP-89 to see what service providers their follows use.
|
||||
2
94.md
2
94.md
@@ -4,7 +4,7 @@ NIP-94
|
||||
File Metadata
|
||||
-------------
|
||||
|
||||
`draft` `optional` `author:frbitten` `author:kieran` `author:lovvtide` `author:fiatjaf` `author:staab`
|
||||
`draft` `optional`
|
||||
|
||||
The purpose of this NIP is to allow an organization and classification of shared files. So that relays can filter and organize in any way that is of interest. With that, multiple types of filesharing clients can be created. NIP-94 support is not expected to be implemented by "social" clients that deal with kind:1 notes or by longform clients that deal with kind:30023 articles.
|
||||
|
||||
|
||||
2
98.md
2
98.md
@@ -4,7 +4,7 @@ NIP-98
|
||||
HTTP Auth
|
||||
-------------------------
|
||||
|
||||
`draft` `optional` `author:kieran` `author:melvincarvalho`
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines an ephemeral event used to authorize requests to HTTP servers using nostr events.
|
||||
|
||||
|
||||
2
99.md
2
99.md
@@ -2,7 +2,7 @@
|
||||
|
||||
## Classified Listings
|
||||
|
||||
`draft` `optional` `author:erskingardner`
|
||||
`draft` `optional`
|
||||
|
||||
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.
|
||||
|
||||
|
||||
121
README.md
121
README.md
@@ -7,12 +7,12 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
|
||||
- [List](#list)
|
||||
- [Event Kinds](#event-kinds)
|
||||
- [Event Kind Ranges](#event-kind-ranges)
|
||||
- [Message Types](#message-types)
|
||||
- [Client to Relay](#client-to-relay)
|
||||
- [Relay to Client](#relay-to-client)
|
||||
- [Standardized Tags](#standardized-tags)
|
||||
- [Criteria for acceptance of NIPs](#criteria-for-acceptance-of-nips)
|
||||
- [Mailing Lists](#mailing-lists)
|
||||
- [License](#license)
|
||||
|
||||
---
|
||||
@@ -66,69 +66,74 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
- [NIP-72: Moderated Communities](72.md)
|
||||
- [NIP-75: Zap Goals](75.md)
|
||||
- [NIP-78: Application-specific data](78.md)
|
||||
- [NIP-84: Highlights](84.md)
|
||||
- [NIP-89: Recommended Application Handlers](89.md)
|
||||
- [NIP-90: Data Vending Machines](90.md)
|
||||
- [NIP-94: File Metadata](94.md)
|
||||
- [NIP-98: HTTP Auth](98.md)
|
||||
- [NIP-99: Classified Listings](99.md)
|
||||
|
||||
## Event Kinds
|
||||
|
||||
| kind | description | NIP |
|
||||
| ------- | -------------------------- | ----------- |
|
||||
| `0` | Metadata | [1](01.md) |
|
||||
| `1` | Short Text Note | [1](01.md) |
|
||||
| `2` | Recommend Relay | |
|
||||
| `3` | Contacts | [2](02.md) |
|
||||
| `4` | Encrypted Direct Messages | [4](04.md) |
|
||||
| `5` | Event Deletion | [9](09.md) |
|
||||
| `6` | Repost | [18](18.md) |
|
||||
| `7` | Reaction | [25](25.md) |
|
||||
| `8` | Badge Award | [58](58.md) |
|
||||
| `16` | Generic Repost | [18](18.md) |
|
||||
| `40` | Channel Creation | [28](28.md) |
|
||||
| `41` | Channel Metadata | [28](28.md) |
|
||||
| `42` | Channel Message | [28](28.md) |
|
||||
| `43` | Channel Hide Message | [28](28.md) |
|
||||
| `44` | Channel Mute User | [28](28.md) |
|
||||
| `1063` | File Metadata | [94](94.md) |
|
||||
| `1311` | Live Chat Message | [53](53.md) |
|
||||
| `1040` | OpenTimestamps | [03](03.md) |
|
||||
| `1984` | Reporting | [56](56.md) |
|
||||
| `1985` | Label | [32](32.md) |
|
||||
| `4550` | Community Post Approval | [72](72.md) |
|
||||
| `9041` | Zap Goal | [75](75.md) |
|
||||
| `9734` | Zap Request | [57](57.md) |
|
||||
| `9735` | Zap | [57](57.md) |
|
||||
| `10000` | Mute List | [51](51.md) |
|
||||
| `10001` | Pin List | [51](51.md) |
|
||||
| `10002` | Relay List Metadata | [65](65.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` | 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) |
|
||||
| `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) |
|
||||
| `30024` | Draft Long-form Content | [23](23.md) |
|
||||
| `30078` | Application-specific Data | [78](78.md) |
|
||||
| `30311` | Live Event | [53](53.md) |
|
||||
| `30315` | User Statuses | [38](38.md) |
|
||||
| `30402` | Classified Listing | [99](99.md) |
|
||||
| `30403` | Draft Classified Listing | [99](99.md) |
|
||||
| `31922` | Date-Based Calendar Event | [52](52.md) |
|
||||
| `31923` | Time-Based Calendar Event | [52](52.md) |
|
||||
| `31924` | Calendar | [52](52.md) |
|
||||
| `31925` | Calendar Event RSVP | [52](52.md) |
|
||||
| `31989` | Handler recommendation | [89](89.md) |
|
||||
| `31990` | Handler information | [89](89.md) |
|
||||
| `34550` | Community Definition | [72](72.md) |
|
||||
|
||||
| kind | description | NIP |
|
||||
| ------------- | -------------------------- | ----------- |
|
||||
| `0` | Metadata | [1](01.md) |
|
||||
| `1` | Short Text Note | [1](01.md) |
|
||||
| `2` | Recommend Relay | |
|
||||
| `3` | Contacts | [2](02.md) |
|
||||
| `4` | Encrypted Direct Messages | [4](04.md) |
|
||||
| `5` | Event Deletion | [9](09.md) |
|
||||
| `6` | Repost | [18](18.md) |
|
||||
| `7` | Reaction | [25](25.md) |
|
||||
| `8` | Badge Award | [58](58.md) |
|
||||
| `16` | Generic Repost | [18](18.md) |
|
||||
| `40` | Channel Creation | [28](28.md) |
|
||||
| `41` | Channel Metadata | [28](28.md) |
|
||||
| `42` | Channel Message | [28](28.md) |
|
||||
| `43` | Channel Hide Message | [28](28.md) |
|
||||
| `44` | Channel Mute User | [28](28.md) |
|
||||
| `1063` | File Metadata | [94](94.md) |
|
||||
| `1311` | Live Chat Message | [53](53.md) |
|
||||
| `1040` | OpenTimestamps | [03](03.md) |
|
||||
| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) |
|
||||
| `1984` | Reporting | [56](56.md) |
|
||||
| `1985` | Label | [32](32.md) |
|
||||
| `4550` | Community Post Approval | [72](72.md) |
|
||||
| `5000`-`5999` | Job Request | [90](90.md) |
|
||||
| `6000`-`6999` | Job Result | [90](90.md) |
|
||||
| `7000` | Job Feedback | [90](90.md) |
|
||||
| `9041` | Zap Goal | [75](75.md) |
|
||||
| `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) |
|
||||
| `10002` | Relay List Metadata | [65](65.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` | 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) |
|
||||
| `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) |
|
||||
| `30024` | Draft Long-form Content | [23](23.md) |
|
||||
| `30078` | Application-specific Data | [78](78.md) |
|
||||
| `30311` | Live Event | [53](53.md) |
|
||||
| `30315` | User Statuses | [38](38.md) |
|
||||
| `30402` | Classified Listing | [99](99.md) |
|
||||
| `30403` | Draft Classified Listing | [99](99.md) |
|
||||
| `31922` | Date-Based Calendar Event | [52](52.md) |
|
||||
| `31923` | Time-Based Calendar Event | [52](52.md) |
|
||||
| `31924` | Calendar | [52](52.md) |
|
||||
| `31925` | Calendar Event RSVP | [52](52.md) |
|
||||
| `31989` | Handler recommendation | [89](89.md) |
|
||||
| `31990` | Handler information | [89](89.md) |
|
||||
| `34550` | Community Definition | [72](72.md) |
|
||||
|
||||
## Message types
|
||||
|
||||
|
||||
Reference in New Issue
Block a user