From 08cc3c6f7d47ed04536db129a5da6c9dfb91a97b Mon Sep 17 00:00:00 2001 From: frbittencourt Date: Fri, 10 Mar 2023 11:19:26 +0000 Subject: [PATCH] improved nip description --- 95.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/95.md b/95.md index 00132df1..988f9735 100644 --- a/95.md +++ b/95.md @@ -1,15 +1,18 @@ -NIP-95 Base64 File +NIP-95 - Storage and Shared File ====== `draft` `optional` `author:frbitten` This NIP allows users to send binary data to be stored in the relay. This data can be small pieces of information or even large files. +The intention is to combine the ease of NOSTR, with many clients being developed and a common communication protocol between all. To enable decentralized file sharing. NOSTR communication must work together with other protocols to get the best out of each technology. For lay users to be able to publish their photo, file, audio on several servers in a simple and easy way. + Nostr event ------------------ This NIP specifies the use of the `30064` event type (parameterized replaceable event), having in `content` the binary data that you want to be stored in Base64 format. * `d` containing the name of the shared file to allow it to be overwritten in the future. * `type` a string indicating the data type of the file. The MIME types format must be used (https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) * `decrypt` (optional) If the file is encrypted, you must indicate in the first value the algorithm used to encrypt the file and in the second value the parameters that allow the decryption of the file +* `format` ("Base64" or "BSON") Defines how the data is stored in the content. Having the option of being in base64 format or in BSON format. This event must not be returned in generic searches. It should only be returned if specifically requested by your ID. This avoids bandwidth consumption and unnecessary overload on the relay and client. @@ -25,7 +28,8 @@ The `NIP-94` can be used to broadcast the ID of that event, with the ` and ` tag ["d", ], ["decrypt",,], ["p", <32-bytes hex of a pubkey>, ], - ["hash",< SHA256 hexencoded string of the raw data>] + ["hash",< SHA256 hexencoded string of the raw data>], + ["format",<"Base64" or "BSON">] ], "content": , "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> @@ -54,3 +58,9 @@ Suggested Use Cases ------------------- * Provide file storage service that is quickly integrable with nostr clients. * Create an application similar to pinterest without the need for other protocols. + +References +--------------- +* https://www.mongodb.com/developer/products/mongodb/storing-large-objects-and-files/ +* https://www.mongodb.com/docs/manual/core/gridfs/ +* https://www.linkedin.com/pulse/do-store-files-your-database-mongodbs-gridfs-thinks-otherwise-gordon/ \ No newline at end of file