From f6b08429a270fbae71f0ae1689a5adf8fa91c543 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 27 Jun 2024 17:00:16 -0700 Subject: [PATCH 1/5] Clarify what happens when a duplicate subscription is sent, remove CLOSED on duplicate subscription --- 01.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/01.md b/01.md index c11a0954..d298046b 100644 --- a/01.md +++ b/01.md @@ -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 `` or a new `REQ` is sent using the same ``, 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 ``, or a new `REQ` is sent using the same `` (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"]` From b3c1a562690ce34f2c9dd668a5b18da2255afcb1 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 20 Aug 2024 13:23:28 -0300 Subject: [PATCH 2/5] nip13: remove section about pow prefix querying. prefix searching was removed from the spec. --- 13.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/13.md b/13.md index 99289c2a..0900d2d7 100644 --- a/13.md +++ b/13.md @@ -103,16 +103,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 ----------------------- From c7a357285d7265ecd95df70bb684a0c14b675ae5 Mon Sep 17 00:00:00 2001 From: Asai Toshiya Date: Wed, 21 Aug 2024 23:27:27 +0900 Subject: [PATCH 3/5] BREAKING.md: add changes --- BREAKING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BREAKING.md b/BREAKING.md index cac35454..83b104b6 100644 --- a/BREAKING.md +++ b/BREAKING.md @@ -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. From 27c67f0c71397ca9e8ea85eee0264b8aa83e2999 Mon Sep 17 00:00:00 2001 From: Tomas Bezouska Date: Sun, 25 Aug 2024 22:55:25 +0200 Subject: [PATCH 4/5] Update 17.md --- 17.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17.md b/17.md index 0f51367a..d22dbdef 100644 --- a/17.md +++ b/17.md @@ -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. From da34c57e99dbf6cadfb3b4176b7c4ff33ac5674c Mon Sep 17 00:00:00 2001 From: dtonon Date: Thu, 29 Aug 2024 16:25:15 +0200 Subject: [PATCH 5/5] NIP-05: add identification vs verification note --- 05.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/05.md b/05.md index a1d488df..eeca551a 100644 --- a/05.md +++ b/05.md @@ -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 ``. 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.