-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into draft-event
- Loading branch information
Showing
67 changed files
with
3,056 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,22 +6,22 @@ Mapping Nostr keys to DNS-based internet identifiers | |
|
||
`final` `optional` | ||
|
||
On 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. | ||
On 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. | ||
|
||
Upon 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>`. | ||
|
||
The 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. | ||
The 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 metadata` event, the client then concludes that the given pubkey can indeed be referenced by its identifier. | ||
|
||
### Example | ||
|
||
If a client sees an event like this: | ||
|
||
```json | ||
```jsonc | ||
{ | ||
"pubkey": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9", | ||
"kind": 0, | ||
"content": "{\"name\": \"bob\", \"nip05\": \"[email protected]\"}" | ||
... | ||
// other fields... | ||
} | ||
``` | ||
|
||
|
@@ -33,7 +33,7 @@ It will make a GET request to `https://example.com/.well-known/nostr.json?name=b | |
"bob": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9" | ||
} | ||
} | ||
```` | ||
``` | ||
|
||
or with the **recommended** `"relays"` attribute: | ||
|
||
|
@@ -46,7 +46,7 @@ or with the **recommended** `"relays"` attribute: | |
"b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9": [ "wss://relay.example.com", "wss://relay2.example.com" ] | ||
} | ||
} | ||
```` | ||
``` | ||
|
||
If the pubkey matches the one given in `"names"` (as in the example above) that means the association is right and the `"nip05"` identifier is valid and can be displayed. | ||
|
||
|
@@ -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 "[email protected]" 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 `[email protected]` 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 `[email protected]`. 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 "[email protected]" for that user, as that will have become an invalid `"nip05"` property). | ||
|
@@ -66,10 +75,6 @@ For example, if after finding that `[email protected]` 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 "[email protected]" 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 `[email protected]` as that is redundant. Instead, Bob can use the identifier `[email protected]` and expect Nostr clients to show and treat that as just `bob.com` for all purposes. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.