About direct messages, what I have in mind is this:

1. Nobody can see who is messages whom

2. Even access to the nsec will not reveal this

3. When you delete a message it's really gone (from your side)

4. You can only use one device for DMs at any given time (though you can sync between devices using some other protocol if you really really want to offer redundant storage to the cops)

Once in a while your client generates a random new DM key and publishes the public key in an announcement. You client also keeps track of public keys of people you follow, or even just any DM public key it sees announced.

If A wants to send a message to B they generate a shared key using a diffie-hellman exchange (or something fancier). This is an ephemeral Nostr account. A posts a message using that new account, and encrypted such that only that account can read it. B should be monitoring all such potential accounts.

Each message contains a new random public key, so each reply is a new account. This means you really have to catch every message, so your conversation might get stuck.

These messages should be posted using the anonymous posting thing I described earlier.

Optionally when you announce a public key, you also publish a more narrow list of relays that others should use to reach you and that you use to post messages. This saves costs.

Reply to this note

Please Login to reply.

Discussion

The key generation would be similar to the key generation in modern bitcoin wallets (base key derived according some forameters)? You could then transfer your base key to another device. Or like with an xpubkey have watch only instances to watch and forward PMs to your 'hot wallet' messenger?

I see (2) as a feature, not a bug. You could use determinstic keys the way you suggest, but I think you should use random keys.

Except for 1) this is more or less how matrix works?

Did you have a look at how private zaps are implemented? It kind of works similar to what you suggest, I think. It might be an idea to use a similar approach for DMs.

(access to nsec would reveal information tho).

Hey Sjors. Have you seen the proposals already in pull requests? I am currently trying to see if we can improve/merge the two approaches, your ideas sound similar.

draft NIP-93 "Secret Events" https://github.com/nostr-protocol/nips/pull/306

draft NIP-31 "Incognito Direct Messages" https://github.com/nostr-protocol/nips/pull/410