feat(extensions): add NIP-05 identity extension #4

Open
padreug wants to merge 5 commits from feature/nip05 into dev
Showing only changes of commit 915ca667e5 - Show all commits

View file

@ -189,6 +189,12 @@ export default class Nip05Extension implements Extension {
* "relays": { "<pubkey hex>": ["wss://..."] }
* }
*/
/**
* NIP-05 spec: "The /.well-known/nostr.json endpoint MUST NOT return any
* HTTP redirects." This extension always returns direct 200/4xx/5xx responses.
* Deployment note: ensure reverse proxies do not add 3xx redirects on this path
* (e.g. HTTPHTTPS or trailing-slash redirects).
*/
private async handleNostrJson(req: HttpRequest): Promise<HttpResponse> {
try {
// Get application ID from request context
@ -272,6 +278,11 @@ export default class Nip05Extension implements Extension {
description: `Pay to ${username}`
})
// NIP-57: ensure zap support fields are present for wallet compatibility
if (!lnurlPayInfo.allowsNostr || !lnurlPayInfo.nostrPubkey) {
this.ctx.log('warn', `LNURL-pay response for ${username} missing zap fields (allowsNostr=${lnurlPayInfo.allowsNostr}, nostrPubkey=${!!lnurlPayInfo.nostrPubkey}). Zaps will not work.`)
}
return {
status: 200,
body: lnurlPayInfo,