upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/05.md
diff options
context:
space:
mode:
authorKieran <kieran@harkin.me>2024-10-15 11:15:54 +0100
committerGitHub <noreply@github.com>2024-10-15 11:15:54 +0100
commit1e2f19863ca56754daa2466881eb22087a71b17d (patch)
tree4f7be759dce290fea1d3ae10c403260b466ee16c /05.md
parent53afaaece61f02e92b5ef9c3e9c32945c7ebf522 (diff)
parente381b577c997b849fa544eea7dc9f08b360b4a33 (diff)
Merge branch 'master' into nip71-imeta
Diffstat (limited to '05.md')
-rw-r--r--05.md21
1 files changed, 13 insertions, 8 deletions
diff --git a/05.md b/05.md
index 405078a..ca6da7b 100644
--- a/05.md
+++ b/05.md
@@ -6,22 +6,22 @@ Mapping Nostr keys to DNS-based internet identifiers
6 6
7`final` `optional` 7`final` `optional`
8 8
9On events of kind `0` (`metadata`) one can specify the key `"nip05"` with an [internet identifier](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) (an email-like address) as the value. Although there is a link to a very liberal "internet identifier" specification above, NIP-05 assumes the `<local-part>` part will be restricted to the characters `a-z0-9-_.`, case-insensitive. 9On events of kind `0` (`user metadata`) one can specify the key `"nip05"` with an [internet identifier](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) (an email-like address) as the value. Although there is a link to a very liberal "internet identifier" specification above, NIP-05 assumes the `<local-part>` part will be restricted to the characters `a-z0-9-_.`, case-insensitive.
10 10
11Upon seeing that, the client splits the identifier into `<local-part>` and `<domain>` and use these values to make a GET request to `https://<domain>/.well-known/nostr.json?name=<local-part>`. 11Upon seeing that, the client splits the identifier into `<local-part>` and `<domain>` and use these values to make a GET request to `https://<domain>/.well-known/nostr.json?name=<local-part>`.
12 12
13The result should be a JSON document object with a key `"names"` that should then be a mapping of names to hex formatted public keys. If the public key for the given `<name>` matches the `pubkey` from the `metadata` event, the client then concludes that the given pubkey can indeed be referenced by its identifier. 13The result should be a JSON document object with a key `"names"` that should then be a mapping of names to hex formatted public keys. If the public key for the given `<name>` matches the `pubkey` from the `user's metadata` event, the client then concludes that the given pubkey can indeed be referenced by its identifier.
14 14
15### Example 15### Example
16 16
17If a client sees an event like this: 17If a client sees an event like this:
18 18
19```json 19```jsonc
20{ 20{
21 "pubkey": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9", 21 "pubkey": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9",
22 "kind": 0, 22 "kind": 0,
23 "content": "{\"name\": \"bob\", \"nip05\": \"bob@example.com\"}" 23 "content": "{\"name\": \"bob\", \"nip05\": \"bob@example.com\"}"
24 ... 24 // other fields...
25} 25}
26``` 26```
27 27
@@ -58,6 +58,15 @@ A client may implement support for finding users' public keys from _internet ide
58 58
59## Notes 59## Notes
60 60
61### Identification, not verification
62
63The 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.
64Exceptions 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.
65
66### User discovery implementation suggestion
67
68A 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.
69
61### Clients must always follow public keys, not NIP-05 addresses 70### Clients must always follow public keys, not NIP-05 addresses
62 71
63For 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). 72For 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`,
66 75
67Keys 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. 76Keys 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.
68 77
69### User Discovery implementation suggestion
70
71A 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.
72
73### Showing just the domain as an identifier 78### Showing just the domain as an identifier
74 79
75Clients 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. 80Clients 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.