Skip to content

Commit 1079d5f

Browse files
Merge branch 'nostr-protocol:master' into master
2 parents ed9380c + 3f4c696 commit 1079d5f

File tree

31 files changed

+569
-348
lines changed

31 files changed

+569
-348
lines changed

01.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ As a convention, all single-letter (only english alphabet letters: a-z, A-Z) key
8585

8686
### Kinds
8787

88-
Kinds specify how clients should interpret the meaning of each event and the other fields of each event (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002). Each NIP may define the meaning of a set of kinds that weren't defined elsewhere. [NIP-10](10.md), for instance, specifies the `kind:1` text note for social media applications.
88+
Kinds specify how clients should interpret the meaning of each event and the other fields of each event (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002). Each NIP may define the meaning of a set of kinds that weren't defined elsewhere. [NIP-10](10.md), for instance, specifies the `kind:1` text note for social media applications.
8989

9090
This NIP defines one basic kind:
9191

@@ -170,8 +170,9 @@ This NIP defines no rules for how `NOTICE` messages should be sent or treated.
170170
* `["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"]`
171171
* `["OK", "b1a649ebe8...", false, "restricted: not allowed to write."]`
172172
* `["OK", "b1a649ebe8...", false, "error: could not connect to the database"]`
173+
* `["OK", "b1a649ebe8...", false, "mute: no one was listening to your ephemeral event and it wasn't handled in any way, it was ignored"]`
173174
- `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:
174175
* `["CLOSED", "sub1", "unsupported: filter contains unknown elements"]`
175176
* `["CLOSED", "sub1", "error: could not connect to the database"]`
176177
* `["CLOSED", "sub1", "error: shutting down idle subscription"]`
177-
- The standardized machine-readable prefixes for `OK` and `CLOSED` are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, `restricted`, and `error` for when none of that fits.
178+
- The standardized machine-readable prefixes for `OK` and `CLOSED` are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, `restricted`, `mute` and `error` for when none of that fits.

03.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](
1212
{
1313
"kind": 1040
1414
"tags": [
15-
["e", <event-id>, <relay-url>],
16-
["alt", "opentimestamps attestation"]
15+
["e", <target-event-id>, <relay-url>],
16+
["k", "<target-event-kind>"]
1717
],
1818
"content": <base64-encoded OTS file data>
1919
}

18.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@ Since `kind 6` reposts are reserved for `kind 1` contents, we use `kind 16`
4040
as a "generic repost", that can include any kind of event inside other than
4141
`kind 1`.
4242

43-
`kind 16` reposts SHOULD contain a `k` tag with the stringified kind number
43+
`kind 16` reposts SHOULD contain a `"k"` tag with the stringified kind number
4444
of the reposted event as its value.
45-

21.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The identifiers that come after are expected to be the same as those defined in
2121

2222
### Linking HTML pages to Nostr entities
2323

24-
`<link>` tags with `rel="alternate"` can be used to associate webpages to Nostr events, in cases where the same content is served via the two mediums (for example, a web server that exposes Markdown articles both as HTML pages and as `kind:30023' events served under itself as a relay or through some other relay). For example:
24+
`<link>` tags with `rel="alternate"` can be used to associate webpages to Nostr events, in cases where the same content is served via the two mediums (for example, a web server that exposes Markdown articles both as HTML pages and as `kind:30023` events served under itself as a relay or through some other relay). For example:
2525

