removed the connections with the NIP-94, making this nip independent.

This commit is contained in:
frbittencourt 2024-03-28 16:35:51 +00:00
parent 49328e0e1e
commit 9ce5ab5671
1 changed files with 32 additions and 5 deletions

37
95.md
View File

@ -29,7 +29,36 @@ This event must not be returned in generic searches. It should only be returned
}
```
The file description is defined by [NIP-94](https://github.com/nostr-protocol/nips/blob/master/94.md)
Another defined event is the `1065` which is used as a header for the data contained in an event 1064. This way the data can be disclosed without overloading the communications when sending a large amount of data.
```json
{
"id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>,
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
"created_at": <unix timestamp in seconds>,
"kind": 1065,
"tags": [
["e",<event id 1064 you want to disclose>],
["m", <MIME type>],
["x",<Hash SHA-256>],
["size", <size of data in bytes>],
["dim", <size of data in pixels>],
["thumb", <event id that contains the data for thumb>],
["summary", <excerpt>],
["alt", <description>]
],
"content": <description>,
"sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>
}
````
* `e` event id 1064 you want to disclose
* `m` a string indicating the data type of the file. The [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) format must be used, and they should be lowercase.
* `x` containing the SHA-256 hexencoded string of data.
* `size` (optional) size of data in bytes
* `dim` (optional) size of data in pixels in the form `<width>x<height>`
* `thumb` (optional) event id that contains the data for thumb, which can be an event 1063 or 1064
* `summary` (optional) text excerpt
* `alt` (optional) description for accessibility
Relay Behavior
---------------
@ -37,13 +66,11 @@ Relays that use a relational database may have more difficulty implementing this
Another solution is for Relays that want to implement this functionality and use a No-SQL database with mongodb that already supports large documents without harming performance.
The relay can allow access to this data via URL, having its own URL pattern for these cases. And if you receive a `NIP-94` referring to a `NIP-95` you can include the URL in the proper `NIP-94` tag
Client Behavior
---------------
The client can use this event for any type of storage it wants. The functionality of uploading an image directly through the client's interface and including it in the note that is being created is a very useful facility for the end user. In this case, 3 events would be created. Kind 1064 with the file converted to base64, Kind 1063 which is the header of this file for dissemination and Kind 1 with the post and the image.
The client can use this event for any type of storage it wants. The functionality of uploading an image directly through the client's interface and including it in the note that is being created is a very useful facility for the end user. In this case, 3 events would be created. Kind 1064 with the file converted to base64, Kind 1065 which is the header of this file for dissemination and Kind 1 with the post and the image.
Also, when used in conjunction with `NIP-94`, it allows the app to create image galleries (memes, animations) that can be reused countless times in different notes. As it exists in whatsapp, tegegran, etc.
Also, it allows the app to create image galleries (memes, animations) that can be reused countless times in different notes. As it exists in whatsapp, tegegran, etc.
Example: <https://ibb.co/Fnj5TMg>.