defy.tools

Class HDKXNotification

The sender calculates the receiver's extended public notification key pair (receiverNotifXPub) by using "02" + receiverProfileKey with chain code of sha256(receiverProfileKey).

The sender calculates their own extended private notification key pair (senderNotifXPriv) by using their own private profile key, but using modN of the negated private key if the original private key produces an odd parity public key.

The sender calculates the NIP44V2 conversationKey with publicKey = receiverNotifXPub/(created_at) and the privateKey = senderNotifXPriv/(created_at).

The intent is to have the converstionKey generated fresh on each event and have no key visible in the event, public or private, that identifies the sender or the receiver

The event is given an #e tag of sha256(receiverNotifXPub/1/1). The intent is to make the mesage identifiable to the sender and the receiver, but meaningless, unreadable, and unidentifiable to an outside data snooper.

The message payload can include text, but should always include a conversation senderXPub, which the receiver can use to send messages without relying on the Notification index. see HDKXTwoParty.ts.

USE CASE: notifying a user of a new Two Party extended publicKey.

Hierarchy

  • HDKTimeBased
    • HDKXNotification

Constructors

  • Parameters

    • __namedParameters: {
          privateKey?: string;
          profileKey?: string;
      }
      • Optional privateKey?: string
      • Optional profileKey?: string

    Returns HDKXNotification

Properties

documents: ContentDocument[] = []
encryptParent: HDKey
eventTag: string
groupOffset: number = 0
parentDocument?: ContentDocument
signingParent: HDKey

Methods

  • Parameters

    Returns Promise<Event<number>>

  • Parameters

    Returns Event<number>