NIP-09-PR: allow gift wrap recipients to request deletion of their own copy#2350
Open
geralt-debugs wants to merge 2 commits into
Open
NIP-09-PR: allow gift wrap recipients to request deletion of their own copy#2350geralt-debugs wants to merge 2 commits into
geralt-debugs wants to merge 2 commits into
Conversation
abh3po
reviewed
May 31, 2026
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.
NIP-09 currently requires that the pubkey of a kind:5 deletion request match the pubkey of the event being deleted. This works for events a user creates, but not for gift wraps (kind:1059), which are authored by an ephemeral random key even though they are addressed to a specific recipient via a p tag.
This PR extends NIP-09 to allow a gift wrap recipient to request deletion of their own copy. The rule is narrow and explicit: a kind:5 event may reference a kind:1059 event when the requester's pubkey appears in a p tag of that gift wrap and the k tag is "1059". In all other cases the existing NIP-09 author-matching rule is unchanged.
Since each NIP-17 recipient receives a separately-wrapped copy of a message, deleting one user's gift wrap has no effect on copies addressed to others. No new event kind is introduced.
Use cases