diff options
| -rw-r--r-- | 46.md | 24 |
1 files changed, 24 insertions, 0 deletions
| @@ -191,6 +191,30 @@ _client_ should display (in a popup or new tab) the URL from the `error` field a | |||
| 191 | 191 | ||
| 192 |  | 192 |  |
| 193 | 193 | ||
| 194 | ## Pure public key login | ||
| 195 | |||
| 196 | A _client_ SHOULD support logins with just an `npub`, an `nprofile` or a NIP-05 address instead of requiring a full `bunker://...` URI. In order to do that, it can follow these steps: | ||
| 197 | |||
| 198 | 1. Read _user-pubkey_ from the provided NIP-05, `nprofile` or `npub` code; | ||
| 199 | 2. Acquire the list of outbox relays for _user_ (either by fetching the user's `kind:10002` relay list from relay hints or hardcoded relays or by other means); | ||
| 200 | 3. Query these relay for a `kind:10046` event from _user_; | ||
| 201 | 4. Read NIP-46 bunker connection metadata from that event -- then proceed as if the user had typed that bunker URI. | ||
| 202 | |||
| 203 | For this to work _user_ must have somehow published such `kind:10046` event beforehand (which might be a job for the bunker provider or app directly or not). | ||
| 204 | |||
| 205 | ### `kind:10046` event format: | ||
| 206 | |||
| 207 | ```jsonc | ||
| 208 | { | ||
| 209 | "pubkey": "<user-pubkey>", | ||
| 210 | "kind": 10046, | ||
| 211 | "tags": [ | ||
| 212 | ["relays", "<remote-signer-relay-url>", "<any-number-of-other-relay-urls...>"], | ||
| 213 | ["pubkey", "<remote-signer-pubkey>"] | ||
| 214 | ] | ||
| 215 | } | ||
| 216 | ``` | ||
| 217 | |||
| 194 | ## Appendix | 218 | ## Appendix |
| 195 | 219 | ||
| 196 | ### Announcing _remote-signer_ metadata | 220 | ### Announcing _remote-signer_ metadata |