Upgrade the admin DM from NIP-04 to NIP-17 (gift-wrapped) — analysis #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The daemon's one DM path — the boot-time "nsecBunker has started, use
<connection-string>…" notification to admin npubs (utils/dm-user.ts, called fromadmin/index.ts notifyAdminsOfNewConnection) — uses NIP-04 (kind:4 legacy encrypted DM). This issue weighs moving it to NIP-17 (kind:14 chat message, sealed via NIP-59 kind:13 + gift-wrapped in a kind:1059 event).Scope note: this is only about the admin DM. The NIP-46 RPC envelope (kind:24133/24134) also uses nip04/nip44 adaptively, but that's the NIP-46 protocol — dictated by the connecting clients (lnbits, the spire) — and is out of scope; we can't unilaterally switch it without breaking them.
Current vs proposed
["p", recipient]tag and a real timestamp. So the fact that the bunker DM'd this operator, when, and both pubkeys are public; only the content body is (weakly) encrypted.p-tag is visible (needed for delivery).Pros
~2.20.0) shipsnip17.wrapEvent(senderSecret, { publicKey, relays }, message)andnip59— the send side is a few lines via a throwawayRelayPool(same shape as the current port).Cons / risks
#p=self, unwrap the seal, render kind:14. If it only listens for kind:4, the NIP-17 message is invisible. Action: confirm what reads these admin DMs and whether it does NIP-17 before switching.Recommendation
Correct direction, low priority, gated on (1) — verify the admin client supports NIP-17. Given the only DM is the low-sensitivity boot notification, there's no urgency, but since NIP-04 is deprecated we shouldn't grow its use. Good candidate to fold into the CLI-port follow-up (the CLI is the likely reader of admin events). If recipient support is uncertain, keep NIP-04 for now rather than dual-send (messy) — revisit once the admin-client NIP-17 story is confirmed.
Refs: #44 (where the DM was ported off NDK to nostr-tools nip04), NIP-17, NIP-44, NIP-59.