Skip to content

[BUG] NIP-13 (Proof of Work) is implemented and documented but missing from supportedNips / NIP-11 supported_nips #679

Description

@Priyanshubhartistm

Describe the bug

The relay implements NIP-13 (Proof of Work) canAcceptEvent() in src/handlers/event-message-handler.ts enforces both limits.event.eventId.minLeadingZeroBits an limits.event.pubkey.minLeadingZeroBits - and the README explicitly lists it as supported:

- [x] NIP-13: Proof of Work

However, package.json does not include 13 in the supportedNips array:

"supportedNips": [ 1, 2, 4, 9, 11, 12, 15, 16, 20, 22, 28, 33, 40 ],

This array is what gets advertised to clients via the NIP-11 relay information document (supported_nips in src/handlers/request-handlers/root-request-handler.ts) and printed on startup in src/app/app.ts. As a result, clients that inspect the relay document have no way to know PoW limits may be enforced, even though they are.

To Reproduce

  1. curl -H "Accept: application/nostr+json" http://localhost:8008/
  2. Observe supported_nips does not contain 13, despite min_pow_difficulty
    being present in the same document.

Expected behavior

13 should be present in supportedNips so the relay honestly advertises PoW support.

Fix

"supportedNips": [ 1, 2, 4, 9, 11, 12, 13, 15, 16, 20, 22, 28, 33, 40 ],

System: Linux, Docker


Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions