Skip to content

relay: fix NIP-57/NIP-65 registration pointing at the wrong package path - #38

Merged
naliyi merged 1 commit into
mainfrom
fix-relay-nip57-nip65-registration
Sep 4, 2026
Merged

relay: fix NIP-57/NIP-65 registration pointing at the wrong package path#38
naliyi merged 1 commit into
mainfrom
fix-relay-nip57-nip65-registration

Conversation

@naliyi

@naliyi naliyi commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Found while checking why the README's Supported NIPs table looked out of sync -- turned out to be a real, long-standing bug rather than a stale table.

  • cli/relay/command.go blank-imports github.com/ohstr/nmilat/nip57 and github.com/ohstr/nmilat/nip65 -- the base packages. Both packages' own doc comments say the blank-import needs to target their relayreg subpackage instead (nip57/relayreg, nip65/relayreg) -- that's where the init() declaring relay.RegisterNIP(N) and registering the zap/relay-list event validators actually lives. The base packages have no such init, so these blank imports have done nothing since this file's first commit.
  • Net effect: ncli relay has never advertised NIP-57 (Zaps) or NIP-65 (Relay List Metadata) in its NIP-11 supported_nips, and never validated zap-request/zap-receipt/relay-list event kinds, despite the README listing both as supported.
  • Verified against a live relay (curl -H "Accept: application/nostr+json" against a running ncli relay): supported_nips went from [1 9 11 16 33 40 77 98] to [1 9 11 16 33 40 57 65 77 98] after the fix.

Also checked NIP-13 (advertised via limitation.min_pow_difficulty, not supported_nips -- by design per nmilat's own CHANGELOG) and NIP-AA/NIP-OA (never registered in nmilat's relay engine at all, under any config) -- neither is an ncli-side bug; NIP-AA/OA looks like a gap in nmilat itself, worth raising separately rather than folding into this fix.

Test plan

  • go build ./..., go vet ./..., gofmt -l -- clean
  • go test -short -race ./cli/relay/... -- clean
  • Live-verified supported_nips before/after via a running relay + curl against its NIP-11 endpoint

Blank-imported nip57/nip65 (base packages) instead of nip57/relayreg and
nip65/relayreg -- the subpackages that actually run the init() declaring
RegisterNIP(57)/RegisterNIP(65) and registering zap/relay-list event
validators. The base packages have no such init, so the blank import did
nothing: ncli relay has never advertised either NIP in supported_nips
despite listing both as supported, since this file's very first commit.

Verified against a live relay: supported_nips went from
[1 9 11 16 33 40 77 98] to [1 9 11 16 33 40 57 65 77 98] after the fix.
@naliyi
naliyi marked this pull request as ready for review September 4, 2026 10:36
@naliyi
naliyi merged commit 2da6fa6 into main Sep 4, 2026
3 checks passed
naliyi added a commit that referenced this pull request Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant