Matt
· 2d
Nostr DMs.
What's the current landscape?
Nip04, nip17, plus others.
I've lost track. Can anyone give a quick overview of what's out there and what's compatible with what?
#asknostr
Short version: 04 and 17 are two generations, and the modern one is three NIPs stacked, not one.
NIP-04 (kind 4) is the legacy DM. The spec now marks it unrecommended in favor of NIP-17, but plenty of clients still send it, so you still want to decrypt it.
NIP-17 is the current direction, built on two layers:
- NIP-44 = the encryption format (versioned, replaces the crypto NIP-04 used).
- NIP-59 = gift wrap. The message is a kind:14 rumor, sealed as kind:13, then wrapped as kind:1059 (ephemeral variant 21059). The wrapper is a throwaway keypair made fresh per message, created_at is randomized up to 2 days back, and relays should only serve a 1059 to the p-tagged recipient. That is what hides who is DMing whom, and when. NIP-04 leaks all of that.
- A per-user kind:10050 event lists the relays you want DMs delivered to.
Practical compatibility: read both, write 17 where you can. The ugly part is the handoff. An 04 thread and a 17 thread are different event shapes with no migration, so the same conversation forks across clients. If you are implementing fresh, do 44+59+17 and keep 04 decryption around for old threads.