clone

every nostr nip as a chapter of an illustrated, early-2000s printed game manual

main
nip.guide / source-nips / 37.md
37.md 1.8K rendered
1NIP-372======34Draft Wraps5-----------67`draft` `optional`89This NIP defines kind `31234` as an encrypted storage for unsigned draft events of any other kind. 1011The draft is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content`.1213`k` tags identify the kind of the draft. 1415```js16{17 "kind": 31234,18 "tags": [19 ["d", "<identifier>"],20 ["k", "<kind of the draft event>"], // required21 ["expiration", "now + 90 days"] // recommended22 ],23 "content": nip44Encrypt(JSON.stringify(draft_event)),24 // other fields25}26```2728A blanked `.content` field signals that the draft has been deleted. 2930[NIP-40](40.md) `expiration` tags are recommended. 3132Clients SHOULD publish kind `31234` events to relays listed on kind `10013` below.3334## Checkpoints35`kind:1234` defines checkpoints that belong to a parent `kind:31234` event. These can serve to provide a revision history of a parent event.3637```js38{39 "kind": 1234,40 "tags": [41 ["a", "31234:<pubkey>:<identifier>"]42 ],43 "content": nip44Encrypt(JSON.stringify(draft_event)),44}45```4647## Relay List for Private Content4849Kind `10013` indicates the user's preferred relays to store private events like Draft Wraps. 5051The event MUST include a list of `relay` URLs in private tags. Private tags are JSON Stringified, [NIP44-encrypted](44.md) to the signer's keys and placed inside the .content of the event.5253```js54{55 "kind": 10013,56 "tags": [],57 "content": nip44Encrypt(58 JSON.stringify(59 [60 ["relay", "wss://myrelay.mydomain.com"]61 ]62 )63 )64 //...other fields65}66```6768It's recommended that Private Storage relays SHOULD be [NIP-42](42.md)-authed and only allow downloads of events signed by the authed user.6970Clients MUST publish kind `10013` events to the author's [NIP-65](65.md) `write` relays.