From 48674e563865b1cb7bb3c5c7869d20055446f408 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 30 May 2024 15:31:33 -0400 Subject: moves from NIP-35 to NIP-37 --- 37.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 37.md (limited to '37.md') diff --git a/37.md b/37.md new file mode 100644 index 0000000..1ade59d --- /dev/null +++ b/37.md @@ -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", ""], + ["k", ""], + ["e", "", ""], + ["a", "", ""], + ], + "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. -- cgit v1.2.3