2626
```
2727
<head>

22.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Tags `K` and `k` MUST be present to define the event kind of the root and the pa
4545

4646
`I` and `i` tags create scopes for hashtags, geohashes, URLs, and other external identifiers.
4747

48-
The possible values for `i` tags – and `k` tags, when related to an extenal identity – are listed on [NIP-73](73.md).
48+
The possible values for `i` tags – and `k` tags, when related to an external identity – are listed on [NIP-73](73.md).
4949
Their uppercase versions use the same type of values but relate to the root item instead of the parent one.
5050

5151
`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).
@@ -143,13 +143,13 @@ A comment on a website's url looks like this:
143143
"tags": [
144144
// referencing the root url
145145
["I", "https://abc.com/articles/1"],
146-
// the root "kind": for an url, the kind is its domain
147-
["K", "https://abc.com"],
146+
// the root "kind": for an url
147+
["K", "web"],
148148

149149
// the parent reference (same as root for top-level comments)
150150
["i", "https://abc.com/articles/1"],
151-
// the parent "kind": for an url, the kind is its domain
152-
["k", "https://abc.com"]
151+
// the parent "kind": for an url
152+
["k", "web"]
153153
]
154154
// other fields
155155
}

24.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Extra metadata fields and tags
88

99
This NIP keeps track of extra optional fields that can added to events which are not defined anywhere else but have become _de facto_ standards and other minor implementation possibilities that do not deserve their own NIP and do not have a place in other NIPs.
1010

11-
kind 0
12-
======
11+
### kind 0
1312

1413
These are extra fields not specified in NIP-01 that may be present in the stringified JSON of metadata events:
1514

@@ -19,24 +18,22 @@ These are extra fields not specified in NIP-01 that may be present in the string
1918
- `bot`: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.
2019
- `birthday`: an object representing the author's birth date. The format is { "year": number, "month": number, "day": number }. Each field MAY be omitted.
2120

22-
### Deprecated fields
21+
#### Deprecated fields
2322

2423
These are fields that should be ignored or removed when found in the wild:
2524

2625
- `displayName`: use `display_name` instead.
2726
- `username`: use `name` instead.
2827

29-
kind 3
30-
======
28+
### kind 3
3129

3230
These are extra fields not specified in NIP-02 that may be present in the stringified JSON of follow events:
3331

34-
### Deprecated fields
32+
#### Deprecated fields
3533

3634
- `{<relay-url>: {"read": <true|false>, "write": <true|false>}, ...}`: an object of relays used by a user to read/write. [NIP-65](65.md) should be used instead.
3735

38-
tags
39-
====
36+
### tags
4037

4138
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:
4239

25.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ There SHOULD be a `p` tag set to the `pubkey` of the event being reacted to. If
2626

2727
If the event being reacted to is an addressable event, an `a` SHOULD be included together with the `e` tag, it must be set to the coordinates (`kind:pubkey:d-tag`) of the event being reacted to.
2828

29-
The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
30-
3129
The `e` and `a` tags SHOULD include relay and pubkey hints. The `p` tags SHOULD include relay hints.
3230

