Compare commits

...

66 Commits

Author SHA1 Message Date
fiatjaf
594c33bed0 rename "claim"=>"code", get rid of kind 9006 (just use 9000), add a paragraph explaining moderation. 2024-10-21 13:45:51 -03:00
fiatjaf
765daceaa1 remove invites, simplify group metadata edits, rework fine-grained "permissions" into unspecified "roles". 2024-09-18 22:27:03 -03:00
fiatjaf
e61651ac06 nip29: make @staab happier. 2024-09-13 08:39:47 -03:00
Zig Blathazar
37a02e817b custom emojis in reactions (#1492) 2024-09-12 10:15:47 -03:00
hodlbod
8a427ea6d6 Merge pull request #1488 from kehiy/md
make *.md linguist detectable.
2024-09-11 06:24:31 -07:00
kehiy
d8ab9849b3 make *.md linguist detectable. 2024-09-11 13:17:16 +03:30
hodlbod
97a42449a8 Merge pull request #1487 from ZigBalthazar/patch-1
Update 10.md
2024-09-10 14:19:48 -07:00
Zig Blathazar
c343175a32 Update 10.md 2024-09-10 23:37:36 +03:30
Jon Staab
e7eb776288 Revert example code update 2024-09-09 17:41:57 -03:00
Asai Toshiya
7edd3d23a9 README: update kinds table 2024-09-10 00:32:25 +09:00
hodlbod
c02b161d9e Merge pull request #1477 from kehiy/jsonc
format(all): JSON formatting
2024-09-03 13:56:56 -07:00
K
c8dc1eadff Update 96.md 2024-09-03 23:47:11 +03:30
kehiy
e6552476aa format(all): json formatting 2024-09-03 20:41:31 +03:30
fiatjaf
378dfaa5db nip54: remove markdown leftovers. 2024-09-03 14:07:46 -03:00
Vitor Pamplona
a928d11fb5 Merge pull request #1466 from paulmillr/patch-2
nip44: clarify ecdh hashing
2024-09-03 08:37:21 -04:00
kehiy
b4a2561df7 style: fix header styles in same format 2024-09-02 22:51:48 -03:00
Silberengel
14ec14dac9 Missing events added to README, including NKBIP-01 and NKBIP-02 (#1464)
* Missing events added to README, including NKBIP-01 and NKBIP-02

* Just format

* kind conflict resolved, 2nd blossom kind added

* Revert "kind conflict resolved, 2nd blossom kind added"

This reverts commit 5a8ecc0c27.

* formatting changes merged, kind conflict resolved, 2nd blossom kind added

* relay reviews

---------

Co-authored-by: Asai Toshiya <to.asai.60@gmail.com>
Co-authored-by: fiatjaf_ <fiatjaf@gmail.com>
2024-09-02 22:51:07 -03:00
Paul Miller
be17e5dcd9 Clarify function name in libsecp256k1 2024-09-01 16:13:12 +02:00
Paul Miller
1002104ece nip44: clarify ecdh hashing 2024-09-01 00:44:30 +02:00
hodlbod
24e97c2539 Merge pull request #1333 from coracle-social/clarify-nip01
Clarify what happens when a duplicate subscription is sent, remove CLOSED on duplicate subscription
2024-08-31 06:45:41 -07:00
hodlbod
8184749f5b Merge pull request #1455 from dtonon/nip05-note
NIP-05: add identification vs verification note
2024-08-29 08:30:02 -07:00
dtonon
da34c57e99 NIP-05: add identification vs verification note 2024-08-29 16:37:02 +02:00
Vitor Pamplona
fade0164f5 Merge pull request #1445 from bezysoftware/patch-3
NIP-17 Fix kind number
2024-08-25 16:57:35 -04:00
Tomas Bezouska
27c67f0c71 Update 17.md 2024-08-25 22:55:25 +02:00
Asai Toshiya
c7a357285d BREAKING.md: add changes 2024-08-21 23:27:27 +09:00
fiatjaf
b3c1a56269 nip13: remove section about pow prefix querying.
prefix searching was removed from the spec.
2024-08-20 15:42:40 -03:00
fiatjaf_
ca3c52e3e7 rename "parameterized replaceable event" to "addressable event" (#1418) 2024-08-20 12:56:05 -03:00
Alex Gleason
d0962aac09 Merge pull request #1428 from alexgleason/hashtag
Define the `t` tag in NIP-24
2024-08-20 09:43:58 -05:00
Alex Gleason
e30eb40eef NIP-24: t-tag only has to be a lowercase string 2024-08-20 09:42:59 -05:00
Asai Toshiya
61d251b3a4 Merge pull request #1172 from SnowCait/kind-mute-sets
Kind mute sets
2024-08-20 19:28:17 +09:00
fiatjaf
3aff37bd4b nip54: change to asciidoc, markdown is trash. 2024-08-18 15:01:37 -03:00
sepehr-safari
62ac522333 add kind 9022 for leave request 2024-08-18 15:01:00 -03:00
sepehr-safari
055101786b add kind 9008 for deleting a group 2024-08-18 15:01:00 -03:00
Alex Gleason
1d3744784c Define the t tag in NIP-24 2024-08-15 20:28:53 -05:00
Alex Gleason
2c7e2af15f Merge pull request #1425 from tyiu/rename-delete-to-retract
Update NIP-09 to rename to deletion request
2024-08-15 16:34:52 -05:00
Terry Yiu
0ee877275a Update NIP-09 to rename to deletion request 2024-08-15 01:19:07 -04:00
Terry Yiu
95885afe2d Update NIP-09 to rename deletion to retraction 2024-08-14 20:08:41 -04:00
hodlbod
645a562a8b Merge pull request #1424 from AsaiToshiya/AsaiToshiya-patch-26
README: add NIP-52 link to `image` and `summary` tags
2024-08-14 08:38:24 -07:00
Asai Toshiya
452fcc05a0 README: add NIP-52 link to image and summary tags 2024-08-14 23:44:30 +09:00
hodlbod
f8e108e61d Merge pull request #1414 from tyiu/nip52-rsvp-e-and-p-tags
Amend NIP-52 to include e and p tags to calendar event RSVPs
2024-08-12 08:40:57 -07:00
fiatjaf_
ed15e318f4 Merge pull request #1094 from theborakompanioni/nip-64
NIP-64: Chess (Portable Game Notation)
2024-08-12 10:42:52 -03:00
theborakompanioni
5d37fea585 docs(NIP-64): add chess to title
make clear that the nip is about chess
2024-08-12 13:27:41 +02:00
theborakompanioni
e735ef9aef docs(NIP-64): change kind from 30 to 64 2024-08-12 13:26:23 +02:00
theborakompanioni
653642205e docs(NIP-64): move examples section to bottom 2024-08-12 13:26:23 +02:00
theborakompanioni
d476dea62f docs(NIP-64): remove FEN tags 2024-08-12 13:26:23 +02:00
theborakompanioni
e444914668 docs(NIP-64): Portable Game Notation 2024-08-12 13:26:22 +02:00
Terry Yiu
ec1f0fcada Update NIP-52 change to not be backwards incompatible by restoring required 'a' tag and clarify how clients should or may interpret the optional 'e' tag 2024-08-11 15:50:39 -04:00
Don
744bce8fca NIP-25: reactions to a website (#1381)
* NIP-25: reactions to a website

* add note about URL normalization

---------

Co-authored-by: fiatjaf_ <fiatjaf@gmail.com>
2024-08-08 12:36:08 -03:00
Terry Yiu
d36b24c82a Revise NIP-52 amendments so that they are backwards compatible 2024-08-08 01:04:25 -04:00
Terry Yiu
8d451b3dc3 Merge remote-tracking branch 'upstream/master' into nip52-rsvp-e-and-p-tags 2024-08-07 23:44:28 -04:00
Vic
6de688f459 Add used fields to Calendar Time Event in NIP-52 (#1137)
* Add used fields to Calendar Time Event in NIP-52

Cornychat.com relies on a `t` tag of `audiospace` for filtering.  Flockstr.com relies on optional and previously undocumented `audio` and `image` tags for rendering.

* Update 52.md

* Change tag for `about` to `summary`
2024-08-07 17:45:21 +09:00
Terry Yiu
dea4bebf4b Amend NIP-52 to include e and p tags to calendar event RSVPs 2024-08-06 23:55:47 -04:00
hodlbod
738c4809a1 Merge pull request #1185 from MerryOscar/external-content-ids
NIP-73 - External Content IDs
2024-08-06 09:34:24 -07:00
hodlbod
5f651db43f Merge pull request #1412 from haorendashu/remove-nip45-code-block-type
remove nip45 code block type
2024-08-06 06:42:21 -07:00
haorendashu
5277ee76be remove nip45 code block type
remove nip45 code block type and then code will not highlight error.
2024-08-06 21:03:40 +08:00
Oscar Merry
4d9eb32dc9 Use NIP-73 2024-08-05 23:51:04 +01:00
Oscar Merry
14c3310039 Add Podcast Publisher GUID 2024-08-05 23:16:49 +01:00
Oscar Merry
29eec055c2 Merge branch 'nostr-protocol:master' into external-content-ids 2024-08-05 23:08:41 +01:00
Jon Staab
f6b08429a2 Clarify what happens when a duplicate subscription is sent, remove CLOSED on duplicate subscription 2024-06-27 17:00:16 -07:00
Oscar Merry
13b830d228 Add Optional URL Hints 2024-06-17 13:45:06 +01:00
Oscar Merry
45351b561d Merge branch 'nostr-protocol:master' into external-content-ids 2024-06-17 13:38:45 +01:00
Oscar Merry
32004283da Merge branch 'master' into external-content-ids 2024-05-20 11:12:03 +01:00
Oscar Merry
d33b223c6a Remove Media Type Prefix 2024-05-16 20:44:45 +01:00
Oscar Merry
b7bb46ac03 Use ISANs for Movies, Include Actual Examples 2024-05-09 12:27:43 +01:00
Oscar Merry
280eb498e0 Draft External Content IDs 2024-04-19 14:30:45 +01:00
雪猫
e97df14103 Kind mute sets 2024-04-13 12:39:24 +09:00
54 changed files with 714 additions and 340 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.md linguist-detectable

7
01.md
View File

@@ -78,8 +78,8 @@ This NIP defines 3 standard tags that can be used across all event kinds with th
- The `e` tag, used to refer to an event: `["e", <32-bytes lowercase hex of the id of another event>, <recommended relay URL, optional>]`
- The `p` tag, used to refer to another user: `["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>]`
- The `a` tag, used to refer to a (maybe parameterized) replaceable event
- for a parameterized replaceable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>, <recommended relay URL, optional>]`
- for a non-parameterized replaceable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:, <recommended relay URL, optional>]`
- for an addressable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>, <recommended relay URL, optional>]`
- for a normal replaceable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:, <recommended relay URL, optional>]`
As a convention, all single-letter (only english alphabet letters: a-z, A-Z) key tags are expected to be indexed by relays, such that it is possible, for example, to query or subscribe to events that reference the event `"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"` by using the `{"#e": ["5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"]}` filter.
@@ -131,7 +131,7 @@ Clients can send 3 types of messages, which must be JSON arrays, according to th
}
```
Upon receiving a `REQ` message, the relay SHOULD query its internal database and return events that match the filter, then store that filter and send again all future events it receives to that same websocket until the websocket is closed. The `CLOSE` event is received with the same `<subscription_id>` or a new `REQ` is sent using the same `<subscription_id>`, in which case relay MUST overwrite the previous subscription.
Upon receiving a `REQ` message, the relay SHOULD return events that match the filter. Any new events it receives SHOULD be sent to that same websocket until the connection is closed, a `CLOSE` event is received with the same `<subscription_id>`, or a new `REQ` is sent using the same `<subscription_id>` (in which case a new subscription is created, replacing the old one).
Filter attributes containing lists (`ids`, `authors`, `kinds` and tag filters like `#e`) are JSON arrays with one or more values. At least one of the arrays' values must match the relevant field in an event for the condition to be considered a match. For scalar event attributes such as `authors` and `kind`, the attribute from the event must be contained in the filter list. In the case of tag attributes such as `#e`, for which an event may have multiple values, the event and filter condition values must have at least one item in common.
@@ -169,7 +169,6 @@ This NIP defines no rules for how `NOTICE` messages should be sent or treated.
* `["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"]`
* `["OK", "b1a649ebe8...", false, "error: could not connect to the database"]`
- `CLOSED` messages MUST be sent in response to a `REQ` when the relay refuses to fulfill it. It can also be sent when a relay decides to kill a subscription on its side before a client has disconnected or sent a `CLOSE`. This message uses the same pattern of `OK` messages with the machine-readable prefix and human-readable message. Some examples:
* `["CLOSED", "sub1", "duplicate: sub1 already opened"]`
* `["CLOSED", "sub1", "unsupported: filter contains unknown elements"]`
* `["CLOSED", "sub1", "error: could not connect to the database"]`
* `["CLOSED", "sub1", "error: shutting down idle subscription"]`

4
02.md
View File

@@ -14,7 +14,7 @@ The `.content` is not used.
For example:
```json
```jsonc
{
"kind": 3,
"tags": [
@@ -23,7 +23,7 @@ For example:
["p", "612ae..e610f", "ws://carolrelay.com/ws", "carol"]
],
"content": "",
...other fields
// other fields...
}
```

17
05.md
View File

@@ -16,12 +16,12 @@ The result should be a JSON document object with a key `"names"` that should the
If a client sees an event like this:
```json
```jsonc
{
"pubkey": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9",
"kind": 0,
"content": "{\"name\": \"bob\", \"nip05\": \"bob@example.com\"}"
...
// other fields...
}
```
@@ -58,6 +58,15 @@ A client may implement support for finding users' public keys from _internet ide
## Notes
### Identification, not verification
The NIP-05 is not intended to _verify_ a user, but only to _identify_ them, for the purpose of facilitating the exchange of a contact or their search.
Exceptions are people who own (e.g., a company) or are connected (e.g., a project) to a well-known domain, who can exploit NIP-05 as an attestation of their relationship with it, and thus to the organization behind it, thereby gaining an element of trust.
### User discovery implementation suggestion
A client can use this to allow users to search other profiles. If a client has a search box or something like that, a user may be able to type "bob@example.com" there and the client would recognize that and do the proper queries to obtain a pubkey and suggest that to the user.
### Clients must always follow public keys, not NIP-05 addresses
For example, if after finding that `bob@bob.com` has the public key `abc...def`, the user clicks a button to follow that profile, the client must keep a primary reference to `abc...def`, not `bob@bob.com`. If, for any reason, the address `https://bob.com/.well-known/nostr.json?name=bob` starts returning the public key `1d2...e3f` at any time in the future, the client must not replace `abc...def` in his list of followed profiles for the user (but it should stop displaying "bob@bob.com" for that user, as that will have become an invalid `"nip05"` property).
@@ -66,10 +75,6 @@ For example, if after finding that `bob@bob.com` has the public key `abc...def`,
Keys must be returned in hex format. Keys in NIP-19 `npub` format are only meant to be used for display in client UIs, not in this NIP.
### User Discovery implementation suggestion
A client can also use this to allow users to search other profiles. If a client has a search box or something like that, a user may be able to type "bob@example.com" there and the client would recognize that and do the proper queries to obtain a pubkey and suggest that to the user.
### Showing just the domain as an identifier
Clients may treat the identifier `_@domain` as the "root" identifier, and choose to display it as just the `<domain>`. For example, if Bob owns `bob.com`, he may not want an identifier like `bob@bob.com` as that is redundant. Instead, Bob can use the identifier `_@bob.com` and expect Nostr clients to show and treat that as just `bob.com` for all purposes.

30
09.md
View File

@@ -1,18 +1,18 @@
NIP-09
======
Event Deletion
--------------
Event Deletion Request
----------------------
`draft` `optional`
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.
A special event with kind `5`, meaning "deletion request" 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 requested 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 request.
For example:
```
```jsonc
{
"kind": 5,
"pubkey": <32-bytes hex-encoded public key of the event creator>,
@@ -24,28 +24,30 @@ For example:
["k", "30023"]
],
"content": "these posts were published by accident",
...other fields
// other fields...
}
```
Relays SHOULD delete or stop publishing any referenced events that have an identical `pubkey` as the deletion request. Clients SHOULD hide or otherwise indicate a deletion status for referenced events.
Relays SHOULD delete or stop publishing any referenced events that have an identical `pubkey` as the deletion request. Clients SHOULD hide or otherwise indicate a deletion request status for referenced events.
Relays SHOULD continue to publish/share the deletion events indefinitely, as clients may already have the event that's intended to be deleted. Additionally, clients SHOULD broadcast deletion events to other relays which don't have it.
Relays SHOULD continue to publish/share the deletion request events indefinitely, as clients may already have the event that's intended to be deleted. Additionally, clients SHOULD broadcast deletion request events to other relays which don't have it.
When an `a` tag is used, relays SHOULD delete all versions of the replaceable event up to the `created_at` timestamp of the deletion event.
When an `a` tag is used, relays SHOULD delete all versions of the replaceable event up to the `created_at` timestamp of the deletion request event.
## Client Usage
Clients MAY choose to fully hide any events that are referenced by valid deletion events. This includes text notes, direct messages, or other yet-to-be defined event kinds. Alternatively, they MAY show the event along with an icon or other indication that the author has "disowned" the event. The `content` field MAY also be used to replace the deleted events' own content, although a user interface should clearly indicate that this is a deletion reason, not the original content.
Clients MAY choose to fully hide any events that are referenced by valid deletion request events. This includes text notes, direct messages, or other yet-to-be defined event kinds. Alternatively, they MAY show the event along with an icon or other indication that the author has "disowned" the event. The `content` field MAY also be used to replace the deleted events' own content, although a user interface should clearly indicate that this is a deletion request reason, not the original content.
A client MUST validate that each event `pubkey` referenced in the `e` tag of the deletion request is identical to the deletion request `pubkey`, before hiding or deleting any event. Relays can not, in general, perform this validation and should not be treated as authoritative.
Clients display the deletion event itself in any way they choose, e.g., not at all, or with a prominent notice.
Clients display the deletion request event itself in any way they choose, e.g., not at all, or with a prominent notice.
Clients MAY choose to inform the user that their request for deletion does not guarantee deletion because it is impossible to delete events from all relays and clients.
## Relay Usage
Relays MAY validate that a deletion event only references events that have the same `pubkey` as the deletion itself, however this is not required since relays may not have knowledge of all referenced events.
Relays MAY validate that a deletion request event only references events that have the same `pubkey` as the deletion request itself, however this is not required since relays may not have knowledge of all referenced events.
## Deleting a Deletion
## Deletion Request of a Deletion Request
Publishing a deletion event against a deletion has no effect. Clients and relays are not obliged to support "undelete" functionality.
Publishing a deletion request event against a deletion request has no effect. Clients and relays are not obliged to support "unrequest deletion" functionality.

6
10.md
View File

@@ -2,8 +2,8 @@ NIP-10
======
On "e" and "p" tags in Text Events (kind 1).
--------------------------------------------
On "e" and "p" tags in Text Events (kind 1)
-------------------------------------------
`draft` `optional`
@@ -43,7 +43,7 @@ They are citing from this event. `root-id` and `reply-id` are as above.
Where:
* `<event-id>` is the id of the event being referenced.
* `<relay-url>` is the URL of a recommended relay associated with the reference. Clients SHOULD add a valid `<relay-URL>` field, but may instead leave it as `""`.
* `<relay-url>` is the URL of a recommended relay associated with the reference. Clients SHOULD add a valid `<relay-url>` field, but may instead leave it as `""`.
* `<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`.
* `<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event

32
11.md
View File

@@ -2,7 +2,7 @@ NIP-11
======
Relay Information Document
---------------------------
--------------------------
`draft` `optional`
@@ -66,7 +66,7 @@ These are limitations imposed by the relay on clients. Your client
should expect that requests which exceed these *practical* limitations
are rejected or fail immediately.
```json
```jsonc
{
"limitation": {
"max_message_length": 16384,
@@ -83,7 +83,7 @@ are rejected or fail immediately.
"created_at_lower_limit": 31536000,
"created_at_upper_limit": 3
},
...
// other fields...
}
```
@@ -146,14 +146,15 @@ Retention times are given in seconds, with `null` indicating infinity.
If zero is provided, this means the event will not be stored at
all, and preferably an error will be provided when those are received.
```json
```jsonc
{
"retention": [
{"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600},
{"kinds": [[40000, 49999]], "time": 100},
{"kinds": [[30000, 39999]], "count": 1000},
{"time": 3600, "count": 10000}
]
],
// other fields...
}
```
@@ -172,7 +173,7 @@ There is no need to specify retention times for _ephemeral events_ since they ar
### Content Limitations
Some relays may be governed by the arbitrary laws of a nation state. This
may limit what content can be stored in cleartext on those relays. All
may limit what content can be stored in clear-text on those relays. All
clients are encouraged to use encryption to work around this limitation.
It is not possible to describe the limitations of each country's laws
@@ -183,13 +184,13 @@ countries' laws might end up being enforced on them, and then
indirectly on their users' content.
Users should be able to avoid relays in countries they don't like,
and/or select relays in more favourable zones. Exposing this
and/or select relays in more favorable zones. Exposing this
flexibility is up to the client software.
```json
```jsonc
{
"relay_countries": [ "CA", "US" ],
...
// other fields...
}
```
@@ -208,12 +209,12 @@ local community. This would encourage users to follow the global
feed on that relay, in addition to their usual individual follows.
To support this goal, relays MAY specify some of the following values.
```json
```jsonc
{
"language_tags": ["en", "en-419"],
"tags": ["sfw-only", "bitcoin-only", "anime"],
"posting_policy": "https://example.com/posting-policy.html",
...
// other fields...
}
```
@@ -260,10 +261,10 @@ Relays that require payments may want to expose their fee schedules.
A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape.
```json
```jsonc
{
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
...
// other fields...
}
```
@@ -271,9 +272,11 @@ A URL pointing to an image to be used as an icon for the relay. Recommended to b
As of 2 May 2023 the following command provided these results:
```bash
$ curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
```
~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
```json
{
"description": "nostr.land family of relays (us-or-01)",
"name": "nostr.land",
@@ -312,3 +315,4 @@ As of 2 May 2023 the following command provided these results:
]
},
}
```

55
13.md
View File

@@ -48,37 +48,30 @@ Validating
Here is some reference C code for calculating the difficulty (aka number of leading zero bits) in a nostr event id:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int zero_bits(unsigned char b)
{
int n = 0;
int countLeadingZeroes(const char *hex) {
int count = 0;
if (b == 0)
return 8;
for (int i = 0; i < strlen(hex); i++) {
int nibble = (int)strtol((char[]){hex[i], '\0'}, NULL, 16);
if (nibble == 0) {
count += 4;
} else {
count += __builtin_clz(nibble) - 28;
break;
}
}
while (b >>= 1)
n++;
return count;
return 7-n;
}
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "Usage: %s <hex_string>\n", argv[0]);
return 1;
}
const char *hex_string = argv[1];
int result = countLeadingZeroes(hex_string);
printf("Leading zeroes in hex string %s: %d\n", hex_string, result);
return 0;
/* find the number of leading zero bits in a hash */
int count_leading_zero_bits(unsigned char *hash)
{
int bits, total, i;
for (i = 0, total = 0; i < 32; i++) {
bits = zero_bits(hash[i]);
total += bits;
if (bits != 8)
break;
}
return total;
}
```
@@ -103,16 +96,6 @@ function countLeadingZeroes(hex) {
}
```
Querying relays for PoW notes
-----------------------------
If relays allow searching on prefixes, you can use this as a way to filter notes of a certain difficulty:
```
$ echo '["REQ", "subid", {"ids": ["000000000"]}]' | websocat wss://some-relay.com | jq -c '.[2]'
{"id":"000000000121637feeb68a06c8fa7abd25774bdedfa9b6ef648386fb3b70c387", ...}
```
Delegated Proof of Work
-----------------------

21
15.md
View File

@@ -73,10 +73,10 @@ Fields that are not self-explanatory:
**Event Tags**
```json
```jsonc
{
"tags": [["d", <string, id of stall]],
...
// other fields...
}
```
- the `d` tag is required, its value MUST be the same as the stall `id`.
@@ -124,12 +124,12 @@ Fields that are not self-explanatory:
**Event Tags**
```json
```jsonc
"tags": [
["d", <string, id of product],
["t", <string (optional), product category],
["t", <string (optional), product category],
...
// other fields...
],
...
```
@@ -158,7 +158,7 @@ The below JSON goes in content of [NIP-04](04.md).
"type": 0,
"name": <string (optional), ???>,
"address": <string (optional), for physical goods an address should be provided>,
"message": "<string (optional), message for merchant>,
"message": <string (optional), message for merchant>,
"contact": {
"nostr": <32-bytes hex of a pubkey>,
"phone": <string (optional), if the customer wants to be contacted by phone>,
@@ -237,7 +237,7 @@ Create a customized user experience using the `naddr` from [NIP-19](19.md#sharea
**Event Content**
```json
```jsonc
{
"name": <string (optional), market name>,
"about": <string (optional), market description>,
@@ -248,7 +248,7 @@ Create a customized user experience using the `naddr` from [NIP-19](19.md#sharea
"darkMode": <bool, true/false>
},
"merchants": [array of pubkeys (optional)],
...
// other fields...
}
```
@@ -290,17 +290,18 @@ This event leverages naddr to enable comprehensive customization and sharing of
### Event `1021`: Bid
```json
```jsonc
{
"content": <int, amount of sats>,
"tags": [["e", <event ID of the auction to bid on>]],
// other fields...
}
```
Bids are simply events of kind `1021` with a `content` field specifying the amount, in the currency of the auction. Bids must reference an auction.
> [!NOTE]
> Auctions can be edited as many times as desired (they are "parameterized replaceable events") by the author - even after the start_date, but they cannot be edited after they have received the first bid! This is enforced by the fact that bids reference the event ID of the auction (rather than the product UUID), which changes with every new version of the auctioned product. So a bid is always attached to one "version". Editing the auction after a bid would result in the new product losing the bid!
> Auctions can be edited as many times as desired (they are "addressable events") by the author - even after the start_date, but they cannot be edited after they have received the first bid! This is enforced by the fact that bids reference the event ID of the auction (rather than the product UUID), which changes with every new version of the auctioned product. So a bid is always attached to one "version". Editing the auction after a bid would result in the new product losing the bid!
### Event `1022`: Bid confirmation
@@ -335,4 +336,4 @@ Customer support is handled over whatever communication method was specified. If
## Additional
Standard data models can be found <a href="https://raw.githubusercontent.com/lnbits/nostrmarket/main/models.py">here</a>
Standard data models can be found [here](https://raw.githubusercontent.com/lnbits/nostrmarket/main/models.py)

12
17.md
View File

@@ -12,18 +12,18 @@ This NIP defines an encrypted direct messaging scheme using [NIP-44](44.md) encr
Kind `14` is a chat message. `p` tags identify one or more receivers of the message.
```js
```jsonc
{
"id": "<usual hash>",
  "pubkey": "<sender-pubkey>",
"created_at": now(),
"created_at": "<current-time>",
  "kind": 14,
  "tags": [
    ["p", "<receiver-1-pubkey>", "<relay-url>"],
    ["p", "<receiver-2-pubkey>", "<relay-url>"],
    ["e", "<kind-14-id>", "<relay-url>", "reply"] // if this is a reply
["subject", "<conversation-title>"],
    ...
    // rest of tags...
  ],
  "content": "<message-in-plain-text>",
}
@@ -86,7 +86,7 @@ Clients CAN offer disappearing messages by setting an `expiration` tag in the gi
Kind `10050` indicates the user's preferred relays to receive DMs. The event MUST include a list of `relay` tags with relay URIs.
```js
```jsonc
{
"kind": 10050,
"tags": [
@@ -94,7 +94,7 @@ Kind `10050` indicates the user's preferred relays to receive DMs. The event MUS
["relay", "wss://myrelay.nostr1.com"],
],
"content": "",
//...other fields
// other fields...
}
```
@@ -102,7 +102,7 @@ Clients SHOULD publish kind `14` events to the `10050`-listed relays. If that is
## Relays
It's advisable that relays do not serve `kind:14` to clients other than the ones tagged in them.
It's advisable that relays do not serve `kind:1059` to clients other than the ones tagged in them.
It's advisable that users choose relays that conform to these practices.

