diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2024-05-27 10:41:14 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2024-05-27 10:41:14 -0300 |
| commit | 0535f01508ef04534a088b1c3ccc3bbf28c68107 (patch) | |
| tree | afcc779e5e22577638df9866bfa7f570903bd430 | |
| parent | 85df9b0e89e23ed7c0dee73c29004f23b25020df (diff) | |
deleting-replaceablesdeleting-replaceable
| -rw-r--r-- | 09.md | 15 |
1 files changed, 10 insertions, 5 deletions
| @@ -14,14 +14,13 @@ The event's `content` field MAY contain a text note describing the reason for th | |||
| 14 | 14 | ||
| 15 | For example: | 15 | For example: |
| 16 | 16 | ||
| 17 | ``` | 17 | ```jsonc |
| 18 | { | 18 | { |
| 19 | "kind": 5, | 19 | "kind": 5, |
| 20 | "pubkey": <32-bytes hex-encoded public key of the event creator>, | 20 | "pubkey": <32-bytes hex-encoded public key of the event creator>, |
| 21 | "tags": [ | 21 | "tags": [ |
| 22 | ["e", "dcd59..464a2"], | 22 | ["e", "dcd59..464a2"], |
| 23 | ["e", "968c5..ad7a4"], | 23 | ["e", "968c5..ad7a4"], |
| 24 | ["a", "<kind>:<pubkey>:<d-identifier>"] | ||
| 25 | ], | 24 | ], |
| 26 | "content": "these posts were published by accident", | 25 | "content": "these posts were published by accident", |
| 27 | ...other fields | 26 | ...other fields |
| @@ -34,9 +33,9 @@ Relays SHOULD continue to publish/share the deletion events indefinitely, as cli | |||
| 34 | 33 | ||
| 35 | ## Client Usage | 34 | ## Client Usage |
| 36 | 35 | ||
| 37 | Clients MAY choose to fully hide any events that are referenced by valid deletion events. This includes text notes, direct messages, or other yet-to-be defined event kinds. Alternatively, they MAY show the event along with an icon or other indication that the author has "disowned" the event. The `content` field MAY also be used to replace the deleted events' own content, although a user interface should clearly indicate that this is a deletion reason, not the original content. | 36 | Clients MAY choose to fully hide any events that are referenced by valid deletion events. This includes text notes, direct messages, or other yet-to-be defined event kinds. Alternatively, they MAY show the event along with an icon or other indication that the author has "disowned" the event. The `content` field MAY also be used to replace the deleted events' own content, although a user interface should clearly indicate that this is a deletion reason, not the original content. |
| 38 | 37 | ||
| 39 | A client MUST validate that each event `pubkey` referenced in the `e` tag of the deletion request is identical to the deletion request `pubkey`, before hiding or deleting any event. Relays can not, in general, perform this validation and should not be treated as authoritative. | 38 | A client MUST validate that each event `pubkey` referenced in the `e` tag of the deletion request is identical to the deletion request `pubkey`, before hiding or deleting any event. Relays can not, in general, perform this validation and should not be treated as authoritative. |
| 40 | 39 | ||
| 41 | Clients display the deletion event itself in any way they choose, e.g., not at all, or with a prominent notice. | 40 | Clients display the deletion event itself in any way they choose, e.g., not at all, or with a prominent notice. |
| 42 | 41 | ||
| @@ -46,4 +45,10 @@ Relays MAY validate that a deletion event only references events that have the s | |||
| 46 | 45 | ||
| 47 | ## Deleting a Deletion | 46 | ## Deleting a Deletion |
| 48 | 47 | ||
| 49 | Publishing a deletion event against a deletion has no effect. Clients and relays are not obliged to support "undelete" functionality. | 48 | Publishing a deletion event against a deletion has no effect. Clients and relays are not obliged to support "undelete" functionality. |
| 49 | |||
| 50 | ## Deleting Replaceable Events | ||
| 51 | |||
| 52 | Because of their changing nature it's hard to get rid of all instance of a replaceable event (ranges `10000...19999` and `30000...39999`). We also don't want to publish a `kind:5` targeting an `a` reference and thus permanently delete any future events that could possibly have the same specifieds `kind` and `d`-tag forever. | ||
| 53 | |||
| 54 | So instead to delete a replaceable event we **overwrite** it with an event with the same `kind` and `d`-tag, plus a tag `["deleted"]` specifying no other tags. | ||