improve json formatting on nips 1 and 9 and remove an unnecessary field.

This commit is contained in:
fiatjaf 2022-01-01 10:40:19 -03:00
parent 2ad53aa88f
commit 8601706ffc
2 changed files with 16 additions and 16 deletions

View File

@ -16,17 +16,17 @@ The single object type that exists is the `event`, which has the following forma
``` ```
{ {
id: <32-bytes sha256 of the the serialized event data> "id": <32-bytes sha256 of the the serialized event data>
pubkey: <32-bytes hex-encoded public key of the event creator>, "pubkey": <32-bytes hex-encoded public key of the event creator>,
created_at: <unix timestamp in seconds>, "created_at": <unix timestamp in seconds>,
kind: <integer>, "kind": <integer>,
tags: [ "tags": [
["e", <32-bytes hex of the id of another event>, <recommended relay URL>], ["e", <32-bytes hex of the id of another event>, <recommended relay URL>],
["p", <32-bytes hex of the key>, <recommended relay URL>], ["p", <32-bytes hex of the key>, <recommended relay URL>],
... // other kinds of tags may be included later ... // other kinds of tags may be included later
] ]
content: <arbitrary string>, "content": <arbitrary string>,
sig: <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field>, "sig": <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field>,
} }
``` ```

View File

@ -2,27 +2,27 @@ NIP-09
====== ======
Event Deletion Event Deletion
------------------------- --------------
`draft` `optional` `author:scsibug` `draft` `optional` `author:scsibug`
A special event with kind `5`, meaning "deletion" is defined as having a list of one or more `e` tags, each referencing an event the author is requesting to be deleted. A special event with kind `5`, meaning "deletion" is defined as having a list of one or more `e` tags, each referencing an event the author is requesting to be deleted.
Each tag entry must contain an event id intended for deletion. The `<recommended relay URL>` item SHOULD be set to `""`, it is ignored for deletion events. Each tag entry must contain an "e" event id intended for deletion.
The event's `content` field MAY contain a text note describing the reason for the deletion. The event's `content` field MAY contain a text note describing the reason for the deletion.
For example: For example:
```json ```
{ {
kind: 5, "kind": 5,
pubkey: <32-bytes hex-encoded public key of the event creator>, "pubkey": <32-bytes hex-encoded public key of the event creator>,
tags: [ "tags": [
["e", "dcd59..464a2", ""], ["e", "dcd59..464a2"],
["e", "968c5..ad7a4", ""], ["e", "968c5..ad7a4"],
], ],
content: "these posts were published by accident", "content": "these posts were published by accident",
...other fields ...other fields
} }
``` ```