diff options
| -rw-r--r-- | 37.md | 50 | ||||
| -rw-r--r-- | README.md | 3 |
2 files changed, 53 insertions, 0 deletions
| @@ -0,0 +1,50 @@ | |||
| 1 | NIP-37 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Draft Events | ||
| 5 | ------------ | ||
| 6 | |||
| 7 | `draft` `optional` | ||
| 8 | |||
| 9 | This NIP defines kind `31234` as a private wrap for drafts of any other event kind. | ||
| 10 | |||
| 11 | The draft event is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content` of the event. | ||
| 12 | |||
| 13 | An additional `k` tag identifies the kind of the draft event. | ||
| 14 | |||
| 15 | ```js | ||
| 16 | { | ||
| 17 | "kind": 31234, | ||
| 18 | "tags": [ | ||
| 19 | ["d", "<identifier>"], | ||
| 20 | ["k", "<kind of the draft event>"], | ||
| 21 | ["e", "<anchor event event id>", "<relay-url>"], | ||
| 22 | ["a", "<anchor event address>", "<relay-url>"], | ||
| 23 | ], | ||
| 24 | "content": nip44Encrypt(JSON.stringify(draft_event)), | ||
| 25 | // other fields | ||
| 26 | } | ||
| 27 | ``` | ||
| 28 | |||
| 29 | A blanked `.content` means this draft has been deleted by a client but relays still have the event. | ||
| 30 | |||
| 31 | Tags `e` and `a` identify one or more anchor events, such as parent events on replies. | ||
| 32 | |||
| 33 | ## Relay List for Private Content | ||
| 34 | |||
| 35 | 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. | ||
| 36 | |||
| 37 | ```js | ||
| 38 | { | ||
| 39 | "kind": 10013, | ||
| 40 | "tags": [], | ||
| 41 | "content": nip44Encrypt(JSON.stringify([ | ||
| 42 | ["relay", "wss://myrelay.mydomain.com"] | ||
| 43 | ])) | ||
| 44 | //...other fields | ||
| 45 | } | ||
| 46 | ``` | ||
| 47 | |||
| 48 | Relays listed in this event SHOULD be authed and only allow downloads to events signed by the authed user. | ||
| 49 | |||
| 50 | Clients SHOULD publish kind `10013` events to the author's [NIP-65](65.md) `write` relays. | ||
| @@ -53,6 +53,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 53 | - [NIP-34: `git` stuff](34.md) | 53 | - [NIP-34: `git` stuff](34.md) |
| 54 | - [NIP-35: Torrents](35.md) | 54 | - [NIP-35: Torrents](35.md) |
| 55 | - [NIP-36: Sensitive Content](36.md) | 55 | - [NIP-36: Sensitive Content](36.md) |
| 56 | - [NIP-37: Draft Events](37.md) | ||
| 56 | - [NIP-38: User Statuses](38.md) | 57 | - [NIP-38: User Statuses](38.md) |
| 57 | - [NIP-39: External Identities in Profiles](39.md) | 58 | - [NIP-39: External Identities in Profiles](39.md) |
| 58 | - [NIP-40: Expiration Timestamp](40.md) | 59 | - [NIP-40: Expiration Timestamp](40.md) |
| @@ -145,6 +146,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 145 | | `10006` | Blocked relays list | [51](51.md) | | 146 | | `10006` | Blocked relays list | [51](51.md) | |
| 146 | | `10007` | Search relays list | [51](51.md) | | 147 | | `10007` | Search relays list | [51](51.md) | |
| 147 | | `10009` | User groups | [51](51.md), [29](29.md) | | 148 | | `10009` | User groups | [51](51.md), [29](29.md) | |
| 149 | | `10013` | Private Relays | [35](37.md) | | ||
| 148 | | `10015` | Interests list | [51](51.md) | | 150 | | `10015` | Interests list | [51](51.md) | |
| 149 | | `10030` | User emoji list | [51](51.md) | | 151 | | `10030` | User emoji list | [51](51.md) | |
| 150 | | `10050` | Relay list to receive DMs | [17](17.md) | | 152 | | `10050` | Relay list to receive DMs | [17](17.md) | |
| @@ -182,6 +184,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 182 | | `30818` | Wiki article | [54](54.md) | | 184 | | `30818` | Wiki article | [54](54.md) | |
| 183 | | `30819` | Redirects | [54](54.md) | | 185 | | `30819` | Redirects | [54](54.md) | |
| 184 | | `31890` | Feed | [NUD: Custom Feeds](https://wikifreedia.xyz/cip-01/97c70a44366a6535c1) | | 186 | | `31890` | Feed | [NUD: Custom Feeds](https://wikifreedia.xyz/cip-01/97c70a44366a6535c1) | |
| 187 | | `31234` | Draft Event | [37](37.md) | | ||
| 185 | | `31922` | Date-Based Calendar Event | [52](52.md) | | 188 | | `31922` | Date-Based Calendar Event | [52](52.md) | |
| 186 | | `31923` | Time-Based Calendar Event | [52](52.md) | | 189 | | `31923` | Time-Based Calendar Event | [52](52.md) | |
| 187 | | `31924` | Calendar | [52](52.md) | | 190 | | `31924` | Calendar | [52](52.md) | |