add "n" tag with sender encryption key to seal.

This commit is contained in:
fiatjaf
2026-06-02 09:07:24 -03:00
parent a596fadeaf
commit bee7463e67

7
17.md
View File

@@ -37,7 +37,10 @@ Following [NIP-59](59.md), the **unsigned** chat messages must be sealed (`kind:
"pubkey": senderIdentityKey.public,
"created_at": randomTimeUpTo2DaysInThePast,
"kind": 13, // seal
"tags": [], // no tags
"tags": [
// when senderEncryptionKey != senderIdentityKey (see below)
["n", senderEncryptionKey.public]
],
"content": nip44.encrypt(
unsignedMessageRumor,
nip44.compute_conversation_key(senderEncryptionKey.private, receiverEncryptionKey.public)
@@ -79,6 +82,8 @@ The existence of this event shows that the receiver wants to receive messages en
When sending, `p`-tagging the receiver should still use their _identity key_; and when receiving messages the receiver should still assume the `"author"` field of the seal event contains the _identity key_.
An `n` tag set to `senderEncryptionKey.public` MUST be added to the seal event when the _encryption key_ is different from the _identity key_.
## Publishing
Kind `10050` indicates the user's preferred relays to receive DMs. The event MUST include a list of `relay` tags with relay URIs.