2
19.md
View File

@@ -43,7 +43,7 @@ These possible standardized `TLV` types are indicated here:
- depends on the bech32 prefix:
- 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 `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 normal 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
- this may be included multiple times

2
23.md
View File

@@ -6,7 +6,7 @@ Long-form Content
`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.
This NIP defines `kind:30023` (an _addressable 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.
"Social" clients that deal primarily with `kind:1` notes should not be expected to implement this NIP.

6
24.md
View File

@@ -39,5 +39,7 @@ tags
These tags may be present in multiple event kinds. Whenever a different meaning is not specified by some more specific NIP, they have the following meanings:
- `r`: a web URL the event is referring to in some way
- `title`: name of [NIP-51](51.md) sets, [NIP-52](52.md) calendar event, [NIP-53](53.md) live event or [NIP-99](99.md) listing
- `r`: a web URL the event is referring to in some way.
- `i`: an external id the event is referring to in some way - see [NIP-73](73.md).
- `title`: name of [NIP-51](51.md) sets, [NIP-52](52.md) calendar event, [NIP-53](53.md) live event or [NIP-99](99.md) listing.
- `t`: a hashtag. The value MUST be a lowercase string.

24
25.md
View File

@@ -52,6 +52,26 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
}
```
Reactions to a website
---------------------
If the target of the reaction is a website, the reaction MUST be a `kind 17` event and MUST include an `r` tag with the website's URL.
```jsonc
{
"kind": 17,
"content": "⭐",
"tags": [
["r", "https://example.com/"]
],
// other fields...
}
```
URLs SHOULD be [normalized](https://datatracker.ietf.org/doc/html/rfc3986#section-6), so that reactions to the same website are not omitted from queries.
A fragment MAY be attached to the URL, to react to a section of the page.
It should be noted that a URL with a fragment is not considered to be the same URL as the original.
Custom Emoji Reaction
---------------------
@@ -59,14 +79,14 @@ The client may specify a custom emoji ([NIP-30](30.md)) `:shortcode:` in the
reaction content. The client should refer to the emoji tag and render the
content as an emoji if shortcode is specified.
```json
```jsonc
{
"kind": 7,
"content": ":soapbox:",
"tags": [
["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"]
],
...other fields
// other fields...
}
```

