[Bug] Mentions should use NIP-27
Currently mentions are not interoperable with other Nostr clients. It's fine to type @username in the text box, but after hitting submit the event it generates should include a NIP-27 Nostr URI.
It's not just a compatibility issue. People on Nostr can change their username. This would break existing mentions. Plus there's not really any concept of a "username". The name can contain spaces. The correct solution is NIP-27.
Fixed in https://github.com/block/buzz/pull/2503 — composer keeps @name; wire events get nostr:npub1….
There's a focused alternative open for this issue: https://github.com/block/buzz/pull/4398
#2503 does implement outbound @name → nostr:npub1… rewrite and a basic display map-back, but I think #4398 is the stronger candidate to merge for #2319 specifically:
-
Scoped to the issue. #2503 bundles NIP-27 with unrelated community-create handoff and workflow
#hfilter changes. That makes review, bisect, and rollback harder, and keeps the mention fix gated on unrelated work. #4398 only changes the mention encode/display path. -
Inbound
nprofile+ body-only hydration. #2503's display path mainly maps knownnostr:npub1…URIs back through already-available tag-derived name maps. #4398 also:- decodes
nostr:nprofile1…(relay-hinted profile refs) - extracts profile pubkeys from prose even when no
p/mentiontag is present - batch-hydrates those profiles and renders the same mention chips with current display names
That matches the issue's interoperability goal: foreign clients often ship NIP-27 body refs without Buzz's local tag conventions.
- decodes
-
Stronger prose safety. #4398 protects code spans/blocks, Markdown link destinations, email-like tokens, escaped
\@, existingnostr:URIs, and non-profile NIP-21 entities; applies longest-name-wins on overlap; and is idempotent under re-encode. #2503 leans mainly on existing code masking viagetMentionOffset. -
Current
main. #4398 is rebased on latestmainwith a single signed/DCO commit. #2503 still mixes three concerns and is currently merge-blocked.
Happy to adjust #4398 if maintainers prefer splitting further or aligning naming with the helpers in #2503 — but for closing #2319 cleanly, the focused full encode+display path in #4398 looks like the better merge target.