From 29cbfbf504041b2a3ff553a024a390510535b8dc Mon Sep 17 00:00:00 2001 From: Kay Date: Thu, 2 Jan 2025 11:13:28 +0000 Subject: [PATCH 01/11] bud-07: media report. --- buds/01.md | 2 +- buds/07.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 buds/07.md diff --git a/buds/01.md b/buds/01.md index 41466bb..13b2bd3 100644 --- a/buds/01.md +++ b/buds/01.md @@ -26,7 +26,7 @@ Authorization events are used to identify the users to the server Authorization events must be generic and must NOT be scoped to specific servers. This allows pubkeys to sign a single event and interact the same way with multiple servers. -Events MUST be kind `24242` and have a `t` tag with a verb of `get`, `upload`, `list`, or `delete` +Events MUST be kind `24242` and have a `t` tag with a verb of `get`, `upload`, `list`, `report`, or `delete` Events MUST have the `content` set to a human readable string explaining to the user what the events inteded use is. For example `Upload Blob`, `Delete dog-picture.png`, `List Images`, etc diff --git a/buds/07.md b/buds/07.md new file mode 100644 index 0000000..8c2098b --- /dev/null +++ b/buds/07.md @@ -0,0 +1,43 @@ +# BUD-07 + +## Media Report + +`draft` `optional` + +This bud defines a new endpoint for clients and users to report medias to servers. + + +### PUT /report/ - reporting a media + +Client MUST provide a report json according to the [NIP-56](https://github.com/nostr-protocol/nips/blob/master/56.md) in the request body. + +Example: + +```json +{ + "kind": 1984, + "tags": [ + ["x", "", ""], + ], + "content": "", + // other fields... +} +``` + +A report request may contain multiple `x` tags or contain some `p` or `e` tags which is not related to blossom server but is SHOULD be considered as a valid request. + +Server MUST response to report request with a successful code or a code in 4xx/5xx range if there was any error. + + +> Note: servers may requests for authorization with `t` tag of `report` as per [BUD-01](./01.md). + +### Client behavior + +The clients can show a media report button on posts or in media details. Or they merge this with normal nostr report and send it to both relays and blossom server. other clients can receive it from relays and hide or blur reported medias from trusted friends. + +### Server behavior + +The servers MAY keep the reports somewhere for operators to check and take action on them. they MAY use a list of trusted people or moderators to directly take action on media without operator request. + +Servers MAY consider removed medias sha256 as blocked in order to prevent rewrite. +Servers MAY advertise a route or landing page to provide their rules and term of service which affects the report process. From 7a9111f54d6bda0c0bb451ccbafa3ebd90077603 Mon Sep 17 00:00:00 2001 From: Kay Date: Thu, 2 Jan 2025 11:17:48 +0000 Subject: [PATCH 02/11] small fixes. --- README.md | 11 +++++++++++ buds/07.md | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f55862e..0d60b61 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,32 @@ Blobs are packs of binary data addressed by their sha256 hash Blossom Servers expose a few endpoints for managing blobs - `GET /` (optional file `.ext`) [BUD-01](./buds/01.md#get-sha256---get-blob) + - `HEAD /` (optional file `.ext`) [BUD-01](./buds/01.md#head-sha256---has-blob) + - `PUT /upload` [BUD-02](./buds/02.md#put-upload---upload-blob) - `Authentication`: Signed [nostr event](./buds/02.md#upload-authorization-required) - Return a blob descriptor + - `HEAD /upload` [BUD-06](./buds/06.md#head-upload---upload-requirements) + - `GET /list/` [BUD-02](./buds/02.md#get-listpubkey---list-blobs) - Returns an array of blob descriptors - `Authentication` _(optional)_: Signed [nostr event](./buds/02.md#list-authorization-optional) + - `DELETE /` [BUD-02](./buds/02.md#delete-sha256---delete-blob) - `Authentication`: Signed [nostr event](./buds/02.md#delete-authorization-required) + - `PUT /mirror` [BUD-04](./buds/04.md#put-mirror---mirror-blob) - `Authentication`: Signed [nostr event](./buds/02.md#upload-authorization-required) + - `HEAD /media` [BUD-05](./buds/05.md#head-media) + - `PUT /media` [BUD-05](./buds/05.md#put-media) - `Authentication`: Signed [nostr event](./buds/05.md#upload-authorization) +- `PUT /report/` [BUD-07](./buds/07.md) + ## Protocol specification (BUDs) BUDs stand for **Blossom Upgrade Documents**. @@ -45,6 +55,7 @@ See the [BUDs](./buds) folder and specifically [BUD-01](./buds/01.md) and [BUD-0 - [BUD-04: Mirroring blobs](./buds/04.md) - [BUD-05: Media optimization](./buds/05.md) - [BUD-06: Upload requirements](./buds/06.md) +- [BUD-07: Blob Report](./buds/07.md) - [BUD-08: Nostr File Metadata Tags](./buds/08.md) ## Event kinds diff --git a/buds/07.md b/buds/07.md index 8c2098b..29fb2d7 100644 --- a/buds/07.md +++ b/buds/07.md @@ -1,10 +1,10 @@ # BUD-07 -## Media Report +## Blob Report `draft` `optional` -This bud defines a new endpoint for clients and users to report medias to servers. +This bud defines a new endpoint for clients and users to report blobs to servers. ### PUT /report/ - reporting a media @@ -17,7 +17,7 @@ Example: { "kind": 1984, "tags": [ - ["x", "", ""], + ["x", "", ""], ], "content": "", // other fields... @@ -33,11 +33,11 @@ Server MUST response to report request with a successful code or a code in 4xx/5 ### Client behavior -The clients can show a media report button on posts or in media details. Or they merge this with normal nostr report and send it to both relays and blossom server. other clients can receive it from relays and hide or blur reported medias from trusted friends. +The clients can show a blob report button on posts or in blob details. Or its RECOMMENDED to merge this with normal nostr report and send it to both relays and blossom server. other clients can receive it from relays and hide or blur reported blob from trusted friends. ### Server behavior -The servers MAY keep the reports somewhere for operators to check and take action on them. they MAY use a list of trusted people or moderators to directly take action on media without operator request. +The servers MAY keep the reports somewhere for operators to check and take action on them. they MAY use a list of trusted people or moderators to directly take action on blob without operator request. -Servers MAY consider removed medias sha256 as blocked in order to prevent rewrite. +Servers MAY consider removed blobs sha256 as blocked in order to prevent rewrite. Servers MAY advertise a route or landing page to provide their rules and term of service which affects the report process. From e5462c3e1a6ffc9a55ac1b995e0d73c5111b0079 Mon Sep 17 00:00:00 2001 From: Kay Date: Thu, 2 Jan 2025 11:18:02 +0000 Subject: [PATCH 03/11] small fixes. --- buds/07.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buds/07.md b/buds/07.md index 29fb2d7..9b0a332 100644 --- a/buds/07.md +++ b/buds/07.md @@ -13,7 +13,7 @@ Client MUST provide a report json according to the [NIP-56](https://github.com/n Example: -```json +```jsonc { "kind": 1984, "tags": [ From fa676debf3ca48c41cdfdb85675344abc3d65a76 Mon Sep 17 00:00:00 2001 From: Kay Date: Fri, 3 Jan 2025 12:51:09 +0000 Subject: [PATCH 04/11] fix requests. --- README.md | 2 +- buds/{07.md => 09.md} | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) rename buds/{07.md => 09.md} (71%) diff --git a/README.md b/README.md index 0d60b61..6ec425b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Blossom Servers expose a few endpoints for managing blobs - `PUT /media` [BUD-05](./buds/05.md#put-media) - `Authentication`: Signed [nostr event](./buds/05.md#upload-authorization) -- `PUT /report/` [BUD-07](./buds/07.md) +- `PUT /report` [BUD-09](./buds/09.md) ## Protocol specification (BUDs) diff --git a/buds/07.md b/buds/09.md similarity index 71% rename from buds/07.md rename to buds/09.md index 9b0a332..a86bb5e 100644 --- a/buds/07.md +++ b/buds/09.md @@ -1,4 +1,4 @@ -# BUD-07 +# BUD-09 ## Blob Report @@ -7,9 +7,9 @@ This bud defines a new endpoint for clients and users to report blobs to servers. -### PUT /report/ - reporting a media +### PUT /report - reporting a media -Client MUST provide a report json according to the [NIP-56](https://github.com/nostr-protocol/nips/blob/master/56.md) in the request body. +The requests body MUST be a signed [NIP-56](https://github.com/nostr-protocol/nips/blob/master/56.md) report event with `x` tags containing that hashes of the blobs being reported. Example: @@ -19,7 +19,7 @@ Example: "tags": [ ["x", "", ""], ], - "content": "", + "content": "", // other fields... } ``` @@ -28,9 +28,6 @@ A report request may contain multiple `x` tags or contain some `p` or `e` tags w Server MUST response to report request with a successful code or a code in 4xx/5xx range if there was any error. - -> Note: servers may requests for authorization with `t` tag of `report` as per [BUD-01](./01.md). - ### Client behavior The clients can show a blob report button on posts or in blob details. Or its RECOMMENDED to merge this with normal nostr report and send it to both relays and blossom server. other clients can receive it from relays and hide or blur reported blob from trusted friends. @@ -40,4 +37,4 @@ The clients can show a blob report button on posts or in blob details. Or its RE The servers MAY keep the reports somewhere for operators to check and take action on them. they MAY use a list of trusted people or moderators to directly take action on blob without operator request. Servers MAY consider removed blobs sha256 as blocked in order to prevent rewrite. -Servers MAY advertise a route or landing page to provide their rules and term of service which affects the report process. +Servers SHOULD advertise a route or landing page to provide their rules and term of service which affects the report process. From 4e6e322aa371243ae6e7379eb7dcc3e3bc865792 Mon Sep 17 00:00:00 2001 From: Kay Date: Fri, 3 Jan 2025 12:55:43 +0000 Subject: [PATCH 05/11] fix requests. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ec425b..89544ad 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ See the [BUDs](./buds) folder and specifically [BUD-01](./buds/01.md) and [BUD-0 - [BUD-04: Mirroring blobs](./buds/04.md) - [BUD-05: Media optimization](./buds/05.md) - [BUD-06: Upload requirements](./buds/06.md) -- [BUD-07: Blob Report](./buds/07.md) - [BUD-08: Nostr File Metadata Tags](./buds/08.md) +- [BUD-08: Blob Report](./buds/08.md) ## Event kinds From 287b32b531ebc43c853cfd8ed813b6eaf357624b Mon Sep 17 00:00:00 2001 From: "k." Date: Fri, 3 Jan 2025 14:59:39 +0000 Subject: [PATCH 06/11] Update buds/01.md Co-authored-by: hzrd149 <8001706+hzrd149@users.noreply.github.com> --- buds/01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buds/01.md b/buds/01.md index 13b2bd3..41466bb 100644 --- a/buds/01.md +++ b/buds/01.md @@ -26,7 +26,7 @@ Authorization events are used to identify the users to the server Authorization events must be generic and must NOT be scoped to specific servers. This allows pubkeys to sign a single event and interact the same way with multiple servers. -Events MUST be kind `24242` and have a `t` tag with a verb of `get`, `upload`, `list`, `report`, or `delete` +Events MUST be kind `24242` and have a `t` tag with a verb of `get`, `upload`, `list`, or `delete` Events MUST have the `content` set to a human readable string explaining to the user what the events inteded use is. For example `Upload Blob`, `Delete dog-picture.png`, `List Images`, etc From 72d5c1690a19042fbf2d458bdc84a23f1dfb933f Mon Sep 17 00:00:00 2001 From: "k." Date: Fri, 3 Jan 2025 14:59:53 +0000 Subject: [PATCH 07/11] Update README.md Co-authored-by: hzrd149 <8001706+hzrd149@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89544ad..ae01168 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ See the [BUDs](./buds) folder and specifically [BUD-01](./buds/01.md) and [BUD-0 - [BUD-05: Media optimization](./buds/05.md) - [BUD-06: Upload requirements](./buds/06.md) - [BUD-08: Nostr File Metadata Tags](./buds/08.md) -- [BUD-08: Blob Report](./buds/08.md) +- [BUD-09: Blob Report](./buds/09.md) ## Event kinds From 9e468f874947f240c583b588eeab4077cc3e888b Mon Sep 17 00:00:00 2001 From: "k." Date: Sat, 4 Jan 2025 17:37:58 +0000 Subject: [PATCH 08/11] Update buds/09.md Co-authored-by: Kieran --- buds/09.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buds/09.md b/buds/09.md index a86bb5e..425761e 100644 --- a/buds/09.md +++ b/buds/09.md @@ -9,7 +9,7 @@ This bud defines a new endpoint for clients and users to report blobs to servers ### PUT /report - reporting a media -The requests body MUST be a signed [NIP-56](https://github.com/nostr-protocol/nips/blob/master/56.md) report event with `x` tags containing that hashes of the blobs being reported. +The request body MUST be a signed [NIP-56](https://github.com/nostr-protocol/nips/blob/master/56.md) report event with one or more `x` tags containing the hashes of the blobs being reported. Example: From 8487a70a2271aa37dee549999167704ea14bce37 Mon Sep 17 00:00:00 2001 From: "k." Date: Sat, 4 Jan 2025 17:38:54 +0000 Subject: [PATCH 09/11] Update buds/09.md Co-authored-by: Kieran --- buds/09.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buds/09.md b/buds/09.md index 425761e..c9e6a05 100644 --- a/buds/09.md +++ b/buds/09.md @@ -26,7 +26,7 @@ Example: A report request may contain multiple `x` tags or contain some `p` or `e` tags which is not related to blossom server but is SHOULD be considered as a valid request. -Server MUST response to report request with a successful code or a code in 4xx/5xx range if there was any error. +Server MUST respond to a report request with a success code or a code in 4xx/5xx range if there was any error. ### Client behavior From 52abe4467a80087da02d05ac677496fcbef51683 Mon Sep 17 00:00:00 2001 From: "k." Date: Sat, 4 Jan 2025 19:01:39 +0000 Subject: [PATCH 10/11] Update 09.md --- buds/09.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buds/09.md b/buds/09.md index c9e6a05..875067c 100644 --- a/buds/09.md +++ b/buds/09.md @@ -18,15 +18,16 @@ Example: "kind": 1984, "tags": [ ["x", "", ""], + ["x", "", ""] ], "content": "", // other fields... } ``` -A report request may contain multiple `x` tags or contain some `p` or `e` tags which is not related to blossom server but is SHOULD be considered as a valid request. +The clients can include `e` or `p` tags to point to the event or the profile that contains this media if they want to make this report event useful for relays as well. -Server MUST respond to a report request with a success code or a code in 4xx/5xx range if there was any error. +Server MUST respond to a report request with a success code or a code in the 4xx/5xx range if there was any error. ### Client behavior @@ -36,5 +37,5 @@ The clients can show a blob report button on posts or in blob details. Or its RE The servers MAY keep the reports somewhere for operators to check and take action on them. they MAY use a list of trusted people or moderators to directly take action on blob without operator request. -Servers MAY consider removed blobs sha256 as blocked in order to prevent rewrite. +Servers MAY consider removed blobs sha256 as blocked to prevent rewrite. Servers SHOULD advertise a route or landing page to provide their rules and term of service which affects the report process. From eaa37c348dd1f27dc39967e6da0459c32f584f38 Mon Sep 17 00:00:00 2001 From: "k." Date: Tue, 7 Jan 2025 17:37:14 +0000 Subject: [PATCH 11/11] Update 09.md --- buds/09.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buds/09.md b/buds/09.md index 875067c..0c2f808 100644 --- a/buds/09.md +++ b/buds/09.md @@ -7,7 +7,7 @@ This bud defines a new endpoint for clients and users to report blobs to servers. -### PUT /report - reporting a media +### PUT /report - reporting a blob The request body MUST be a signed [NIP-56](https://github.com/nostr-protocol/nips/blob/master/56.md) report event with one or more `x` tags containing the hashes of the blobs being reported.