2024-02-26 10:44:07 -05:00
|
|
|
|
|
|
|
NIP-37
|
|
|
|
======
|
|
|
|
|
|
|
|
Editable Short Notes
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
`draft` `optional`
|
|
|
|
|
2024-03-29 11:19:04 -04:00
|
|
|
This NIP allows `.content` edits of `kind:1` short notes with history of changes.
|
2024-02-26 10:44:07 -05:00
|
|
|
|
2024-03-29 11:19:04 -04:00
|
|
|
`kind:1010` stores the updated content with an `e` tag pointing back to the original `kind:1`.
|
2024-02-26 10:44:07 -05:00
|
|
|
|
|
|
|
```js
|
|
|
|
{
|
|
|
|
"kind": 1010,
|
|
|
|
"pubkey": "<32-bytes hex-encoded public key of the event creator>",
|
|
|
|
"tags": [
|
2024-03-29 11:19:04 -04:00
|
|
|
["e", "<kind_1_event_id>", "relay"]
|
2024-02-26 10:44:07 -05:00
|
|
|
],
|
2024-02-28 13:47:52 -05:00
|
|
|
"content": "this is a modified version of the original content",
|
2024-02-26 10:44:07 -05:00
|
|
|
// ...other fields
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-03-04 19:17:57 -05:00
|
|
|
Clients MUST check if the pubkey of the `kind:1010` is the same as the referenced `kind:1`.
|
2024-02-28 13:47:52 -05:00
|
|
|
|
2024-03-04 19:17:57 -05:00
|
|
|
Clients SHOULD render the `.content` of the most recent `kind:1010` by `created_at`.
|
2024-02-26 10:44:07 -05:00
|
|
|
|
2024-03-02 11:15:52 -05:00
|
|
|
Clients MAY present a history of changes over time.
|
|
|
|
|
|
|
|
# Collaboration
|
|
|
|
|
2024-03-29 11:19:04 -04:00
|
|
|
`kind:1010`s that are not signed by the author of the `e`-tagged event are considered proposals to edit.
|
|
|
|
|
|
|
|
A `p` tag notifies the author of a new edit proposal.
|
2024-03-02 11:15:52 -05:00
|
|
|
|
|
|
|
```js
|
|
|
|
{
|
|
|
|
"kind": 1010,
|
|
|
|
"pubkey": "<32-bytes hex-encoded public key of the event creator>",
|
|
|
|
"tags": [
|
|
|
|
["e", "<kind_1_event_id>"]
|
|
|
|
["p", "<kind_1_event_pubkey>"] // notifying the author
|
|
|
|
["summary", "<message to the author>"]
|
|
|
|
],
|
|
|
|
"content": "this is the proposed change from a third-party to the author",
|
|
|
|
// ...other fields
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-03-29 11:19:04 -04:00
|
|
|
To accept the proposal, the author MUST sign a new `kind:1010` event with a copy of the proposal's `.content`.
|