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
{
"id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>,
"pubkey": <32-bytes lowercase hex-encoded public key>,
"created_at": <unix timestamp in seconds>,
"pubkey": <32-bytes lowercase hex-encoded public key of event creator>,
"created_at": <unix timestamp in seconds of when event created>,
"kind": 1174 <hardcoded integer>,
"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>],
[“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:
```
id: The sha256 hash of the serialized event payload.
pubkey: The public key of the creator of the event.
created_at: A Unix timestamp indicating the time when the event was created.
kind: An integer value used to indicate the type of event. For PSBTs, the kind is set to 1174.
tags: An array of tags to capture additional information about the multisig transaction:
“e”: (optional): the 32 byte lowercase hex encoded sha256 event id of a prior event id. Only required when replying.
“magic”: the 4 byte hex representation of the network that the transaction belongs to.
“relays”: (optional) tag provides relays to broadcast the transactions.
content: PSBT encoded as base64.
sig: The signature of the sha256 hash of the serialized event data, which is the same as the "id" field.
```
### 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.
- **nip04_encrypt**
- params [`pubkey`, `plaintext`]
- result `nip4 ciphertext`
- **nip04_decrypt**
- params [`pubkey`, `nip4 ciphertext`]
- result [`plaintext`]
Note that `pubkey` is a hex-encoded strings.
### 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.