Make relay attribute recommended in NIP-05

This commit is contained in:
utxo 2024-03-21 10:15:02 -04:00
parent de71f99828
commit 46a6bf331a

19
05.md
View File

@ -1,8 +1,6 @@
NIP-05
======
# NIP-05
Mapping Nostr keys to DNS-based internet identifiers
----------------------------------------------------
## Mapping Nostr keys to DNS-based internet identifiers
`final` `optional`
@ -33,9 +31,9 @@ It will make a GET request to `https://example.com/.well-known/nostr.json?name=b
"bob": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9"
}
}
````
```
or with the **optional** `"relays"` attribute:
or with the **recommended** `"relays"` attribute:
```json
{
@ -43,14 +41,17 @@ or with the **optional** `"relays"` attribute:
"bob": "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9"
},
"relays": {
"b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9": [ "wss://relay.example.com", "wss://relay2.example.com" ]
"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.
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 the specific 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.
The recommended `"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 the specific 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.
## Finding users from their NIP-05 identifier