relay: fix NIP-57/NIP-65 registration pointing at the wrong package path - #38
Merged
Conversation
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.
4 tasks
naliyi
marked this pull request as ready for review
September 4, 2026 10:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.goblank-importsgithub.com/ohstr/nmilat/nip57andgithub.com/ohstr/nmilat/nip65-- the base packages. Both packages' own doc comments say the blank-import needs to target theirrelayregsubpackage instead (nip57/relayreg,nip65/relayreg) -- that's where theinit()declaringrelay.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.ncli relayhas never advertised NIP-57 (Zaps) or NIP-65 (Relay List Metadata) in its NIP-11supported_nips, and never validated zap-request/zap-receipt/relay-list event kinds, despite the README listing both as supported.curl -H "Accept: application/nostr+json"against a runningncli relay):supported_nipswent 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, notsupported_nips-- by design per nmilat's own CHANGELOG) and NIP-AA/NIP-OA (never registered innmilat's relay engine at all, under any config) -- neither is anncli-side bug; NIP-AA/OA looks like a gap innmilatitself, worth raising separately rather than folding into this fix.Test plan
go build ./...,go vet ./...,gofmt -l-- cleango test -short -race ./cli/relay/...-- cleansupported_nipsbefore/after via a running relay + curl against its NIP-11 endpoint