mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-22 00:25:50 -05:00
Merge pull request #1124 from vitorpamplona/draft-event
Generic Draft Event
This commit is contained in:
commit
8d14490692
50
37.md
Normal file
50
37.md
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
NIP-37
|
||||||
|
======
|
||||||
|
|
||||||
|
Draft Events
|
||||||
|
------------
|
||||||
|
|
||||||
|
`draft` `optional`
|
||||||
|
|
||||||
|
This NIP defines kind `31234` as a private wrap for drafts of any other event kind.
|
||||||
|
|
||||||
|
The draft event is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content` of the event.
|
||||||
|
|
||||||
|
An additional `k` tag identifies the kind of the draft event.
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
"kind": 31234,
|
||||||
|
"tags": [
|
||||||
|
["d", "<identifier>"],
|
||||||
|
["k", "<kind of the draft event>"],
|
||||||
|
["e", "<anchor event event id>", "<relay-url>"],
|
||||||
|
["a", "<anchor event address>", "<relay-url>"],
|
||||||
|
],
|
||||||
|
"content": nip44Encrypt(JSON.stringify(draft_event)),
|
||||||
|
// other fields
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
A blanked `.content` means this draft has been deleted by a client but relays still have the event.
|
||||||
|
|
||||||
|
Tags `e` and `a` identify one or more anchor events, such as parent events on replies.
|
||||||
|
|
||||||
|
## Relay List for Private Content
|
||||||
|
|
||||||
|
Kind `10013` indicates the user's preferred relays to store private events like Drafts. The event MUST include a list of `relay` URLs in private tags. Private tags are JSON Stringified, NIP-44-encrypted to the signer's keys and placed inside the .content of the event.
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
"kind": 10013,
|
||||||
|
"tags": [],
|
||||||
|
"content": nip44Encrypt(JSON.stringify([
|
||||||
|
["relay", "wss://myrelay.mydomain.com"]
|
||||||
|
]))
|
||||||
|
//...other fields
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Relays listed in this event SHOULD be authed and only allow downloads to events signed by the authed user.
|
||||||
|
|
||||||
|
Clients SHOULD publish kind `10013` events to the author's [NIP-65](65.md) `write` relays.
|
|
@ -54,6 +54,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||||
- [NIP-34: `git` stuff](34.md)
|
- [NIP-34: `git` stuff](34.md)
|
||||||
- [NIP-35: Torrents](35.md)
|
- [NIP-35: Torrents](35.md)
|
||||||
- [NIP-36: Sensitive Content](36.md)
|
- [NIP-36: Sensitive Content](36.md)
|
||||||
|
- [NIP-37: Draft Events](37.md)
|
||||||
- [NIP-38: User Statuses](38.md)
|
- [NIP-38: User Statuses](38.md)
|
||||||
- [NIP-39: External Identities in Profiles](39.md)
|
- [NIP-39: External Identities in Profiles](39.md)
|
||||||
- [NIP-40: Expiration Timestamp](40.md)
|
- [NIP-40: Expiration Timestamp](40.md)
|
||||||
|
@ -213,6 +214,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||||
| `30618` | Repository state announcements | [34](34.md) |
|
| `30618` | Repository state announcements | [34](34.md) |
|
||||||
| `30818` | Wiki article | [54](54.md) |
|
| `30818` | Wiki article | [54](54.md) |
|
||||||
| `30819` | Redirects | [54](54.md) |
|
| `30819` | Redirects | [54](54.md) |
|
||||||
|
| `31234` | Draft Event | [37](37.md) |
|
||||||
| `31388` | Link Set | [Corny Chat][cornychat-linkset] |
|
| `31388` | Link Set | [Corny Chat][cornychat-linkset] |
|
||||||
| `31890` | Feed | [NUD: Custom Feeds][NUD: Custom Feeds] |
|
| `31890` | Feed | [NUD: Custom Feeds][NUD: Custom Feeds] |
|
||||||
| `31922` | Date-Based Calendar Event | [52](52.md) |
|
| `31922` | Date-Based Calendar Event | [52](52.md) |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user