mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
Merge branch 'nostr-protocol:master' into master
This commit is contained in:
commit
4da44f8a5a
3
01.md
3
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 `<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.
|
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, "pow: difficulty 26 is less than 30"]`
|
||||||
* `["OK", "b1a649ebe8...", false, "error: could not connect to the database"]`
|
* `["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` 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", "unsupported: filter contains unknown elements"]`
|
||||||
* `["CLOSED", "sub1", "error: could not connect to the database"]`
|
* `["CLOSED", "sub1", "error: could not connect to the database"]`
|
||||||
* `["CLOSED", "sub1", "error: shutting down idle subscription"]`
|
* `["CLOSED", "sub1", "error: shutting down idle subscription"]`
|
||||||
|
|
13
05.md
13
05.md
|
@ -58,6 +58,15 @@ A client may implement support for finding users' public keys from _internet ide
|
||||||
|
|
||||||
## Notes
|
## 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
|
### 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).
|
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.
|
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
|
### 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.
|
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.
|
||||||
|
|
10
13.md
10
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
|
Delegated Proof of Work
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|
2
17.md
2
17.md
|
@ -102,7 +102,7 @@ Clients SHOULD publish kind `14` events to the `10050`-listed relays. If that is
|
||||||
|
|
||||||
## Relays
|
## 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.
|
It's advisable that users choose relays that conform to these practices.
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ reverse chronological order.
|
||||||
|
|
||||||
| Date | Commit | NIP | Change |
|
| 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-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-30 | [444ad28d](https://github.com/nostr-protocol/nips/commit/444ad28d) | [NIP-45](45.md) | NIP-45 was deprecated |
|
||||||
| 2024-07-26 | [ecee40df](https://github.com/nostr-protocol/nips/commit/ecee40df) | [NIP-19](19.md) | `nrelay` was deprecated |
|
| 2024-07-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-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-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-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 |
|
| 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.
|
Breaking changes prior to 2023-03-01 are not yet documented.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user