upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/37.md
diff options
context:
space:
mode:
authorVitor Pamplona <vitor@vitorpamplona.com>2024-05-30 15:31:33 -0400
committerVitor Pamplona <vitor@vitorpamplona.com>2024-05-30 15:31:33 -0400
commit48674e563865b1cb7bb3c5c7869d20055446f408 (patch)
treeaed5946880f2bc1705fc6967eba2aa113cee9b99 /37.md
parent00b2e0a5cb819f9b2e8135f08d29ee94607d83b6 (diff)
moves from NIP-35 to NIP-37
Diffstat (limited to '37.md')
-rw-r--r--37.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/37.md b/37.md
new file mode 100644
index 0000000..1ade59d
--- /dev/null
+++ b/37.md
@@ -0,0 +1,50 @@
1NIP-37
2======
3
4Draft Events
5------------
6
7`draft` `optional`
8
9This NIP defines kind `31234` as a private wrap for drafts of any other event kind.
10
11The draft event is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content` of the event.
12
13An 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
29A blanked `.content` means this draft has been deleted by a client but relays still have the event.
30
31Tags `e` and `a` identify one or more anchor events, such as parent events on replies.
32
33## Relay List for Private Content
34
35Kind `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
48Relays listed in this event SHOULD be authed and only allow downloads to events signed by the authed user.
49
50Clients SHOULD publish kind `10013` events to the author's [NIP-65](65.md) `write` relays.