feat(nostr): switch to gift-wrapped events#6677
feat(nostr): switch to gift-wrapped events#6677CommanderStorm merged 4 commits intolouislam:masterfrom
Conversation
The old implementation used the old nip04 format for private DMs This changes it to use NIP17 which uses gift-wrapped events to hide metadata, specifically who is writing to whom. This prevents leaking metadata about the uptime kuma instance to the public via the nostr relays.
|
Hello! Thank you for your contribution 👋 As this is your first contribution, please be sure to check out our In particular:
If you have any design or process questions, feel free to ask them right here in this pull request - unclear documentation is a bug too. Thanks for lending a paw to Uptime Kuma 🐻 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Nostr notification provider to use NIP-17 gift-wrapped events (via NIP-59) instead of the deprecated NIP-04 format for private direct messages. This change enhances privacy by hiding metadata about sender/recipient relationships from public relays.
Changes:
- Switched from NIP-04 encrypted direct messages to NIP-17 private direct messages with NIP-59 gift wrapping
- Simplified Node.js version-specific polyfill code to only handle WebSocket
- Updated nostr-tools dependency from v2.10.4 to v2.17.0
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server/notification-providers/nostr.js | Replaced NIP-04 encryption with NIP-59 gift-wrapped events and removed version-specific crypto polyfills |
| package.json | Updated nostr-tools dependency to v2.17.0 to support NIP-59 functionality |
CommanderStorm
left a comment
There was a problem hiding this comment.
I don't know what this code is doing precisely, but I trust You to know what you are doing there.
Could you share a screenshot of this working?
|
FYI: if you want to use this, it is in our next nightly release. |




Summary
The old implementation used the old soft-deprecated NIP-04 format for private DMs.
This PR changes it to use NIP-17 which uses gift-wrapped events to hide metadata, specifically who is writing to whom. This prevents leaking metadata about the uptime kuma instance to the public via the nostr relays.
Please follow this checklist to avoid unnecessary back and forth (click to expand)
I understand that I am responsible for and able to explain every line of code I submit.