Summary
NIP-04 encrypted direct messages (kind 4) are listed in the relay's supported NIPs but have no integration test coverage. The flow differs from kind 1 in that messages are targeted to a recipient via a p tag, and access control (if any) hinges on that tag.
What to test
- Alice publishes a kind 4 event with Bob's pubkey in a
p tag → accepted and stored
- Alice can retrieve her sent DM by event ID
- Bob subscribes with a filter for
#p matching his pubkey → receives Alice's DM
- A third party (Charlie) subscribed to Bob's pubkey filter should not receive the encrypted content differently (relay stores and forwards the ciphertext as-is)
- Duplicate kind 4 event submission → returns
duplicate: command result
Relevant code
src/constants/base.ts — EventKinds.ENCRYPTED_DIRECT_MESSAGE
src/handlers/event-strategies/default-event-strategy.ts
Suggested location
test/integration/features/nip-04/nip-04.feature
Summary
NIP-04 encrypted direct messages (kind 4) are listed in the relay's supported NIPs but have no integration test coverage. The flow differs from kind 1 in that messages are targeted to a recipient via a
ptag, and access control (if any) hinges on that tag.What to test
ptag → accepted and stored#pmatching his pubkey → receives Alice's DMduplicate:command resultRelevant code
src/constants/base.ts—EventKinds.ENCRYPTED_DIRECT_MESSAGEsrc/handlers/event-strategies/default-event-strategy.tsSuggested location
test/integration/features/nip-04/nip-04.feature