-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NIP66 draft - Decimate #283
Open
hendore
wants to merge
1
commit into
nostr-protocol:master
Choose a base branch
from
hendore:nip-66
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
NIP-66 | ||
====== | ||
|
||
Decimate | ||
------------------- | ||
|
||
`draft` `optional` `author:hendore` | ||
|
||
A destructive event with kind `10`, the decimate event (from Latin decem, meaning "ten") will delete matching events stored on the receiving relay. | ||
|
||
The content is not used and SHOULD be an empty string. | ||
|
||
Relays SHOULD accept new events in the future from the same pubkey, this event only effects what is currently stored on the relay at the time it was published. | ||
|
||
Relays MAY delete the events from their database or soft delete but they SHOULD NOT emit those events in the future if soft deleted. | ||
|
||
## Matching | ||
|
||
Matches are based on event pubkey, relay tags and include/exclude tags. | ||
|
||
A list of `r` tags will be used to prevent accidental deletion from a preffered relay. Any relays receiving this event that are not defined in the list of `r` tags would ignore the event. | ||
|
||
Either an `include` or `exclude` tag must be provided but not both. The value of these tags contain a list of event kinds that should be taken into account when matching events to be removed. | ||
|
||
## Purpose | ||
|
||
The purpose of this NIP is to provide a way for users to retain control over the relays that store and share their events. Over time, it's likely users would find a few small sets of relays they prefer to publish to and would like to remove any/all events previously stored on relays used in the past. | ||
|
||
This NIP paves the way for more control over a users data with the possibility of event management clients appearing to migrate / cleanup old events when switching to new preferred relays. | ||
|
||
## Examples | ||
|
||
Given we publish the events below to the following relays | ||
|
||
- wss://example.relay.io | ||
- wss://another-example.relay.io | ||
- wss://some-new.relay.io | ||
- wss://another-new.relay.io | ||
- wss://one-more.relay.io | ||
|
||
***Deleting everything except profile and preferred relay metadata*** | ||
|
||
Any events stored on the two relays listed in the `r` tags would be deleted except for events with the kind 0 or 10002. The remaining 3 relays that received the event can safely ignore it. | ||
|
||
```json | ||
{ | ||
"pubkey": "...........", | ||
"kind": 10, | ||
"tags": [ | ||
["r", "wss://example.relay.io"], | ||
["r", "wss://another-example.relay.io"], | ||
["exclude", [0, 10002]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tag values can only be strings, and clients should republish signed versions of those events You may want to specify a filter instead too, serialized as JSON |
||
], | ||
"content": "", | ||
...other fields | ||
} | ||
``` | ||
|
||
|
||
***Deleting only notes from a single relay*** | ||
|
||
All of the users kind 1 events would be deleted on `wss://one-more.relay.io` the remaining 4 relays that received the event can safely ignore it. | ||
|
||
```json | ||
{ | ||
"pubkey": "...........", | ||
"kind": 10, | ||
"tags": [ | ||
["r", "wss://one-more.relay.io"], | ||
["include", [1]] | ||
], | ||
"content": "", | ||
...other fields | ||
} | ||
``` | ||
|
||
### Considerations | ||
|
||
Some thought may need to go into rouge clients, in it's current state a bad acting client may sign and publish a decimate event to many relays. [NIP26](26.md) if widely adopted could prevent this in the future if users only give clients enough power for what the client needs rather than their root keypair. |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about all events with a lower created_at timestamp than this event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Yes that works, although your previous comment about providing a filter may actually work to our advantage here, maybe I was drunk posting between 1am and 3am last night and would like to delete all my kind 1 events between that time frame.
That same filter can be used to remove all previous events still by just providing an
until
timestamp and leaving out afrom
timestamp.