diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2023-01-04 10:34:24 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2023-01-04 10:34:24 -0300 |
| commit | 8c3c42171503fd07e24bb8681fc01419974a2ac0 (patch) | |
| tree | 22a9eee9f2023d83b594fb5b691c516ec667097b /05.md | |
| parent | 4472f9bbd951db084d1ce460b8b00d7de0c5e154 (diff) | |
merge NIP-35 into NIP-05.
Diffstat (limited to '05.md')
| -rw-r--r-- | 05.md | 21 |
1 files changed, 18 insertions, 3 deletions
| @@ -4,7 +4,7 @@ NIP-05 | |||
| 4 | Mapping Nostr keys to DNS-based internet identifiers | 4 | Mapping Nostr keys to DNS-based internet identifiers |
| 5 | ---------------------------------------------------- | 5 | ---------------------------------------------------- |
| 6 | 6 | ||
| 7 | `final` `optional` `author:fiatjaf` | 7 | `final` `optional` `author:fiatjaf` `author:mikedilger` |
| 8 | 8 | ||
| 9 | On events of kind `0` (`set_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. | 9 | On events of kind `0` (`set_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 | ||
| @@ -33,9 +33,24 @@ It will make a GET request to `https://example.com/.well-known/nostr.json?name=b | |||
| 33 | "bob": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9" | 33 | "bob": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9" |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
| 36 | ``` | 36 | ```` |
| 37 | |||
| 38 | or with the **optional** `"relays"` attribute: | ||
| 39 | |||
| 40 | ```json | ||
| 41 | { | ||
| 42 | "names": { | ||
| 43 | "bob": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9" | ||
| 44 | }, | ||
| 45 | "relays": { | ||
| 46 | "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9": [ "wss://relay.example.com", "wss://relay2.example.com" ] | ||
| 47 | } | ||
| 48 | } | ||
| 49 | ```` | ||
| 50 | |||
| 51 | 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. | ||
| 37 | 52 | ||
| 38 | That will mean everything is alright. | 53 | The optional `"relays"` attribute may contain an object with public keys as properties and arrays of relay URLs as values. When present, that can be used to help clients learn in which relays a that user may be found. Web servers which serve `/.well-known/nostr.json` files dynamically based on the query string SHOULD also serve the relays data for any name they serve in the same reply when that is available. |
| 39 | 54 | ||
| 40 | ## Finding users from their NIP-05 identifier | 55 | ## Finding users from their NIP-05 identifier |
| 41 | 56 | ||