From 2f2dead4cc08671b761f5e40f9a38cc32bcb26c5 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 14 Mar 2024 08:38:37 -0400 Subject: [PATCH 1/7] Adds draft event. --- 35.md | 25 +++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 35.md diff --git a/35.md b/35.md new file mode 100644 index 00000000..ba2c7869 --- /dev/null +++ b/35.md @@ -0,0 +1,25 @@ +NIP-35 +====== + +Draft Events +------------ + +`draft` `optional` + +This NIP defines kind `31234` as a private draft event for any other event kind. + +The draft event is JSON-stringified, [NIP44-encrypted](44.md) to the owner'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", ""], + ], + "content": nip44Encrypt(JSON.stringify(draft_event)), + // other fields +} +``` \ No newline at end of file diff --git a/README.md b/README.md index 90a63949..dce4aaf2 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-31: Dealing with Unknown Events](31.md) - [NIP-32: Labeling](32.md) - [NIP-34: `git` stuff](34.md) +- [NIP-35: Draft Events](35.md) - [NIP-36: Sensitive Content](36.md) - [NIP-38: User Statuses](38.md) - [NIP-39: External Identities in Profiles](39.md) @@ -167,6 +168,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30402` | Classified Listing | [99](99.md) | | `30403` | Draft Classified Listing | [99](99.md) | | `30617` | Repository announcements | [34](34.md) | +| `31234` | Draft Event | [35](35.md) | | `31922` | Date-Based Calendar Event | [52](52.md) | | `31923` | Time-Based Calendar Event | [52](52.md) | | `31924` | Calendar | [52](52.md) | From f96ccc6e351be0b42d8b8395cc5b2de72f7f8e75 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 14 Mar 2024 08:52:58 -0400 Subject: [PATCH 2/7] Improved wording. --- 35.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/35.md b/35.md index ba2c7869..beff6754 100644 --- a/35.md +++ b/35.md @@ -6,9 +6,9 @@ Draft Events `draft` `optional` -This NIP defines kind `31234` as a private draft event for any other event kind. +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 owner's public key and placed inside the `.content` of the event. +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. From f7f060303d25f081b1250761aff7522560270ddb Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 14 Mar 2024 14:07:23 -0400 Subject: [PATCH 3/7] Adds anchor events. --- 35.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/35.md b/35.md index beff6754..476ae36d 100644 --- a/35.md +++ b/35.md @@ -18,8 +18,12 @@ An additional `k` tag identifies the kind of the draft event. "tags": [ ["d", ""], ["k", ""], + ["e", "", ""], + ["a", "", ""], ], "content": nip44Encrypt(JSON.stringify(draft_event)), // other fields } -``` \ No newline at end of file +``` + +Tags `e` and `a` identify one or more anchor events, such as parent events on replies. From 0ed2f63f223f03a171d1aa5c31dbec6bd68ffb6b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 29 Mar 2024 11:39:19 -0400 Subject: [PATCH 4/7] Getting drafts to be deleted even without relays supporting deletion events. --- 35.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/35.md b/35.md index 476ae36d..4bec44be 100644 --- a/35.md +++ b/35.md @@ -26,4 +26,6 @@ An additional `k` tag identifies the kind of the draft event. } ``` +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. From 00b2e0a5cb819f9b2e8135f08d29ee94607d83b6 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 30 May 2024 15:27:59 -0400 Subject: [PATCH 5/7] Adds private outbox relays. --- 35.md | 19 +++++++++++++++++++ README.md | 1 + 2 files changed, 20 insertions(+) diff --git a/35.md b/35.md index 4bec44be..45663dd8 100644 --- a/35.md +++ b/35.md @@ -29,3 +29,22 @@ An additional `k` tag identifies the kind of the draft event. 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. diff --git a/README.md b/README.md index dce4aaf2..6cd47788 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `10006` | Blocked relays list | [51](51.md) | | `10007` | Search relays list | [51](51.md) | | `10009` | User groups | [51](51.md), [29](29.md) | +| `10013` | Private Relays | [35](35.md) | `10015` | Interests list | [51](51.md) | | `10030` | User emoji list | [51](51.md) | | `10096` | File storage server list | [96](96.md) | From 48674e563865b1cb7bb3c5c7869d20055446f408 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 30 May 2024 15:31:33 -0400 Subject: [PATCH 6/7] moves from NIP-35 to NIP-37 --- 35.md => 37.md | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename 35.md => 37.md (99%) diff --git a/35.md b/37.md similarity index 99% rename from 35.md rename to 37.md index 45663dd8..1ade59d8 100644 --- a/35.md +++ b/37.md @@ -1,4 +1,4 @@ -NIP-35 +NIP-37 ====== Draft Events diff --git a/README.md b/README.md index 6cd47788..b4626aaf 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-31: Dealing with Unknown Events](31.md) - [NIP-32: Labeling](32.md) - [NIP-34: `git` stuff](34.md) -- [NIP-35: Draft Events](35.md) - [NIP-36: Sensitive Content](36.md) +- [NIP-37: Draft Events](37.md) - [NIP-38: User Statuses](38.md) - [NIP-39: External Identities in Profiles](39.md) - [NIP-40: Expiration Timestamp](40.md) @@ -136,7 +136,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `10006` | Blocked relays list | [51](51.md) | | `10007` | Search relays list | [51](51.md) | | `10009` | User groups | [51](51.md), [29](29.md) | -| `10013` | Private Relays | [35](35.md) +| `10013` | Private Relays | [35](37.md) | | `10015` | Interests list | [51](51.md) | | `10030` | User emoji list | [51](51.md) | | `10096` | File storage server list | [96](96.md) | @@ -169,7 +169,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30402` | Classified Listing | [99](99.md) | | `30403` | Draft Classified Listing | [99](99.md) | | `30617` | Repository announcements | [34](34.md) | -| `31234` | Draft Event | [35](35.md) | +| `31234` | Draft Event | [35](37.md) | | `31922` | Date-Based Calendar Event | [52](52.md) | | `31923` | Time-Based Calendar Event | [52](52.md) | | `31924` | Calendar | [52](52.md) | From 306be43fabf7a95b3eef9d5363e1c3411055337f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 19 Dec 2024 10:16:57 -0500 Subject: [PATCH 7/7] removes new line --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f203edd5..55de8422 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `39000-9` | Group metadata events | [29](29.md) | [NUD: Custom Feeds]: https://wikifreedia.xyz/cip-01/ - [nostrocket]: https://github.com/nostrocket/NIPS/blob/main/Problems.md [lnpub]: https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md [cornychat-slideset]: https://cornychat.com/datatypes#kind30388slideset