add new evento to use header

This commit is contained in:
frbittencourt 2023-04-04 17:42:04 +01:00
parent 988e0b1c5d
commit 75e23c7874

18
95.md
View File

@ -14,8 +14,6 @@ This NIP specifies the use of the `1064` event type (parameterized replaceable e
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.
The `NIP-94` can be used to broadcast the ID of that event, with the ` and ` tag referencing the event id, without having to send the full event which can be a lot of data.
```json
{
"id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>,
@ -31,6 +29,22 @@ The `NIP-94` can be used to broadcast the ID of that event, with the ` and ` tag
}
```
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>],
],
"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>
}
````
Relay Behavior
---------------
Relays that use a relational database may have more difficulty implementing this NIP, but a possible solution is for this NIP not to be recorded in the database, but on disk, the file name being the event id. So it can be easily found and searched. And because it is not in the database, it does not interfere with the indexing of common events.