nips/704.md

26 lines
1.2 KiB
Markdown
Raw Normal View History

2023-04-07 09:58:00 -04:00
NIP-704
======
Key derivation for Encrypted Direct Messages
-----------------------------------
`draft` `optional` `author:motorina0`
This NIP defines a way for two clients to derive `one-use-only` keys for sending and recieving `kind:4` events.
## Motivation
2023-04-07 10:32:31 -04:00
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.
2023-04-07 09:58:00 -04:00
## Suggestion
For the maximum of privacy the two participants of a `Direct Message` exchange SHOULD use a different public key for each `kind:4` event.
This means that each participant has to:
2023-04-07 10:09:28 -04:00
- build a `direct message top key` from which it will derive keys to send and keys to recieve (listen for) `kind:4` events
2023-04-07 09:58:00 -04:00
- share this `direct message top key` with its DM peer
2023-04-07 10:31:00 -04:00
Each client has a `master` key (denoted with `m`). This key can be the profile `nsec...`, but it is not mandatory.
## BIP32 purpose
2023-04-07 10:32:31 -04:00
[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) is used to derive the paths.
2023-04-07 10:31:00 -04:00
This NIP defines purpose `25709` (`dm` -> `0x646d` -> `25709`) for deriving `Direct Messages` related keys.
`m/25709'/1237'/[<account>']`