2
26.md
View File

@@ -2,7 +2,7 @@ NIP-26
=======
Delegated Event Signing
-----
-----------------------
`draft` `optional`

26
28.md
View File

@@ -25,10 +25,10 @@ Create a public chat channel.
In the channel creation `content` field, Client SHOULD include basic channel metadata (`name`, `about`, `picture` and `relays` as specified in kind 41).
```json
```jsonc
{
"content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\", \"relays\": [\"wss://nos.lol\", \"wss://nostr.mom\"]}",
...
// other fields...
}
```
@@ -52,11 +52,11 @@ Clients MAY add additional metadata fields.
Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay.
```json
```jsonc
{
"content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\", \"relays\": [\"wss://nos.lol\", \"wss://nostr.mom\"]}",
"tags": [["e", <channel_create_event_id>, <relay-url>]],
...
// other fields...
}
```
@@ -71,26 +71,26 @@ Clients SHOULD append [NIP-10](10.md) "p" tags to replies.
Root message:
```json
```jsonc
{
"content": <string>,
"tags": [["e", <kind_40_event_id>, <relay-url>, "root"]],
...
// other fields...
}
```
Reply to another message:
```json
```jsonc
{
"content": <string>,
"tags": [
["e", <kind_40_event_id>, <relay-url>, "root"],
["e", <kind_42_event_id>, <relay-url>, "reply"],
["p", <pubkey>, <relay-url>],
...
// rest of tags...
],
...
// other fields...
}
```
@@ -107,11 +107,11 @@ Clients MAY hide event 42s for other users other than the user who sent the even
(For example, if three users 'hide' an event giving a reason that includes the word 'pornography', a Nostr client that is an iOS app may choose to hide that message for all iOS clients.)
```json
```jsonc
{
"content": "{\"reason\": \"Dick pic\"}",
"tags": [["e", <kind_42_event_id>]],
...
// other fields...
}
```
@@ -125,11 +125,11 @@ Clients SHOULD hide event 42s shown to a given user, if there is an event 44 fro
Clients MAY hide event 42s for users other than the user who sent the event 44.
```json
```jsonc
{
"content": "{\"reason\": \"Posting dick pics\"}",
"tags": [["p", <pubkey>]],
...
// other fields...
}
```

184
29.md
View File

@@ -16,12 +16,18 @@ Normally a group will originally belong to one specific relay, but the community
## Relay-generated events
Relays are supposed to generate the events that describe group metadata and group admins. These are parameterized replaceable events signed by the relay keypair directly, with the group _id_ as the `d` tag.
Relays are supposed to generate the events that describe group metadata and group admins. These are _addressable_ events signed by the relay keypair directly, with the group _id_ as the `d` tag.
## Group identifier
A group may be identified by a string in the format `<host>'<group-id>`. For example, a group with _id_ `abcdef` hosted at the relay `wss://groups.nostr.com` would be identified by the string `groups.nostr.com'abcdef`.
Group identifiers must be strings restricted to the characters `a-z0-9-_`.
When encountering just the `<host>` without the `'<group-id>`, clients can choose to connect to the group with id `_`, which is a special top-level group dedicated to relay-local discussions.
Group identifiers in most cases should be random or pseudo-random, as that mitigates message replay confusiong and ensures they can be migrated or forked to other relays easily without risking conflicting with other groups using the same id in these new relays. This isn't a hard rule, as, for example, in `unmanaged` and/or ephemeral relays groups might not want to migrate ever, so they might not care about this. Notably, the `_` relay-local group isn't expected to be migrated ever.
## The `h` tag
Events sent by users to groups (chat messages, text notes, moderation events etc) must have an `h` tag with the value set to the group _id_.
@@ -36,20 +42,42 @@ This is a hack to prevent messages from being broadcasted to external relays tha
Relays should prevent late publication (messages published now with a timestamp from days or even hours ago) unless they are open to receive a group forked or moved from another relay.
## Group management
Groups can have any number of users with elevated access. These users are identified by role labels which are arbitrarily defined by the relays (see also the description of `kind:39003`). What each role is capable of not defined in this NIP either, it's a relay policy that can vary. Roles can be assigned by other users (as long as they have the capability to add roles) by publishing a `kind:9000` event with that user's pubkey in a `p` tag and the roles afterwards (even if the user is already a group member a `kind:9000` can be issued and the user roles must just be updated).
The roles supported by the group as to having some special privilege assigned to them should be accessible on the event `kind:39003`, but the relay may also accept other role names, arbitrarily defined by clients, and just not do anything with them.
Users with any roles that have any privilege can be considered _admins_ in a broad sense and be returned in the `kind:39001` event for a group.
## Unmanaged groups
Unmanaged groups are impromptu groups that can be used in any public relay unaware of NIP-29 specifics. They piggyback on relays' natural white/blacklists (or lack of) but aside from that are not actively managed and won't have any admins, group state or metadata events.
In `unmanaged` groups, everybody is considered to be a member.
Unmanaged groups can transition to managed groups, in that case the relay master key just has to publish moderation events setting the state of all groups and start enforcing the rules they choose to.
## Event definitions
These are the events expected to be found in NIP-29 groups.
### Normal user-created events
These events generally can be sent by all members of a group and they require the `h` tag to be present so they're attached to a specific group.
- *text root note* (`kind:11`)
This is the basic unit of a "microblog" root text note sent to a group.
```js
```jsonc
"kind": 11,
"content": "hello my friends lovers of pizza",
"tags": [
["h", "<group-id>"],
["previous", "<event-id-first-chars>", "<event-id-first-chars>", ...]
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
]
...
// other fields...
```
- *threaded text reply* (`kind:12`)
@@ -63,14 +91,14 @@ This is the basic unit of a "microblog" reply note sent to a group. It's the sam
This is the basic unit of a _chat message_ sent to a group.
```js
```jsonc
"kind": 9,
"content": "hello my friends lovers of pizza",
"tags": [
["h", "<group-id>"],
["previous", "<event-id-first-chars>", "<event-id-first-chars>", ...]
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
]
...
// other fields...
```
- *chat message threaded reply* (`kind:10`)
@@ -79,47 +107,80 @@ Similar to `kind:12`, this is the basic unit of a chat message sent to a group.
`kind:10` SHOULD use NIP-10 markers, just like `kind:12`.
- other events:
Groups may also accept other events, like long-form articles, calendar, livestream, market announcements and so on. These should be as defined in their respective NIPs, with the addition of the `h` tag.
### User-related group management events
These are events that can be sent my user to manage their situation in a group, they also require the `h` tag.
- *join request* (`kind:9021`)
Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them.
```js
```json
{
"kind": 9021,
"content": "optional reason",
"tags": [
["h", "<group-id>"],
["code", "<optional-invite-code>"]
]
}
```
The optional `code` tag may be used by the relay to preauthorize acceptances in `closed` groups, together with the `kind:9009` `create-invite` moderation event.
- *leave request* (`kind:9022`)
Any user can send one of these events to the relay in order to be automatically removed from the group. The relay will automatically issue a `kind:9001` in response removing this user.
```json
{
"kind": 9022,
"content": "optional reason",
"tags": [
["h", "<group-id>"]
]
}
```
### Group state -- or moderation
These are events expected to be sent by the relay master key or by group admins -- and relays should reject them if they don't come from an authorized admin. They also require the `h` tag.
- *moderation events* (`kinds:9000-9020`) (optional)
Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log.
Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action based on its role and the relay's internal policy (see also the description of `kind:39003`).
```js
```json
{
"kind": 90xx,
"content": "optional reason",
"tags": [
["h", "<group-id>"],
["previous", ...]
["previous", /*...*/]
]
}
```
Each moderation action uses a different kind and requires different arguments, which are given as tags. These are defined in the following table:
| kind | name | tags |
| --- | --- | --- |
| 9000 | `add-user` | `p` (pubkey hex) |
| 9001 | `remove-user` | `p` (pubkey hex) |
| 9002 | `edit-metadata` | `name`, `about`, `picture` (string) |
| 9003 | `add-permission` | `p` (pubkey), `permission` (name) |
| 9004 | `remove-permission` | `p` (pubkey), `permission` (name) |
| 9005 | `delete-event` | `e` (id hex) |
| 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` |
| 9007 | `create-group` | |
| kind | name | tags |
| --- | --- | --- |
| 9000 | `add-user` | `p` with pubkey hex and optional roles |
| 9001 | `remove-user` | `p` with pubkey hex |
| 9002 | `edit-metadata` | fields from `kind:39000` to be modified |
| 9005 | `delete-event` | |
| 9007 | `create-group` | |
| 9008 | `delete-group` | |
It's expected that the group state (of who is an allowed member or not, who is an admin and with which permission or not, what are the group name and picture etc) can be fully reconstructed from the canonical sequence of these events.
### Group metadata events
These events contain the group id in a `d` tag instead of the `h` tag. They MUST be created by the relay master key only and a single instance of each (or none) should exist at all times for each group. They are merely informative but should reflect the latest group state (as it was changed by moderation events over time).
- *group metadata* (`kind:39000`) (optional)
@@ -127,7 +188,9 @@ This event defines the metadata for the group -- basically how clients should di
If the group is forked and hosted in multiple relays, there will be multiple versions of this event in each different relay and so on.
```js
When this event is not found, clients may still connect to the group, but treat it as having a different status, `unmanaged`,
```jsonc
{
"kind": 39000,
"content": "",
@@ -139,7 +202,7 @@ If the group is forked and hosted in multiple relays, there will be multiple ver
["public"], // or ["private"]
["open"] // or ["closed"]
]
...
// other fields...
}
```
@@ -147,40 +210,29 @@ If the group is forked and hosted in multiple relays, there will be multiple ver
- *group admins* (`kind:39001`) (optional)
Similar to the group metadata, this event is supposed to be generated by relays that host the group.
Each admin is listed along with one or more roles. These roles SHOULD have a correspondence with the roles supported by the relay, as advertised by the `kind:39003` event.
Each admin gets a label that is only used for display purposes, and a list of permissions it has are listed afterwards. These permissions can inform client building UI, but ultimately are evaluated by the relay in order to become effective.
The list of capabilities, as defined by this NIP, for now, is the following:
- `add-user`
- `edit-metadata`
- `delete-event`
- `remove-user`
- `add-permission`
- `remove-permission`
- `edit-group-status`
```js
```jsonc
{
"kind": 39001,
"content": "list of admins for the pizza lovers group",
"tags": [
["d", "<group-id>"],
["p", "<pubkey1-as-hex>", "ceo", "add-user", "edit-metadata", "delete-event", "remove-user"],
["p", "<pubkey2-as-hex>", "secretary", "add-user", "delete-event"]
]
...
["p", "<pubkey1-as-hex>", "ceo"],
["p", "<pubkey2-as-hex>", "secretary", "gardener"],
// other pubkeys...
],
// other fields...
}
```
- *group members* (`kind:39002`) (optional)
Similar to *group admins*, this event is supposed to be generated by relays that host the group.
It's a list of pubkeys that are members of the group. Relays might choose to not to publish this information, to restrict what pubkeys can fetch it or to only display a subset of the members in it.
It's a NIP-51-like list of pubkeys that are members of the group. Relays might choose to not to publish this information or to restrict what pubkeys can fetch it.
Clients should not assume this will always be present or that it will contain a full list of members.
```json
```jsonc
{
"kind": 39002,
"content": "list of members for the pizza lovers group",
@@ -189,10 +241,48 @@ It's a NIP-51-like list of pubkeys that are members of the group. Relays might c
["p", "<admin1>"],
["p", "<member-pubkey1>"],
["p", "<member-pubkey2>"],
]
// other pubkeys...
],
// other fields...
}
```
## Storing the list of groups a user belongs to
- *group roles* (`kind:39003`) (optional)
A definition for kind `10009` was included in [NIP-51](51.md) that allows clients to store the list of groups a user wants to remember being in.
This is an event that MAY be published by the relay informing users and clients about what are the roles supported by this relay according to its internal logic.
For example, a relay may choose to support the roles `"admin"` and `"moderator"`, in which the `"admin"` will be allowed to edit the group metadata, delete messages and remove users from the group, while the `"moderator"` can only delete messages (or the relay may choose to call these roles `"ceo"` and `"secretary"` instead, the exact role name is not relevant).
The process through which the relay decides what roles to support and how to handle moderation events internally based on them is specific to each relay and not specified here.
```jsonc
{
"kind": 39003,
"content": "list of roles supported by this group",
"tags": [
["d", "<group-id>"],
["role", "<role-name>", "<optional-description>"],
["role", "<role-name>", "<optional-description>"],
// other roles...
],
// other fields...
}
```
## Implementation quirks
### Checking your own membership in a group
The latest of either `kind:9000` or `kind:9001` events present in a group should tell a user that they are currently members of the group or if they were removed. In case none of these exist the user is assumed to not be a member of the group -- unless the group is `unmanaged`, in which case the user is assumed to be a member.
### Adding yourself to a group
When a group is `open`, anyone can send a `kind:9021` event to it in order to be added, then expect a `kind:9000` event to be emitted confirming that the user was added. The same happens with `closed` groups, except in that case a user may only send a `kind:9021` if it has an invite code.
### Storing your list of groups
A definition for `kind:10009` was included in [NIP-51](51.md) that allows clients to store the list of groups a user wants to remember being in.
### Using `unmanaged` relays
To prevent event leakage, replay and confusion, when using `unmanaged` relays, clients should include the [NIP-70](70.md) `-` tag, as just the `previous` tag won't be checked by other `unmanaged` relays.

