The content of `Direct Messages` [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) is encrypted, but everyone can see who is chatting with whom. This is far from ideal from a privacy perspective.
This NIP describes a way to obfuscate DM communications from the "general public", it does not deal with the relay tracking of clients (for that see [NIP XXX](xxx)).
[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) is used to derive the paths. A client can generate multiple `direct message parent keys`, one for each peer that it is communicating with. Nostr `coin_type'` is `1237'` (see [NIP-06](https://github.com/nostr-protocol/nips/blob/master/06.md)). In this NIP we define the purpose `25709'` (`dm` -> `0x646d` -> `25709`) for deriving `Direct Messages` related keys.
> **Note** the reason for using the peer's public key (`Bob`) in the `dm parent key` derivation is to always arive at the same value even if prio state is lost.
>
> **Note** the reason for splitting is that each level of the path can have a max value of 2<sup>32</sup>-1.
If `Alice` wants to signal `Bob` that she is ready to use this NIP (for more privacy) she must:
- build a JSON data of the form:
```json
{
"key": <thedirectmessageparentkey>,
"send_index": <integer(optional),...>,
"receive_index": <integer(optional),...>,
}
```
- publish a `Parameterized Replaceable Event` ([NIP-33](https://github.com/nostr-protocol/nips/blob/master/33.md)) having:
```json
{
...
"kind": 35709,
"content": <NIP-04encryptedcontentoftheJSONdata>,
"tags:" [
"d": <sha256ofthesharedsecretasdefinedinNIP-04>
]
}
```
> **Note** the reason for using `sha256(shared_secret)` for the `d` tag is so that outside observers do not even know that `Alice` and `Bob` have started to communicate. Any other value for the `d` tag would reveal that the message is intended for `Bob.`
After both `Alice` and `Bob` have published the `kind: 35709` event, they start to publish and listen to events using the `one-use-keys`.