Merge 35f6a880f1547098aea3b41885274650c9ddc304 into 0619f370bca3485bb9c5870bc2defa03c7c3d10e

This commit is contained in:
fiatjaf_ 2025-03-19 12:23:44 +07:00 committed by GitHub
commit 907e338e7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

24
46.md
View File

@ -200,6 +200,30 @@ _client_ should display (in a popup or new tab) the URL from the `error` field a
![signing-example-with-auth-challenge](https://i.nostr.build/W3aj.png)
## Pure public key login
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:
1. Read _user-pubkey_ from the provided NIP-05, `nprofile` or `npub` code;
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);
3. Query these relay for a `kind:10046` event from _user_;
4. Read NIP-46 bunker connection metadata from that event -- then proceed as if the user had typed that bunker URI.
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).
### `kind:10046` event format:
```jsonc
{
"pubkey": "<user-pubkey>",
"kind": 10046,
"tags": [
["relays", "<remote-signer-relay-url>", "<any-number-of-other-relay-urls...>"],
["pubkey", "<remote-signer-pubkey>"]
]
}
```
## Appendix
### Announcing _remote-signer_ metadata