mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-22 16:35:52 -05:00
add json schema
This commit is contained in:
parent
342722963b
commit
0ef5486e56
15
95.md
15
95.md
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user