3331
The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.
@@ -47,25 +45,39 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: S
4745
}
4846
```
4947

50-
Reactions to a website
48+
External Content Reactions
5149
---------------------
5250

53-
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.
51+
If the target of a reaction is not a native nostr event, the reaction MUST be a `kind 17` event and MUST include [NIP-73](73.md) external content `k` + `i` tags to properly reference the content.
5452

53+
_Reacting to a website:_
5554
```jsonc
5655
{
5756
"kind": 17,
5857
"content": "",
5958
"tags": [
60-
["r", "https://example.com/"]
59+
["k", "web"],
60+
["i", "https://example.com"]
61+
],
62+
}
63+
```
64+
65+
_Reacting to a podcast episode:_
66+
```jsonc
67+
{
68+
"kind": 17,
69+
"content": "+",
70+
"tags": [
71+
["k", "podcast:guid"],
72+
["i", "podcast:guid:917393e3-1b1e-5cef-ace4-edaa54e1f810", "https://fountain.fm/show/QRT0l2EfrKXNGDlRrmjL"],
73+
["k", "podcast:item:guid"],
74+
["i", "podcast:item:guid:PC20-229", "https://fountain.fm/episode/DQqBg5sD3qFGMCZoSuLF"]
6175
],
62-
// other fields...
6376
}
6477
```
6578

66-
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.
67-
A fragment MAY be attached to the URL, to react to a section of the page.
68-
It should be noted that a URL with a fragment is not considered to be the same URL as the original.
79+
80+
6981

7082
Custom Emoji Reaction
7183
---------------------

26.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> __Warning__ `unrecommended`: adds unecessary burden for little gain
1+
> __Warning__ `unrecommended`: adds unnecessary burden for little gain
22
33
NIP-26
44
=======

34.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ An optional source of truth for the state of branches and tags in a repository.
4545
"kind": 30618,
4646
"content": "",
4747
"tags": [
48-
["d", "<repo-id>"], // matches the identifier in the coresponding repository announcement
48+
["d", "<repo-id>"], // matches the identifier in the corresponding repository announcement
4949
["refs/<heads|tags>/<branch-or-tag-name>","<commit-id>"]
5050
["HEAD", "ref: refs/heads/<branch-name>"]
5151
]
@@ -70,9 +70,9 @@ The `refs` tag can be optionally extended to enable clients to identify how many
7070

7171
Patches can be sent by anyone to any repository. Patches to a specific repository SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address.
7272

73-
Patches in a patch set SHOULD include a NIP-10 `e` `reply` tag pointing to the previous patch.
73+
Patches in a patch set SHOULD include a [NIP-10](10.md) `e` `reply` tag pointing to the previous patch.
7474

75-
The first patch revision in a patch revision SHOULD include a NIP-10 `e` `reply` to the original root patch.
75+
The first patch revision in a patch revision SHOULD include a [NIP-10](10.md) `e` `reply` to the original root patch.
7676

7777
```jsonc
7878
{
@@ -125,7 +125,7 @@ Issues may have a `subject` tag, which clients can utilize to display a header.
125125

126126
## Replies
127127

128-
Replies to either a `kind:1621` _issue_ or a `kind:1617` _patch_ event should follow [NIP-22 comment](22.md).
128+
Replies to either a `kind:1621` (_issue_) or a `kind:1617` (_patch_) event should follow [NIP-22 comment](22.md).
129129

130130
## Status
131131

@@ -150,7 +150,7 @@ Root Patches and Issues have a Status that defaults to 'Open' and can be set by
150150
["r", "<earliest-unique-commit-id-of-repo>"]
151151

152152
// optional for `1631` status
153-
["e", "<applied-or-merged-patch-event-id>", "", "mention"], // for each
153+
["q", "<applied-or-merged-patch-event-id>", "<relay-url>", "<pubkey>"], // for each
154154
// when merged
155155
["merge-commit", "<merge-commit-id>"]
156156
["r", "<merge-commit-id>"]
@@ -161,9 +161,9 @@ Root Patches and Issues have a Status that defaults to 'Open' and can be set by
161161
}
162162
```
163163

164-
The Status event with the largest created_at date is valid.
164+
The most recent Status event (by `created_at` date) from either the issue/patch author or a maintainer is considered valid.
165165

166-
The Status of a patch-revision defaults to either that of the root-patch, or `1632` (Closed) if the root-patch's Status is `1631` and the patch-revision isn't tagged in the `1631` event.
166+
The Status of a patch-revision is to either that of the root-patch, or `1632` (_Closed_) if the root-patch's Status is `1631` (_Applied/Merged_) and the patch-revision isn't tagged in the `1631` (_Applied/Merged_) event.
167167

168168

169169
## Possible things to be added later

38.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ The status MAY include an `r`, `p`, `e` or `a` tag linking to a URL, profile, no
5050

5151
The `content` MAY include emoji(s), or [NIP-30](30.md) custom emoji(s). If the `content` is an empty string then the client should clear the status.
5252

53-
# Client behavior
53+
## Client behavior
5454

5555
Clients MAY display this next to the username on posts or profiles to provide live user status information.
5656

57-
# Use Cases
57+
## Use Cases
5858

5959
* Calendar nostr apps that update your general status when you're in a meeting
6060
* Nostr Nests that update your general status with a link to the nest when you join

0 commit comments

Comments
 (0)