-
Notifications
You must be signed in to change notification settings - Fork 598
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
NIP-81 - Event Copy #528
Closed
Closed
NIP-81 - Event Copy #528
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,50 @@ | ||
NIP-81 | ||
====== | ||
|
||
Event Copy | ||
---------- | ||
|
||
`draft` `optional` `author:arthurfranca` | ||
|
||
An event of `kind 1006` is used to copy any event from another author (except other copies). A copy | ||
allows its creator to keep content around even when the original gets deleted. | ||
|
||
The `.content` of a copy event SHOULD be the stringified JSON of the whole original event, | ||
optionally with extra fields inside a `.meta` key. | ||
The `.content` MAY be empty to represent a deleted event. | ||
|
||
The copy event MUST include a `published_at` tag with the same value from the original event | ||
or with the original event's `created_at` value if its `published_at` tag is absent. | ||
|
||
The copy event SHOULD include the following tags so to make them queriable: | ||
|
||
- Capital `I` tag with original event's `id`; | ||
- Capital `P` tag with original event's `pubkey`; | ||
- Capital `K` tag with original event's `kind`; | ||
- All original event's single-letter tags. | ||
|
||
`I`, `P` and `K` tags are reserved. They cannot be used by any other event kind. | ||
|
||
## Use Cases | ||
|
||
It is useful for any case one would benefit for owning someone else's event. | ||
|
||
Clients can request both originals and copies to increase the chance of finding the events | ||
they are interested in. | ||
|
||
# Relay Event Re-publishing | ||
|
||
It enables storing someone else's events while consuming one own event quota, | ||
in case of relays that forbids different author event publishing. | ||
The user can later delete it to free some quota. | ||
|
||
# DM Inbox | ||
|
||
The benefit comes from being able to soft-delete a received DM (by using a copy with empty `.content`), | ||
making it possible to control one own inbox. Received DMs without copies may be considered unread. | ||
|
||
# Group Moderation | ||
|
||
A group admin may soft-delete events by using a copy with an empty content. | ||
It can use a copy's `.meta.moderation.content` to take out curse words from the original content. | ||
Clients should request group messages along with admin copies. |
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.
Why?
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.
Example: if I'm copying an event that already has one P tag that also is a pubkey value, although with a custom meaning specific to that event kind, i end up with:
Now if I were to request one of the copies I made, and wanted a copy that had originally the
pubkey
field value "pubkeyX", I do["REQ", "xyz", "{ \"kind\": 1006, \"#P\": [ \"pubkeyX\"], \"K\": .... }]
. This will wrongly bring me the above event.That's why ideally we consider I, P and K in events other than copies invalid. Don't copy these invalid events and you will not have to filter things out client-side.
For the same reason I didn't make it a parameterized replaceable event (the original could alread have a "d" tag and its worse cause maybe only the first d tag is indexed on some relay implementations, cause of what is written on NIP-33)
This is similar to the problem NIP-10 introduced. Can't request direct descendants of a specific root event without filtering out a bunch of events I don't want just because although the
e
tag means event id, it is used with different contexts ("root", "reply" and the legacy "mention").