feat(extensions): add NIP-05 identity extension #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/nip05"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
username@domain)/.well-known/nostr.jsonendpoint per the NIP-05 specificationRPC Methods
nip05.claimnip05.releasenip05.updateRelaysnip05.getMyIdentitynip05.lookupnip05.lookupByPubkeynip05.listIdentitiesnip05.deactivatenip05.reactivateHTTP Endpoints
NIP-05 Identity:
Returns:
Lightning Address (LUD-16):
Returns LNURL-pay info enabling
alice@domainto receive Lightning payments and NIP-57 zaps.How Zaps Work
alice@domainvia NIP-05 → gets pubkey/.well-known/lnurlp/alice→ extension looks up username, returns LNURL-pay infoValidation
Test plan
.well-known/nostr.jsonendpoint response format.well-known/lnurlp/:usernameendpoint for Lightning Address🤖 Generated with Claude Code
4fea2aa1b1to0d67c37fc60d67c37fc6tod7bb1d9bc5d7bb1d9bc5tob519c0e447NIP-05 Spec Compliance Review
Compared the implementation against the NIP-05 spec and NIP-57 (zaps). The extension is ~90% complete. Here's what needs attention:
Must Fix
1. Username validation rejects hyphens (spec violation)
The regex
/^[a-z][a-z0-9_]*$/disallows hyphens. NIP-05 spec explicitly states:Fix: update to
/^[a-z][a-z0-9_-]*$/innip05Manager.ts2. HTTP type definitions missing from
types.tsHttpRoute,HttpRequest,HttpResponseare imported inindex.tsbut not defined in the extension system'stypes.ts. This blocks TypeScript compilation. The withdraw extension likely has these defined in its copy — need to consolidate into the sharedtypes.tsfrom PR #3 (extension-loader).3.
getHttpRoutes()not in theExtensioninterfaceSame issue — the method exists in the implementation but the interface in
types.tsdoesn't declare it. Needs adding as an optional method in PR #3.Should Fix
4. No HTTP redirect prevention
NIP-05 spec: "The
/.well-known/nostr.jsonendpoint MUST NOT return any HTTP redirects." This is likely handled at the reverse proxy level, but should be documented as a deployment requirement.5. Verify zap configuration completeness
The
/.well-known/lnurlp/:usernameendpoint callsctx.getLnurlPayInfo()— need to verify the response includesallowsNostr: trueandnostrPubkeyfields per NIP-57. Without these, wallets won't send zap requests.Nice-to-Have (Not Blocking)
_@domainroot identifier support (optional per spec, low priority).(period) support in usernames (spec allows it but uncommon)Looks Good
/.well-known/nostr.jsonresponse format correctrelaysfield)Access-Control-Allow-Origin: *headerb519c0e447toa2366c40f2a2366c40f2to17727d3e3199d83efd56tobd0a657527bd0a657527tof59073e589View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.