16
30.md
View File

@@ -54,3 +54,19 @@ In kind 1 events, the `content` should be emojified.
"created_at": 1682630000
}
```
### Kind 7 events
In kind 7 events, the `content` should be emojified.
```json
{
"kind": 7,
"content": ":dezh:",
"tags": [
["emoji", "dezh", "https://raw.githubusercontent.com/dezh-tech/brand-assets/main/dezh/logo/black-normal.svg"]
],
"pubkey": "79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6",
"created_at": 1682630000
}
```

30
32.md
View File

@@ -2,7 +2,7 @@ NIP-32
======
Labeling
---------
--------
`draft` `optional`
@@ -57,7 +57,7 @@ Example events
A suggestion that multiple pubkeys be associated with the `permies` topic.
```json
```jsonc
{
"kind": 1985,
"tags": [
@@ -66,13 +66,13 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
["p", <pubkey1>, <relay_url>],
["p", <pubkey2>, <relay_url>]
],
...
// other fields...
}
```
A report flagging violence toward a human being as defined by ontology.example.com.
```json
```jsonc
{
"kind": 1985,
"tags": [
@@ -81,13 +81,13 @@ A report flagging violence toward a human being as defined by ontology.example.c
["p", <pubkey1>, <relay_url>],
["p", <pubkey2>, <relay_url>]
],
...
// other fields...
}
```
A moderation suggestion for a chat event.
```json
```jsonc
{
"kind": 1985,
"tags": [
@@ -95,13 +95,13 @@ A moderation suggestion for a chat event.
["l", "approve", "nip28.moderation"],
["e", <kind40_event_id>, <relay_url>]
],
...
// other fields...
}
```
Assignment of a license to an event.
```json
```jsonc
{
"kind": 1985,
"tags": [
@@ -109,14 +109,14 @@ Assignment of a license to an event.
["l", "MIT", "license"],
["e", <event_id>, <relay_url>]
],
...
// other fields...
}
```
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
```jsonc
{
"kind": 1,
"tags": [
@@ -124,13 +124,13 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2.
["l", "IT-MI", "ISO-3166-2"]
],
"content": "It's beautiful here in Milan!",
...
// other fields...
}
```
Author is labeling their note language as English using ISO-639-1.
```json
```jsonc
{
"kind": 1,
"tags": [
@@ -138,14 +138,14 @@ Author is labeling their note language as English using ISO-639-1.
["l", "en", "ISO-639-1"]
],
"content": "English text",
...
// other fields...
}
```
Other Notes
-----------
When using this NIP to bulk-label many targets at once, events may be deleted and a replacement
When using this NIP to bulk-label many targets at once, events may be requested for deletion using [NIP-09](09.md) and a replacement
may be published. We have opted not to use parameterizable/replaceable events for this due to the
complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying,
publishers SHOULD limit labeling events to a single namespace.
@@ -169,7 +169,7 @@ be handled in some other way.
Appendix: Known Ontologies
-------------------------
--------------------------
Below is a non-exhaustive list of ontologies currently in widespread use.

2
33.md
View File

@@ -6,4 +6,4 @@ Parameterized Replaceable Events
`final` `mandatory`
Moved to [NIP-01](01.md).
Renamed to "Addressable events" and moved to [NIP-01](01.md).

9
34.md
View File

@@ -53,7 +53,7 @@ An optional source of truth for the state of branches and tags in a repository.
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.
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 requests.
The `refs` tag can be optionally extended to enable clients to identify how many commits ahead a ref is:
@@ -106,7 +106,7 @@ The first patch in a series MAY be a cover letter in the format produced by `git
Issues are Markdown text that is just human-readable conversational threads related to the repository: bug reports, feature requests, questions or comments of any kind. Like patches, these SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag.
```jsonc
```json
{
"kind": 1621,
"content": "<markdown text>",
@@ -132,8 +132,9 @@ Replies are also Markdown text. The difference is that they MUST be issued as re
// other "e" and "p" tags should be applied here when necessary, following the threading rules of NIP-10
["p", "<patch-author-pubkey-hex>", "", "mention"],
["e", "<previous-reply-id-hex>", "", "reply"],
// ...
]
// rest of tags...
],
// other fields...
}
```

4
35.md
View File

