upleb.uk

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

summaryrefslogtreecommitdiff
path: root/37.md
blob: ca0fdfb8a17934f361c3dd98e0545d2fc0bae1fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
NIP-37
======

Draft Wraps
-----------

`draft` `optional`

This NIP defines kind `31234` as an encrypted storage for unsigned draft events of any other kind. 

The draft is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content`.

`k` tags identify the kind of the draft. 

```js
{
  "kind": 31234,
  "tags": [
    ["d", "<identifier>"],
    ["k", "<kind of the draft event>"], // required
    ["expiration", "now + 90 days"] // recommended
  ],
  "content": nip44Encrypt(JSON.stringify(draft_event)),
  // other fields
}
```

A blanked `.content` field signals that the draft has been deleted. 

[NIP-40](40.md) `expiration` tags are recommended. 

Clients SHOULD publish kind `31234` events to relays listed on kind `10013` below.

## Relay List for Private Content

Kind `10013` indicates the user's preferred relays to store private events like Draft Wraps. 

The 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.

```js
{
  "kind": 10013,
  "tags": [],
  "content": nip44Encrypt(
    JSON.stringify(
      [
        ["relay", "wss://myrelay.mydomain.com"]
      ]
    )
  )
  //...other fields
}
```

It's recommended that Private Storage relays SHOULD be [NIP-42](42.md)-authed and only allow downloads of events signed by the authed user.

Clients MUST publish kind `10013` events to the author's [NIP-65](65.md) `write` relays.