Updating NIP-90 per comments

This commit is contained in:
Ron Stoner 2023-05-08 13:03:40 -06:00
parent 8f41a24d01
commit b8264055aa
No known key found for this signature in database
GPG Key ID: 268C2E2B04CC71D8

33
90.md
View File

@ -44,11 +44,11 @@ The following are two protocol flow examples using the 1174 event kind. Other fl
```json ```json
{ {
"id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>, "id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>,
"pubkey": <32-bytes lowercase hex-encoded public key>, "pubkey": <32-bytes lowercase hex-encoded public key of event creator>,
"created_at": <unix timestamp in seconds>, "created_at": <unix timestamp in seconds of when event created>,
"kind": 1174 <hardcoded integer>, "kind": 1174 <hardcoded integer>,
"tags": [ "tags": [
[“e”, <32-bytes lowercase hex-encoded sha256 of the previous serialized event data> ], // provided when replying [“e”, <32-bytes lowercase hex-encoded sha256 id of the previous serialized event data> ],
[“magic”, <4-byte hex value representing the Bitcoin network identifier>], [“magic”, <4-byte hex value representing the Bitcoin network identifier>],
[“relays”, <list of relays to broadcast event>], [“relays”, <list of relays to broadcast event>],
], ],
@ -57,19 +57,20 @@ The following are two protocol flow examples using the 1174 event kind. Other fl
} }
``` ```
## Explanation of fields: ### Additional Encryption
``` The encryption used by DMs in NIP-04 can be utilized to further protect the base64 encoded data in the `content` field. This adds an extra layer of protection from those attempting to get information regarding transaction creation via nostr event data similar to how NIP-46 and NIP-47 implement NIP-04.
id: The sha256 hash of the serialized event payload.
pubkey: The public key of the creator of the event. - **nip04_encrypt**
created_at: A Unix timestamp indicating the time when the event was created. - params [`pubkey`, `plaintext`]
kind: An integer value used to indicate the type of event. For PSBTs, the kind is set to 1174. - result `nip4 ciphertext`
tags: An array of tags to capture additional information about the multisig transaction: - **nip04_decrypt**
“e”: (optional): the 32 byte lowercase hex encoded sha256 event id of a prior event id. Only required when replying. - params [`pubkey`, `nip4 ciphertext`]
“magic”: the 4 byte hex representation of the network that the transaction belongs to. - result [`plaintext`]
“relays”: (optional) tag provides relays to broadcast the transactions.
content: PSBT encoded as base64. Note that `pubkey` is a hex-encoded strings.
sig: The signature of the sha256 hash of the serialized event data, which is the same as the "id" field.
```
### Note: ### Note:
The "e" field is optional and is used when replying to a prior event.
The "relays" field is optional and can be used to provide relay URL recommendations to clients for improved censorship resistance. The "relays" field is optional and can be used to provide relay URL recommendations to clients for improved censorship resistance.