add json schema

This commit is contained in:
frbittencourt 2023-03-09 14:05:07 +00:00 committed by fiatjaf_
parent 342722963b
commit 0ef5486e56

15
95.md
View File

@ -15,6 +15,21 @@ This event must not be returned in generic searches. It should only be returned
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>,
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
"created_at": <unix timestamp in seconds>,
"kind": 30064,
"tags": [
["d", <string with name of file>],
["decrypt",<algorithm>,<key>],
["p", <32-bytes hex of a pubkey>, <recommended relay URL>],
],
"content": <string with base64 data>,
"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.