@@ -2,7 +2,7 @@ NIP-35
======
Torrents
-----------
--------
`draft` `optional`
@@ -37,7 +37,7 @@ A second level prefix should be included where the database supports multiple me
In some cases the url mapping isnt direct, mapping the url in general is out of scope for this NIP, the section above is only a guide so that implementers have enough information to succsesfully map the url if they wish.
```jsonc
```json
{
"kind": 2003,
"content": "<long-description-pre-formatted>",

8
38.md
View File

@@ -3,7 +3,7 @@ NIP-38
======
User Statuses
--------------
-------------
`draft` `optional`
@@ -13,11 +13,11 @@ This NIP enables a way for users to share live statuses such as what music they
## Live Statuses
A special event with `kind:30315` "User Status" is defined as an *optionally expiring* _parameterized replaceable event_, where the `d` tag represents the status type:
A special event with `kind:30315` "User Status" is defined as an *optionally expiring* _addressable event_, where the `d` tag represents the status type:
For example:
```js
```json
{
"kind": 30315,
"content": "Sign up for nostrasia!",
@@ -26,7 +26,9 @@ For example:
["r", "https://nostr.world"]
],
}
```
```json
{
"kind": 30315,
"content": "Intergalatic - Beastie Boys",

5
39.md
View File

@@ -13,7 +13,8 @@ Nostr protocol users may have other online identities such as usernames, profile
## `i` tag on a metadata event
A new optional `i` tag is introduced for `kind 0` metadata event defined in [NIP-01](01.md):
```json
```jsonc
{
"id": <id>,
"pubkey": <pubkey>,
@@ -23,7 +24,7 @@ A new optional `i` tag is introduced for `kind 0` metadata event defined in [NIP
["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"]
["i", "telegram:1087295469", "nostrdirectory/770"]
],
...
// other fields...
}
```

8
42.md
View File

@@ -22,13 +22,13 @@ A relay may want to require clients to authenticate to access restricted resourc
This NIP defines a new message, `AUTH`, which relays CAN send when they support authentication and clients can send to relays when they want to authenticate. When sent by relays the message has the following form:
```json
```
["AUTH", <challenge-string>]
```
And, when sent by clients, the following form:
```json
```
["AUTH", <signed-event-json>]
```
@@ -38,14 +38,14 @@ And, when sent by clients, the following form:
The signed event is an ephemeral event not meant to be published or queried, it must be of `kind: 22242` and it should have at least two tags, one for the relay URL and one for the challenge string as received from the relay. Relays MUST exclude `kind: 22242` events from being broadcasted to any client. `created_at` should be the current time. Example:
```json
```jsonc
{
"kind": 22242,
"tags": [
["relay", "wss://relay.example.com/"],
["challenge", "challengestringhere"]
],
...
// other fields...
}
```

4
44.md
View File

@@ -1,5 +1,5 @@
NIP-44
=====
======
Encrypted Payloads (Versioned)
------------------------------
@@ -142,6 +142,8 @@ validation rules, refer to BIP-340.
The operation produces a shared point, and we encode the shared point's 32-byte x coordinate, using method
`bytes(P)` from BIP340. Private and public keys must be validated as per BIP340: pubkey must be a valid,
on-curve point, and private key must be a scalar in range `[1, secp256k1_order - 1]`.
NIP44 doesn't do hashing of the output: keep this in mind, because some libraries hash it using sha256.
As an example, in libsecp256k1, unhashed version is available in `secp256k1_ec_pubkey_tweak_mul`
- Operators
- `x[i:j]`, where `x` is a byte array and `i, j <= 0` returns a `(j - i)`-byte array with a copy of the
`i`-th byte (inclusive) to the `j`-th byte (exclusive) of `x`.

10
45.md
View File

@@ -2,7 +2,7 @@ NIP-45
======
Event Counts
--------------
------------
`draft` `optional`
@@ -16,14 +16,14 @@ Some queries a client may want to execute against connected relays are prohibiti
This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result.
```json
```
["COUNT", <subscription_id>, <filters JSON>...]
```
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
```json
```
["COUNT", <subscription_id>, {"count": <integer>}]
```
@@ -33,14 +33,14 @@ Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST ret
### Followers count
```json
```
["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 238}]
```
### Count posts and reactions
```json
```
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 5}]
```

8
46.md
View File

@@ -1,4 +1,8 @@
# NIP-46 - Nostr Remote Signing
NIP-46
======
Nostr Remote Signing
--------------------
## Rationale
@@ -90,7 +94,7 @@ nostrconnect://<local-keypair-pubkey>?relay=<wss://relay-to-connect-on>&metadata
## Request Events `kind: 24133`
```json
```jsonc
{
"id": <id>,
"kind": 24133,

10
47.md
View File

@@ -173,7 +173,7 @@ Request:
"amount": 123, // invoice amount in msats, required
"pubkey": "03...", // payee pubkey, required
"preimage": "0123456789abcdef...", // preimage of the payment, optional
"tlv_records: [ // tlv records, optional
"tlv_records": [ // tlv records, optional
{
"type": 5482373484, // tlv type
"value": "0123456789abcdef" // hex encoded tlv value
@@ -208,7 +208,7 @@ Request:
"method": "multi_pay_keysend",
"params": {
"keysends": [
{"id": "4c5b24a351", pubkey": "03...", "amount": 123},
{"id": "4c5b24a351", "pubkey": "03...", "amount": 123},
{"id": "3da52c32a1", "pubkey": "02...", "amount": 567, "preimage": "abc123..", "tlv_records": [{"type": 696969, "value": "77616c5f6872444873305242454d353736"}]},
],
}
@@ -358,8 +358,7 @@ Request:
```jsonc
{
"method": "get_balance",
"params": {
}
"params": {}
}
```
@@ -379,8 +378,7 @@ Request:
```jsonc
{
"method": "get_info",
"params": {
}
"params": {}
}
```

4
50.md
View File

@@ -15,9 +15,9 @@ extensible framework for performing such queries.
## `search` filter field
A new `search` field is introduced for `REQ` messages from clients:
```json
```jsonc
{
...
// other fields on filter object...
"search": <string>
}
```

5
51.md
View File

@@ -16,7 +16,7 @@ When new items are added to an existing list, clients SHOULD append them to the
## Standard lists
Standard lists use non-parameterized replaceable events, meaning users may only have a single list of each kind. They have special meaning and clients may rely on them to augment a user's profile or browsing experience.
Standard lists use normal replaceable events, meaning users may only have a single list of each kind. They have special meaning and clients may rely on them to augment a user's profile or browsing experience.
For example, _mute list_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from.
@@ -51,6 +51,7 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti
| Bookmark sets | 30003 | user-defined bookmarks categories , for when bookmarks must be in labeled separate groups | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r"` (URLs) |
| Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) |
| Curation sets | 30005 | groups of videos picked by users as interesting and/or belonging to the same category | `"a"` (kind:34235 videos) |
| Kind mute sets | 30007 | mute pubkeys by kinds<br>`"d"` tag MUST be the kind string | `"p"` (pubkeys) |
| Interest sets | 30015 | interest topics represented by a bunch of "hashtags" | `"t"` (hashtags) |
| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) |
| Release artifact sets | 30063 | groups of files of a software release | `"e"` (kind:1063 [file metadata](94.md) events), `"i"` (application identifier, typically reverse domain notation), `"version"` |
@@ -110,7 +111,7 @@ Some clients have used these lists in the past, but they should work on transiti
### A _release artifact set_ of an Example App
```json
```jsonc
{
"id": "567b41fc9060c758c4216fe5f8d3df7c57daad7ae757fa4606f0c39d4dd220ef",
"pubkey": "d6dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c",

23
52.md
View File

@@ -6,7 +6,7 @@ Calendar Events
`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).
This specification defines calendar events representing an occurrence at a specific moment or between moments. These calendar events are _addressable_ and deletable per [NIP-09](09.md).
Unlike the term `calendar event` specific to this NIP, the term `event` is used broadly in all the NIPs to describe any Nostr event. The distinction is being made here to discern between the two terms.
@@ -90,9 +90,12 @@ The list of tags are as follows:
* `end` (optional) exclusive end Unix timestamp in seconds. If omitted, the calendar event ends instantaneously.
* `start_tzid` (optional) time zone of the start timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`
* `end_tzid` (optional) time zone of the end timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`. If omitted and `start_tzid` is provided, the time zone of the end timestamp is the same as the start timestamp.
* `summary` (optional) brief description of the calendar event
* `image` (optional) url of an image to use for the event
* `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call
* `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location
* `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting
* `l` (optional, repeated) label to categorize calendar event. e.g. `audiospace` to denote a scheduled event from a live audio space implementation such as cornychat.com
* `t` (optional, repeated) hashtag to categorize calendar event
* `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc.
@@ -110,6 +113,8 @@ The following tags are deprecated:
["d", "<UUID>"],
["title", "<title of calendar event>"],
["summary", "<brief description of the calendar event>"],
["image", "<string with image URI>"],
// Timestamps
["start", "<Unix timestamp in seconds>"],
@@ -126,6 +131,10 @@ The following tags are deprecated:
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "<role>"],
// Labels (example using com.cornychat namespace denoting the event as an audiospace)
["L", "com.cornychat"],
["l", "audiospace", "com.cornychat"],
// Hashtags
["t", "<tag>"],
["t", "<tag>"],
@@ -178,6 +187,10 @@ This NIP is intentionally not defining who is authorized to attend a calendar ev
This NIP is also intentionally not defining what happens if a calendar event changes after an RSVP is submitted.
The RSVP MUST have an `a` tag of the event coordinates to the calendar event, and optionally an `e` tag of the id of the specific calendar event revision. If an `e` tag is present, clients SHOULD interpret it as an indication that the RSVP is a response to that revision of the calendar event, and MAY interpret it to not necessarily apply to other revisions of the calendar event.
The RSVP MAY tag the author of the calendar event it is in response to using a `p` tag so that clients can easily query all RSVPs that pertain to the author.
### Format
The format uses a parameterized replaceable event kind `31925`.
@@ -185,10 +198,12 @@ The format uses a parameterized replaceable event kind `31925`.
The `.content` of these events is optional and should be a free-form note that adds more context to this calendar event response.
The list of tags are as follows:
* `a` (required) reference tag to kind `31922` or `31923` calendar event being responded to.
* `a` (required) coordinates to a kind `31922` or `31923` calendar event being responded to.
* `e` (optional) event id of a kind `31922` or `31923` calendar event being responded to.
* `d` (required) universally unique identifier. Generated by the client creating the calendar event RSVP.
* `status` (required) `accepted`, `declined`, or `tentative`. Determines attendance status to the referenced calendar event.
* `fb` (optional) `free` or `busy`. Determines if the user would be free or busy for the duration of the calendar event. This tag must be omitted or ignored if the `status` label is set to `declined`.
* `p` (optional) pubkey of the author of the calendar event being responded to.
```json
{
@@ -198,10 +213,12 @@ The list of tags are as follows:
"kind": 31925,
"content": "<note>",
"tags": [
["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"],
["e", "<kind 31922 or 31923 event id", "<optional recommended relay URL>"]
["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional recommended relay URL>"],
["d", "<UUID>"],
["status", "<accepted/declined/tentative>"],
["fb", "<free/busy>"],
["p", "<hex pubkey of kind 31922 or 31923 event>", "<optional recommended relay URL>"]
]
}
```

12
53.md
View File

@@ -12,11 +12,11 @@ Service providers want to offer live activities to the Nostr network in such a w
### Live Event
A special event with `kind:30311` "Live Event" is defined as a _parameterized replaceable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity.
A special event with `kind:30311` "Live Event" is defined as an _addressable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity.
For example:
```json
```jsonc
{
"kind": 30311,
"tags": [
@@ -35,10 +35,10 @@ For example:
["p", "91cf9..4e5ca", "wss://provider1.com/", "Host", "<proof>"],
["p", "14aeb..8dad4", "wss://provider2.com/nostr", "Speaker"],
["p", "612ae..e610f", "ws://provider3.com/ws", "Participant"],
["relays", "wss://one.com", "wss://two.com", ...]
["relays", "wss://one.com", "wss://two.com", /*...*/]
],
"content": "",
...
// other fields...
}
```
@@ -64,14 +64,14 @@ This feature is important to avoid malicious event owners adding large account h
Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used.
```json
```jsonc
{
"kind": 1311,
"tags": [
["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"],
],
"content": "Zaps to live streams is beautiful.",
...
// other fields...
}
```

34
54.md
View File

@@ -6,12 +6,12 @@ Wiki
`draft` `optional`
This NIP defines `kind:30818` (a _parameterized replaceable event_) for long-form text content similar to [NIP-23](23.md), but with one important difference: articles are meant to be descriptions, or encyclopedia entries, of particular subjects, and it's expected that multiple people will write articles about the exact same subjects, with either small variations or completely independent content.
This NIP defines `kind:30818` (an _addressable event_) for descriptions (or encyclopedia entries) of particular subjects, and it's expected that multiple people will write articles about the exact same subjects, with either small variations or completely independent content.
Articles are identified by lowercase, normalized ascii `d` tags.
### Articles
```jsonc
```json
{
"content": "A wiki is a hypertext publication collaboratively edited and managed by its own audience.",
"tags": [
@@ -26,21 +26,25 @@ Articles are identified by lowercase, normalized ascii `d` tags.
- Any non-letter character MUST be converted to a `-`.
- All letters MUST be converted to lowercase.
### Content rules
### Content
The content should be Markdown, following the same rules as of [NIP-23](23.md), although it takes some extra (optional) metadata tags:
The `content` should be Asciidoc with two extra functionalities: **wikilinks** and **nostr:...** links.
- `title`: for when the display title should be different from the `d` tag.
- `summary`: for display in lists.
- `a` and `e`: for referencing the original event a wiki article was forked from.
One extra functionality is added: **wikilinks**. Unlike normal Markdown links `[]()` that link to webpages, wikilinks `[[]]` link to other articles in the wiki. In this case, the wiki is the entirety of Nostr. Clicking on a wikilink should cause the client to ask relays for events with `d` tags equal to the target of that wikilink.
Unlike normal Asciidoc links `http://example.com[]` that link to external webpages, wikilinks `[[]]` link to other articles in the wiki. In this case, the wiki is the entirety of Nostr. Clicking on a wikilink should cause the client to ask relays for events with `d` tags equal to the target of that wikilink.
Wikilinks can take these two forms:
1. `[[Target Page]]` -- in this case it will link to the page `target-page` (according to `d` tag normalization rules above) and be displayed as `Target Page`;
2. `[[target page|see this]]` -- in this case it will link to the page `target-page`, but will be displayed as `see this`.
`nostr:...` links, as per [NIP-21](21.md), should link to profiles or arbitrary Nostr events. Although it is not recommended to link to specific versions of articles -- instead the _wikilink_ syntax should be preferred, since it should be left to the reader and their client to decide what version of any given article they want to read.
### Optional extra tags
- `title`: for when the display title should be different from the `d` tag.
- `summary`: for display in lists.
- `a` and `e`: for referencing the original event a wiki article was forked from.
### Merge Requests
Event `kind:818` represents a request to merge from a forked article into the source. It is directed to a pubkey and references the original article and the modified event.
@@ -86,23 +90,23 @@ This is a stronger signal of trust than a `+` reaction.
This marker is useful when a user edits someone else's entry; if the original author includes the editor's changes and the editor doesn't want to keep/maintain an independent version, the `link` tag could effectively be a considered a "deletion" of the editor's version and putting that pubkey's WoT weight behind the original author's version.
Why Markdown?
Why Asciidoc?
-------------
If the idea is to make a wiki then the most obvious text format to use is probably the mediawiki/wikitext format used by Wikipedia since it's widely deployed in all mediawiki installations and used for decades with great success. However, it turns out that format is very bloated and convoluted, has way too many features and probably because of that it doesn't have many alternative implementations out there, and the ones that exist are not complete and don't look very trustworthy. Also it is very much a centralized format that can probably be changed at the whims of the Wikipedia owners.
Wikitext is [garbage](nostr:nevent1qqsqt0gcggry60n72uglhuhypdlmr2dm6swjj69jex5v530gcpazlzsprpmhxue69uhhyetvv9ujumn0wdmksetjv5hxxmmdqy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsygpm7rrrljungc6q0tuh5hj7ue863q73qlheu4vywtzwhx42a7j9n5ueneex) and Markdown is not powerful enough (besides being too freeform and unspecified and prone to generate incompatibilities in the future).
On the other hand, Markdown has proven to work well for small scale wikis and one of the biggest wikis in the planet (which is not very often thought of as a wiki), [StackOverflow](https://stackoverflow.com) and its child sites, and also one of the biggest "personal wiki" software, [Obsidian](https://obsidian.md/). Markdown can probably deliver 95% of the functionality of wikitext. When augmented with tables, diagram generators and MathJax (which are common extensions that exist in the wild and can be included in this NIP) that rate probably goes to 99%, and its simplicity is a huge benefit that can't be overlooked. Wikitext format can also be transpíled into Markdown using Pandoc. Given all that, I think it's a reasonable suspicion that mediawiki is not inherently better than Markdown, the success of Wikipedia probably cannot be predicated on the syntax language choice.
Asciidoc has a strict spec, multiple implementations in many languages, and support for features that are very much necessary in a wiki article, like _sidebars_, _tables_ (with rich markup inside cells), many levels of _headings_, _footnotes_, _superscript_ and _subscript_ markup and _description lists_. It is also arguably easier to read in its plaintext format than Markdown (and certainly much better than Wikitext).
# Appendix 1: Merge requests
Users can request other users to get their entries merged into someone else's entry by creating a `kind:818` event.
```jsonc
```json
{
"content": "I added information about how to make hot ice-creams",
"kind": 818,
"tags": [
[ "a", "30818:<destination-pubkey>:hot-ice-creams", "<relay-url>" ],
[ "e", "<version-against-which-the-modification-was-made>", "<relay-url>' ],
[ "e", "<version-against-which-the-modification-was-made>", "<relay-url>" ],
[ "p", "<destination-pubkey>" ],
[ "e", "<version-to-be-merged>", "<relay-url>", "source" ]
]
@@ -114,4 +118,4 @@ Users can request other users to get their entries merged into someone else's en
`e` tag: optional version of the article in which this modifications is based
`e` tag with `source` marker: the ID of the event that should be merged. This event id MUST be of a `kind:30818` as defined in this NIP.
The destination-pubkey (the pubkey being requested to merge something into their article can create [[NIP-25]] reactions that tag the `kind:818` event with `+` or `-`
The destination-pubkey is the pubkey being requested to merge something into their article can create [[NIP-25]] reactions that tag the `kind:818` event with `+` or `-`

6
55.md
View File

@@ -1,6 +1,8 @@
# NIP-55
NIP-55
======
## Android Signer Application
Android Signer Application
--------------------------
`draft` `optional`

12
56.md
View File

@@ -41,7 +41,7 @@ further qualification and querying.
Example events
--------------
```json
```jsonc
{
"kind": 1984,
"tags": [
@@ -50,9 +50,11 @@ Example events
["l", "NS-nud", "social.nos.ontology"]
],
"content": "",
...
// other fields...
}
```
```jsonc
{
"kind": 1984,
"tags": [
@@ -60,16 +62,18 @@ Example events
["p", <pubkey>]
],
"content": "He's insulting the king!",
...
// other fields...
}
```
```jsonc
{
"kind": 1984,
"tags": [
["p", <impersonator pubkey>, "impersonation"]
],
"content": "Profile is impersonating nostr:<victim bech32 pubkey>",
...
// other fields...
}
```

4
57.md
View File

@@ -36,7 +36,7 @@ A `zap request` is an event of kind `9734` that is _not_ published to relays, bu
In addition, the event MAY include the following tags:
- `e` is an optional hex-encoded event id. Clients MUST include this if zapping an event rather than a person.
- `a` is an optional event coordinate that allows tipping parameterized replaceable events such as NIP-23 long-form notes.
- `a` is an optional event coordinate that allows tipping addressable events such as NIP-23 long-form notes.
Example:
@@ -171,7 +171,7 @@ A client can retrieve `zap receipt`s on events and pubkeys using a NIP-01 filter
When an event includes one or more `zap` tags, clients wishing to zap it SHOULD calculate the lnurl pay request based on the tags value instead of the event author's profile field. The tag's second argument is the `hex` string of the receiver's pub key and the third argument is the relay to download the receiver's metadata (Kind-0). An optional fourth parameter specifies the weight (a generalization of a percentage) assigned to the respective receiver. Clients should parse all weights, calculate a sum, and then a percentage to each receiver. If weights are not present, CLIENTS should equally divide the zap amount to all receivers. If weights are only partially present, receivers without a weight should not be zapped (`weight = 0`).
```js
```jsonc
{
"tags": [
[ "zap", "82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2", "wss://nostr.oxtr.dev", "1" ], // 25%

14
58.md
View File

@@ -9,7 +9,7 @@ Badges
Three special events are used to define, award and display badges in
user profiles:
1. A "Badge Definition" event is defined as a parameterized replaceable event with kind `30009` having a `d` tag with a value that uniquely identifies the badge (e.g. `bravery`) published by the badge issuer. Badge definitions can be updated.
1. A "Badge Definition" event is defined as an addressable event with kind `30009` having a `d` tag with a value that uniquely identifies the badge (e.g. `bravery`) published by the badge issuer. Badge definitions can be updated.
2. A "Badge Award" event is a kind `8` event with a single `a` tag referencing a "Badge Definition" event and one or more `p` tags, one for each pubkey the badge issuer wishes to award. Awarded badges are immutable and non-transferrable.
@@ -74,7 +74,7 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according
### Example of a Badge Definition event
```json
```jsonc
{
"pubkey": "alice",
"kind": 30009,
@@ -85,13 +85,13 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according
["image", "https://nostr.academy/awards/bravery.png", "1024x1024"],
["thumb", "https://nostr.academy/awards/bravery_256x256.png", "256x256"]
],
...
// other fields...
}
```
### Example of Badge Award event
```json
```jsonc
{
"id": "<badge award event id>",
"kind": 8,
@@ -101,14 +101,14 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according
["p", "bob", "wss://relay"],
["p", "charlie", "wss://relay"]
],
...
// other fields...
}
```
### Example of a Profile Badges event
Honorable Bob The Brave:
```json
```jsonc
{
"kind": 30008,
"pubkey": "bob",
@@ -119,6 +119,6 @@ Honorable Bob The Brave:
["a", "30009:alice:honor"],
["e", "<honor badge award event id>", "wss://nostr.academy"]
],
...
// other fields...
}
```

4
59.md
View File

@@ -41,7 +41,7 @@ A `seal` is a `kind:13` event that wraps a `rumor` with the sender's regular key
to a receiver's pubkey but there is no `p` tag pointing to the receiver. There is no way to know who the rumor is for
without the receiver's or the sender's private key. The only public information in this event is who is signing it.
```js
```json
{
"id": "<id>",
"pubkey": "<real author's pubkey>",
@@ -60,7 +60,7 @@ Tags MUST must always be empty in a `kind:13`. The inner event MUST always be un
A `gift wrap` event is a `kind:1059` event that wraps any other event. `tags` SHOULD include any information
needed to route the event to its intended recipient, including the recipient's `p` tag or [NIP-13](13.md) proof of work.
```js
```json
{
"id": "<id>",
"pubkey": "<random, one-time-use pubkey>",

146
64.md Normal file
View File

@@ -0,0 +1,146 @@
NIP-64
======
Chess (Portable Game Notation)
------------------------------
`draft` `optional`
This NIP defines `kind:64` notes representing chess games in [PGN][pgn_specification] format, which can be read by humans and is also supported by most chess software.
## Note
### Content
The `.content` of these notes is a string representing a [PGN-database][pgn_formal_syntax].
### Notes
```jsonc
{
"kind": 64,
"content": "1. e4 *",
// other fields...
}
```
```jsonc
{
"kind": 64,
"tags": [
["alt", "Fischer vs. Spassky in Belgrade on 1992-11-04 (F/S Return Match, Round 29)"],
// rest of tags...
],
"content": "[Event \"F/S Return Match\"]\n[Site \"Belgrade, Serbia JUG\"]\n[Date \"1992.11.04\"]\n[Round \"29\"]\n[White \"Fischer, Robert J.\"]\n[Black \"Spassky, Boris V.\"]\n[Result \"1/2-1/2\"]\n\n1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} 3... a6\n4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7\n11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5\nNxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6\n23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5\nhxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5\n35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6\nNf2 42. g4 Bd3 43. Re6 1/2-1/2",
// other fields...
}
```
## Client Behavior
Clients SHOULD display the content represented as chessboard.
Clients SHOULD publish PGN notes in ["export format"][pgn_export_format] ("strict mode", i.e. created by machines) but expect incoming notes to be in ["import format"][pgn_import_format] ("lax mode", i.e. created by humans).
Clients SHOULD check whether the formatting is valid and all moves comply with chess rules.
Clients MAY include additional tags (e.g. like [`"alt"`](https://github.com/nostr-protocol/nips/blob/master/31.md)) in order to represent the note to users of non-supporting clients.
## Relay Behavior
Relays MAY validate PGN contents and reject invalid notes.
## Examples
```pgn
// A game where nothing is known. Game still in progress, game abandoned, or result otherwise unknown.
// Maybe players died before a move has been made.
*
```
```pgn
1. e4 *
```
```pgn
[White "Fischer, Robert J."]
[Black "Spassky, Boris V."]
1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} *
```
```pgn
[Event "F/S Return Match"]
[Site "Belgrade, Serbia JUG"]
[Date "1992.11.04"]
[Round "29"]
[White "Fischer, Robert J."]
[Black "Spassky, Boris V."]
[Result "1/2-1/2"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} 3... a6
4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7
11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5
Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6
23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5
hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5
35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6
Nf2 42. g4 Bd3 43. Re6 1/2-1/2
```
```pgn
[Event "Hourly HyperBullet Arena"]
[Site "https://lichess.org/wxx4GldJ"]
[Date "2017.04.01"]
[White "T_LUKE"]
[Black "decidement"]
[Result "1-0"]
[UTCDate "2017.04.01"]
[UTCTime "11:56:14"]
[WhiteElo "2047"]
[BlackElo "1984"]
[WhiteRatingDiff "+10"]
[BlackRatingDiff "-7"]
[Variant "Standard"]
[TimeControl "30+0"]
[ECO "B00"]
[Termination "Abandoned"]
1. e4 1-0
[Event "Hourly HyperBullet Arena"]
[Site "https://lichess.org/rospUdSk"]
[Date "2017.04.01"]
[White "Bastel"]
[Black "oslochess"]
[Result "1-0"]
[UTCDate "2017.04.01"]
[UTCTime "11:55:56"]
[WhiteElo "2212"]
[BlackElo "2000"]
[WhiteRatingDiff "+6"]
[BlackRatingDiff "-4"]
[Variant "Standard"]
[TimeControl "30+0"]
[ECO "A01"]
[Termination "Normal"]
1. b3 d5 2. Bb2 c6 3. Nc3 Bf5 4. d4 Nf6 5. e3 Nbd7 6. f4 Bg6 7. Nf3 Bh5 8. Bd3 e6 9. O-O Be7 10. Qe1 O-O 11. Ne5 Bg6 12. Nxg6 hxg6 13. e4 dxe4 14. Nxe4 Nxe4 15. Bxe4 Nf6 16. c4 Bd6 17. Bc2 Qc7 18. f5 Be7 19. fxe6 fxe6 20. Qxe6+ Kh8 21. Qh3+ Kg8 22. Bxg6 Qd7 23. Qe3 Bd6 24. Bf5 Qe7 25. Be6+ Kh8 26. Qh3+ Nh7 27. Bf5 Rf6 28. Qxh7# 1-0
```
## Resources
- [PGN Specification][pgn_specification]: PGN (Portable Game Notation) specification
- [PGN Specification Supplement](https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-spec-supplement.md): Addition for adding graphical elements, clock values, eval, ...
- [PGN Formal Syntax][pgn_formal_syntax]
- [PGN Seven Tag Roster][pgn_seven_tag_roster]
- [PGN Import Format][pgn_import_format]
- [PGN Export Format][pgn_export_format]
- [lichess / pgn-viewer (GitHub)](https://github.com/lichess-org/pgn-viewer): PGN viewer widget, designed to be embedded in content pages
[pgn_specification]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md
[pgn_formal_syntax]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#18-formal-syntax
[pgn_seven_tag_roster]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#811-seven-tag-roster
[pgn_import_format]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#31-import-format-allows-for-manually-prepared-data
[pgn_export_format]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#32-export-format-used-for-program-generated-output

4
65.md
View File

@@ -12,7 +12,7 @@ The event MUST include a list of `r` tags with relay URIs and a `read` or `write
The `.content` is not used.
```json
```jsonc
{
"kind": 10002,
"tags": [
@@ -22,7 +22,7 @@ The `.content` is not used.
["r", "wss://nostr-relay.example.com", "read"]
],
"content": "",
...other fields
// other fields...
}
```

6
71.md
View File

@@ -2,11 +2,11 @@ NIP-71
======
Video Events
---------------
------------
`draft` `optional`
This specification defines video events representing a dedicated post of externally hosted content. These video events are _parameterized replaceable_ and deletable per [NIP-09](09.md).
This specification defines video events representing a dedicated post of externally hosted content. These video events are _addressable_ and delete-requestable per [NIP-09](09.md).
Unlike a `kind 1` event with a video attached, Video Events are meant to contain all additional metadata concerning the subject media and to be surfaced in video-specific clients rather than general micro-blogging clients. The thought is for events of this kind to be referenced in a Netflix, YouTube, or TikTok like nostr client where the video itself is at the center of the experience.
@@ -42,7 +42,7 @@ The list of tags are as follows:
* `p` (optional, repeated) 32-bytes hex pubkey of a participant in the video, optional recommended relay URL
* `r` (optional, repeated) references / links to web pages
```json
```jsonc
{
"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>,

8
72.md
View File

@@ -35,7 +35,7 @@ The goal of this NIP is to enable public communities. It defines the replaceable
["relay", "<relay where to send and receive approvals>", "approvals"],
["relay", "<relay where to post requests to and fetch approvals from>"]
],
...
// other fields...
}
```
@@ -50,7 +50,7 @@ Any Nostr event can be posted to a community. Clients MUST add one or more commu
["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
],
"content": "hello world",
// ...
// other fields...
}
```
@@ -62,7 +62,7 @@ An approval event MUST include one or more community `a` tags, an `e` or `a` tag
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.
Moderators MAY request deletion of their approval of a post at any time using [NIP-09 event deletion requests](09.md).
```jsonc
{
@@ -75,7 +75,7 @@ Moderators MAY delete their approval of a post at any time using NIP 09 event de
["k", "<post-request-kind>"]
],
"content": "<the full approved event, JSON-encoded>",
// ...
// other fields...
}
```

48
73.md Normal file
View File

@@ -0,0 +1,48 @@
NIP-73
======
External Content IDs
--------------------
`draft` `optional`
There are certain established global content identifiers that would be useful to reference in nostr events so that clients can query all events assosiated with these ids.
- Book [ISBNs](https://en.wikipedia.org/wiki/ISBN)
- Podcast [GUIDs](https://podcastnamespace.org/tag/guid)
- Movie [ISANs](https://en.wikipedia.org/wiki/International_Standard_Audiovisual_Number)
Since the `i` tag is already used for similar references in kind-0 metadata events it makes sense to use it for these content ids as well.
## Supported IDs
### Books:
- Book ISBN: `["i", "isbn:9780765382030"]` - https://isbnsearch.org/isbn/9780765382030
Book ISBNs MUST be referenced _**without hyphens**_ as many book search APIs return the ISBNs without hyphens. Removing hypens from ISBNs is trivial, whereas adding the hyphens back in is non-trivial requiring a library.
### Podcasts:
- Podcast RSS Feed GUID: `["i", "podcast:guid:c90e609a-df1e-596a-bd5e-57bcc8aad6cc"]` - https://podcastindex.org/podcast/c90e609a-df1e-596a-bd5e-57bcc8aad6cc
- Podcast RSS Item GUID: `["i", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f"]`
- Podcast RSS Publisher GUID: `["i", "podcast:publisher:guid:18bcbf10-6701-4ffb-b255-bc057390d738"]`
### Movies:
- Movie ISAN: `["i", "isan:0000-0000-401A-0000-7"]` - https://web.isan.org/public/en/isan/0000-0000-401A-0000-7
Movie ISANs SHOULD be referenced _**without the version part**_ as the versions / edits of movies are not relevant. More info on ISAN parts here - https://support.isan.org/hc/en-us/articles/360002783131-Records-relations-and-hierarchies-in-the-ISAN-Registry
---
### Optional URL Hints
Each `i` tag MAY have a url hint as the second argument to redirect people to a website if the client isn't opinionated about how to interpret the id:
`["i", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f", https://fountain.fm/episode/z1y9TMQRuqXl2awyrQxg]`
`["i", "isan:0000-0000-401A-0000-7", https://www.imdb.com/title/tt0120737]`

24
75.md
View File

@@ -21,15 +21,16 @@ The following tags are defined as REQUIRED.
Example event:
```json
```jsonc
{
"kind": 9041,
"tags": [
["relays", "wss://alicerelay.example.com", "wss://bobrelay.example.com", ...],
["relays", "wss://alicerelay.example.com", "wss://bobrelay.example.com", /*...*/],
["amount", "210000"],
],
"content": "Nostrasia travel expenses",
...
// other fields...
}
```
The following tags are OPTIONAL.
@@ -38,36 +39,35 @@ The following tags are OPTIONAL.
- `image` - an image for the goal
- `summary` - a brief description
```json
```jsonc
{
"kind": 9041,
"tags": [
["relays", "wss://alicerelay.example.com", "wss://bobrelay.example.com", ...],
["relays", "wss://alicerelay.example.com", "wss://bobrelay.example.com", /*...*/],
["amount", "210000"],
["closed_at", "<unix timestamp in seconds>"],
["image", "<image URL>"],
["summary", "<description of the goal>"],
],
"content": "Nostrasia travel expenses",
...
// other fields...
}
```
The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event.
The goal MAY include an `r` or `a` tag linking to a URL or addressable event.
The goal MAY include multiple beneficiary pubkeys by specifying [`zap` tags](57.md#appendix-g-zap-tag-on-other-events).
Parameterized replaceable events can link to a goal by using a `goal` tag specifying the event id and an optional relay hint.
Addressable events can link to a goal by using a `goal` tag specifying the event id and an optional relay hint.
```json
```jsonc
{
...
"kind": 3xxxx,
"tags": [
...
["goal", "<event id>", "<Relay URL (optional)>"],
// rest of tags...
],
...
// other fields...
}
```

2
78.md
View File

@@ -12,7 +12,7 @@ Even though interoperability is great, some apps do not want or do not need inte
## Nostr event
This NIP specifies the use of event kind `30078` (parameterized replaceable event) with a `d` tag containing some reference to the app name and context -- or any other arbitrary string. `content` and other `tags` can be anything or in any format.
This NIP specifies the use of event kind `30078` (an _addressable_ event) with a `d` tag containing some reference to the app name and context -- or any other arbitrary string. `content` and other `tags` can be anything or in any format.
## Some use cases

4
84.md
View File

@@ -26,14 +26,14 @@ useful when highlighting non-nostr content for which the client might be able to
(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
```jsonc
{
"tags": [
["p", "<pubkey-hex>", "<relay-url>", "author"],
["p", "<pubkey-hex>", "<relay-url>", "author"],
["p", "<pubkey-hex>", "<relay-url>", "editor"]
],
...
// other fields...
}
```

22
89.md
View File

@@ -27,7 +27,7 @@ There are three actors to this workflow:
## Events
### Recommendation event
```json
```jsonc
{
"kind": 31989,
"pubkey": <recommender-user-pubkey>,
@@ -35,7 +35,8 @@ There are three actors to this workflow:
["d", <supported-event-kind>],
["a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios"],
["a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web"]
]
],
// other fields...
}
```
@@ -47,7 +48,7 @@ The second value of the tag SHOULD be a relay hint.
The third value of the tag SHOULD be the platform where this recommendation might apply.
## Handler information
```json
```jsonc
{
"kind": 31990,
"pubkey": "<application-pubkey>",
@@ -59,7 +60,8 @@ The third value of the tag SHOULD be the platform where this recommendation migh
["web", "https://..../p/<bech32>", "nprofile"],
["web", "https://..../e/<bech32>"],
["ios", ".../<bech32>"]
]
],
// other fields...
}
```
@@ -77,13 +79,13 @@ A tag without a second value in the array SHOULD be considered a generic handler
# Client tag
When publishing events, clients MAY include a `client` tag. Identifying the client that published the note. This tag is a tuple of `name`, `address` identifying a handler event and, a relay `hint` for finding the handler event. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag.
```json
```jsonc
{
"kind": 1,
"tags": [
["client", "My Client", "31990:app1-pubkey:<d-identifier>", "wss://relay1"]
]
...
// other fields...
}
```
@@ -99,14 +101,14 @@ The client MIGHT query for the user's and the user's follows handler.
### User A recommends a `kind:31337`-handler
User A might be a user of Zapstr, a `kind:31337`-centric client (tracks). Using Zapstr, user A publishes an event recommending Zapstr as a `kind:31337`-handler.
```json
```jsonc
{
"kind": 31989,
"tags": [
["d", "31337"],
["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web"]
],
...
// other fields...
}
```
@@ -115,7 +117,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`:
```json
```
["REQ", <id>, { "kinds": [31989], "#d": ["31337"], "authors": [<user>, <users-contact-list>] }]
```
@@ -126,6 +128,6 @@ User B's client sees the application's `kind:31990` which includes the informati
### Alternative query bypassing `kind:31989`
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
```
["REQ", <id>, { "kinds": [31990], "#k": [<desired-event-kind>], "authors": [...] }]
```

26
90.md
View File

@@ -36,7 +36,7 @@ There are two actors in the workflow described in this NIP:
## Job request (`kind:5000-5999`)
A request to process data, published by a customer. This event signals that a customer is interested in receiving the result of some kind of compute.
```json
```jsonc
{
"kind": 5xxx, // kind in 5000-5999 range
"content": "",
@@ -46,7 +46,8 @@ A request to process data, published by a customer. This event signals that a cu
[ "relays", "wss://..." ],
[ "bid", "<msat-amount>" ],
[ "t", "bitcoin" ]
]
],
// other fields...
}
```
@@ -81,19 +82,18 @@ If the user wants to keep the input parameters a secret, they can encrypt the `i
["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
```json
```jsonc
{
"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
"tags": [
["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
["encrypted"]
],
...
// other fields...
}
```
@@ -102,7 +102,7 @@ This param data will be encrypted and added to the `content` field and `p` tag s
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
```jsonc
{
"pubkey": "<service-provider pubkey>",
"content": "<payload>",
@@ -114,7 +114,7 @@ Service providers publish job results, providing the output of the job result. T
["p", "<customer's-pubkey>"],
["amount", "requested-payment-amount", "<optional-bolt11>"]
],
...
// other fields...
}
```
@@ -127,7 +127,7 @@ Service providers publish job results, providing the output of the job result. T
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
```jsonc
{
"pubkey": "<service-provider pubkey>",
"content": "<encrypted payload>",
@@ -139,7 +139,7 @@ Add a tag encrypted to mark the output content as `encrypted`
["amount", "requested-payment-amount", "<optional-bolt11>"],
["encrypted"]
],
...
// other fields...
}
```
@@ -147,7 +147,7 @@ Add a tag encrypted to mark the output content as `encrypted`
Service providers can give feedback about a job back to the customer.
```json
```jsonc
{
"kind": 7000,
"content": "<empty-or-payload>",
@@ -157,7 +157,7 @@ Service providers can give feedback about a job back to the customer.
["e", "<job-request-id>", "<relay-hint>"],
["p", "<customer's-pubkey>"],
],
...
// other fields...
}
```
@@ -211,7 +211,7 @@ This gives a higher level of flexibility to service providers (which sophisticat
# Appendix 2: Service provider discoverability
Service Providers MAY use NIP-89 announcements to advertise their support for job kinds:
```js
```jsonc
{
"kind": 31990,
"pubkey": "<pubkey>",
@@ -223,7 +223,7 @@ Service Providers MAY use NIP-89 announcements to advertise their support for jo
["k", "5005"], // e.g. translation
["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains"
],
...
// other fields...
}
```

4
94.md
View File

@@ -27,7 +27,7 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
* `alt` (optional) description for accessibility
* `fallback` (optional) zero or more fallback file sources in case `url` fails
```json
```jsonc
{
"kind": 1063,
"tags": [
@@ -46,7 +46,7 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
["alt", <description>]
],
"content": "<caption>",
...
// other fields...
}
```

59
96.md
View File

@@ -1,6 +1,8 @@
# NIP-96
NIP-96
======
## HTTP File Storage Integration
HTTP File Storage Integration
-----------------------------
`draft` `optional`
@@ -17,7 +19,7 @@ will not have to learn anything about nostr relays.
File storage servers wishing to be accessible by nostr users should opt-in by making available an https route at `/.well-known/nostr/nip96.json` with `api_url`:
```js
```jsonc
{
// Required
// File upload and deletion are served from this url
@@ -57,7 +59,7 @@ File storage servers wishing to be accessible by nostr users should opt-in by ma
"file_expiration": [14, 90],
"media_transformations": {
"image": [
'resizing'
"resizing"
]
}
}
@@ -125,14 +127,14 @@ The `server` MUST link the user's `pubkey` string as the owner of the file so to
The upload response is a json object as follows:
```js
```jsonc
{
// "success" if successful or "error" if not
status: "success",
"status": "success",
// Free text success, failure or info message
message: "Upload successful.",
"message": "Upload successful.",
// Optional. See "Delayed Processing" section
processing_url: "...",
"processing_url": "...",
// This uses the NIP-94 event format but DO NOT need
// to fill some fields like "id", "pubkey", "created_at" and "sig"
//
@@ -141,9 +143,9 @@ The upload response is a json object as follows:
// and, optionally, all file metadata the server wants to make available
//
// nip94_event field is absent if unsuccessful upload
nip94_event: {
"nip94_event2": {
// Required tags: "url" and "ox"
tags: [
"tags": [
// Can be same from /.well-known/nostr/nip96.json's "download_url" field
// (or "api_url" field if "download_url" is absent or empty) with appended
// original file hash.
@@ -164,12 +166,12 @@ The upload response is a json object as follows:
// The server can but does not need to store this value.
["x", "543244319525d9d08dd69cb716a18158a249b7b3b3ec4bbde5435543acb34443"],
// Optional. Recommended for helping clients to easily know file type before downloading it.
["m", "image/png"]
["m", "image/png"],
// Optional. Recommended for helping clients to reserve an adequate UI space to show the file before downloading it.
["dim", "800x600"]
// ... other optional NIP-94 tags
],
content: ""
"content": ""
},
// ... other custom fields (please consider adding them to this NIP or to NIP-94 tags)
}
@@ -200,12 +202,12 @@ the file processing is done.
If the processing isn't done, the server should reply at the `processing_url` url with **200 OK** and the following JSON:
```
```jsonc
{
// It should be "processing". If "error" it would mean the processing failed.
status: "processing",
message: "Processing. Please check again later for updated status.",
percentage: 15 // Processing percentage. An integer between 0 and 100.
"status": "processing",
"message": "Processing. Please check again later for updated status.",
"percentage": 15 // Processing percentage. An integer between 0 and 100.
}
```
@@ -268,10 +270,10 @@ in the same file hash).
The successful response is a 200 OK one with just basic JSON fields:
```
```json
{
status: "success",
message: "File deleted."
"status": "success",
"message": "File deleted."
}
```
@@ -285,7 +287,7 @@ Returns a list of files linked to the authenticated users pubkey.
Example Response:
```js
```jsonc
{
"count": 1, // server page size, eg. max(1, min(server_max_page_size, arg_count))
"total": 1, // total number of files
@@ -293,17 +295,16 @@ Example Response:
"files": [
{
"tags": [
["ox": "719171db19525d9d08dd69cb716a18158a249b7b3b3ec4bbdec5698dca104b7b"],
["x": "5d2899290e0e69bcd809949ee516a4a1597205390878f780c098707a7f18e3df"],
["ox", "719171db19525d9d08dd69cb716a18158a249b7b3b3ec4bbdec5698dca104b7b"],
["x", "5d2899290e0e69bcd809949ee516a4a1597205390878f780c098707a7f18e3df"],
["size", "123456"],
["alt", "a meme that makes you laugh"],
["expiration", "1715691139"],
// ...other metadata
]
],
"content": "haha funny meme", // caption
"created_at": 1715691130 // upload timestamp
},
...
}
]
}
```
@@ -322,14 +323,14 @@ Note: HTTP File Storage Server developers may skip this section. This is meant f
A File Server Preference event is a kind 10096 replaceable event meant to select one or more servers the user wants
to upload files to. Servers are listed as `server` tags:
```js
{
// ...
```json
{.
"kind": 10096,
"content": "",
"tags": [
["server", "https://file.server.one"],
["server", "https://file.server.two"]
]
],
// other fields...
}
```

4
99.md
View File

@@ -6,7 +6,7 @@ Classified Listings
`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.
This NIP defines `kind:30402`: an addressable 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](15.md) that often sell many units of specific products through very specific channels.
@@ -54,7 +54,7 @@ Other standard tags that might be useful.
## Example Event
```json
```jsonc
{
"kind": 30402,
"created_at": 1675642635,

View File

@@ -5,6 +5,7 @@ reverse chronological order.
| Date | Commit | NIP | Change |
| ----------- | --------- | -------- | ------ |
| 2024-08-18 | [3aff37bd](https://github.com/nostr-protocol/nips/commit/3aff37bd) | [NIP-54](54.md) | content should be Asciidoc |
| 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 |
@@ -47,6 +48,7 @@ reverse chronological order.
| 2023-06-18 | [83cbd3e1](https://github.com/nostr-protocol/nips/commit/83cbd3e1) | [NIP-11](11.md) | 'image' was renamed to 'icon' |
| 2023-04-13 | [bf0a0da6](https://github.com/nostr-protocol/nips/commit/bf0a0da6) | [NIP-15](15.md) | different NIP was re-added as NIP-15 |
| 2023-04-09 | [fb5b7c73](https://github.com/nostr-protocol/nips/commit/fb5b7c73) | [NIP-15](15.md) | NIP-15 was merged into NIP-01 |
| 2023-03-29 | [599e1313](https://github.com/nostr-protocol/nips/commit/599e1313) | [NIP-18](18.md) | NIP-18 was bring back |
| 2023-03-15 | [e1004d3d](https://github.com/nostr-protocol/nips/commit/e1004d3d) | [NIP-19](19.md) | `1: relay` was changed to optionally |
Breaking changes prior to 2023-03-01 are not yet documented.

View File

@@ -30,7 +30,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
- [NIP-06: Basic key derivation from mnemonic seed phrase](06.md)
- [NIP-07: `window.nostr` capability for web browsers](07.md)
- [NIP-08: Handling Mentions](08.md) --- **unrecommended**: deprecated in favor of [NIP-27](27.md)
- [NIP-09: Event Deletion](09.md)
- [NIP-09: Event Deletion Request](09.md)
- [NIP-10: Conventions for clients' use of `e` and `p` tags in text events](10.md)
- [NIP-11: Relay Information Document](11.md)
- [NIP-13: Proof of Work](13.md)
@@ -73,10 +73,12 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
- [NIP-57: Lightning Zaps](57.md)
- [NIP-58: Badges](58.md)
- [NIP-59: Gift Wrap](59.md)
- [NIP-64: Chess (PGN)](64.md)
- [NIP-65: Relay List Metadata](65.md)
- [NIP-70: Protected Events](70.md)
- [NIP-71: Video Events](71.md)
- [NIP-72: Moderated Communities](72.md)
- [NIP-73: External Content IDs](73.md)
- [NIP-75: Zap Goals](75.md)
- [NIP-78: Application-specific data](78.md)
- [NIP-84: Highlights](84.md)
@@ -97,7 +99,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `2` | Recommend Relay | 01 (deprecated) |
| `3` | Follows | [02](02.md) |
| `4` | Encrypted Direct Messages | [04](04.md) |
| `5` | Event Deletion | [09](09.md) |
| `5` | Event Deletion Request | [09](09.md) |
| `6` | Repost | [18](18.md) |
| `7` | Reaction | [25](25.md) |
| `8` | Badge Award | [58](58.md) |
@@ -108,11 +110,13 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `13` | Seal | [59](59.md) |
| `14` | Direct Message | [17](17.md) |
| `16` | Generic Repost | [18](18.md) |
| `17` | Reaction to a website | [25](25.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) |
| `64` | Chess (PGN) | [64](64.md) |
| `818` | Merge Requests | [54](54.md) |
| `1021` | Bid | [15](15.md) |
| `1022` | Bid confirmation | [15](15.md) |
@@ -127,6 +131,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `1971` | Problem Tracker | [nostrocket][nostrocket] |
| `1984` | Reporting | [56](56.md) |
| `1985` | Label | [32](32.md) |
| `1986` | Relay reviews | |
| `1987` | AI Embeddings / Vector lists | [NKBIP-02] |
| `2003` | Torrent | [35](35.md) |
| `2004` | Torrent Comment | [35](35.md) |
| `2022` | Coinjoin Pool | [joinstr][joinstr] |
@@ -136,6 +142,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `7000` | Job Feedback | [90](90.md) |
| `9000`-`9030` | Group Control Events | [29](29.md) |
| `9041` | Zap Goal | [75](75.md) |
| `9467` | Tidal login | [Tidal-nostr] |
| `9734` | Zap Request | [57](57.md) |
| `9735` | Zap | [57](57.md) |
| `9802` | Highlights | [84](84.md) |
@@ -151,6 +158,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `10015` | Interests list | [51](51.md) |
| `10030` | User emoji list | [51](51.md) |
| `10050` | Relay list to receive DMs | [51](51.md), [17](17.md) |
| `10063` | User server list | [blossom] |
| `10096` | File storage server list | [96](96.md) |
| `13194` | Wallet Info | [47](47.md) |
| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] |
@@ -158,6 +166,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `23194` | Wallet Request | [47](47.md) |
| `23195` | Wallet Response | [47](47.md) |
| `24133` | Nostr Connect | [46](46.md) |
| `24242` | Blobs stored on mediaservers | [blossom] |
| `27235` | HTTP Auth | [98](98.md) |
| `30000` | Follow sets | [51](51.md) |
| `30001` | Generic lists | [51](51.md) |
@@ -165,6 +174,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `30003` | Bookmark sets | [51](51.md) |
| `30004` | Curation sets | [51](51.md) |
| `30005` | Video sets | [51](51.md) |
| `30007` | Kind mute sets | [51](51.md) |
| `30008` | Profile Badges | [58](58.md) |
| `30009` | Badge Definition | [58](58.md) |
| `30015` | Interest sets | [51](51.md) |
@@ -175,6 +185,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `30023` | Long-form Content | [23](23.md) |
| `30024` | Draft Long-form Content | [23](23.md) |
| `30030` | Emoji sets | [51](51.md) |
| `30040` | Modular Article Header | [NKBIP-01] |
| `30041` | Modular Article Content | [NKBIP-01] |
| `30063` | Release artifact sets | [51](51.md) |
| `30078` | Application-specific Data | [78](78.md) |
| `30311` | Live Event | [53](53.md) |
@@ -198,10 +210,14 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `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/
[nostrocket]: https://github.com/nostrocket/NIPS/blob/main/Problems.md
[lnpub]: https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md
[joinstr]: https://gitlab.com/1440000bytes/joinstr/-/blob/main/NIP.md
[NKBIP-01]: https://wikistr.com/nkbip-01
[NKBIP-02]: https://wikistr.com/nkbip-02
[Blossom]: https://wikistr.com/blossom
[Tidal-nostr]: https://wikistr.com/tidal-nostr
## Message types
@@ -238,15 +254,15 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `-` | -- | -- | [70](70.md) |
| `g` | geohash | -- | [52](52.md) |
| `h` | group id | -- | [29](29.md) |
| `i` | identity | proof | [39](39.md) |
| `i` | external identity | proof, url hint | [39](39.md), [73](73.md) |
| `k` | kind number (string) | -- | [18](18.md), [25](25.md), [72](72.md) |
| `l` | label, label namespace | -- | [32](32.md) |
| `L` | label namespace | -- | [32](32.md) |
| `m` | MIME type | -- | [94](94.md) |
| `q` | event id (hex) | relay URL | [18](18.md) |
| `r` | a reference (URL, etc) | petname | [24](24.md) |
| `r` | a reference (URL, etc) | -- | [24](24.md), [25](25.md) |
| `r` | relay url | marker | [65](65.md) |
| `t` | hashtag | -- | |
| `t` | hashtag | -- | [24](24.md) |
| `alt` | summary | -- | [31](31.md) |
| `amount` | millisatoshis, stringified | -- | [57](57.md) |
| `bolt11` | `bolt11` invoice | -- | [57](57.md) |
@@ -260,7 +276,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `encrypted` | -- | -- | [90](90.md) |
| `expiration` | unix timestamp (string) | -- | [40](40.md) |
| `goal` | event id (hex) | relay URL | [75](75.md) |
| `image` | image URL | dimensions in pixels | [23](23.md), [58](58.md) |
| `image` | image URL | dimensions in pixels | [23](23.md), [52](52.md), [58](58.md) |
| `imeta` | inline metadata | -- | [92](92.md) |
| `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) |
| `location` | location string | -- | [52](52.md), [99](99.md) |
@@ -274,7 +290,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `relays` | relay list | -- | [57](57.md) |
| `server` | file storage server url | -- | [96](96.md) |
| `subject` | subject | -- | [14](14.md), [17](17.md) |
| `summary` | article summary | -- | [23](23.md) |
| `summary` | summary | -- | [23](23.md), [52](52.md) |
| `thumb` | badge thumbnail | dimensions in pixels | [58](58.md) |
| `title` | article title | -- | [23](23.md) |
| `web` | webpage URL | -- | [34](34.md) |