diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2024-12-08 10:01:28 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2024-12-08 10:01:28 -0300 |
| commit | 5d155b4ac854730a796a786ad19cbdcdb8e161a6 (patch) | |
| tree | 1155f768c578f7997c25544592eaf2bf1af5d8bf | |
| parent | d857cfb1b8409ca7f67c7525958a13ca6e780ed7 (diff) | |
REPLACE verb.replace
| -rw-r--r-- | 76.md | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -0,0 +1,19 @@ | |||
| 1 | NIP-76 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | `REPLACE` command for updating replaceables | ||
| 5 | ------------------------------------------- | ||
| 6 | |||
| 7 | `draft` `optional` | ||
| 8 | |||
| 9 | This NIP defines a new message, `REPLACE`, that clients can use to publish _replaceable_ and _addressable_ events to relays. | ||
| 10 | |||
| 11 | It works like `EVENT`, but together with the event JSON, the client also sends the id of the event they are replacing. | ||
| 12 | |||
| 13 | ```jsonc | ||
| 14 | ["REPLACE", "<id-of-event-being-replaced>", "<new-event>"] | ||
| 15 | ``` | ||
| 16 | |||
| 17 | Upon receiving this message, relays should check if the `<id-of-event-being-replaced>` corresponds to the latest event id they have stored locally that corresponds to the new replaceable event being received. | ||
| 18 | |||
| 19 | If it does correspond, it responds with an `OK` normally; otherwise it responds with something I'm not sure but that allows the client to fix its stuff. | ||