2023-04-10 08:33:21 -04:00
NIP-705
2023-04-10 08:00:12 -04:00
======
Republish Encrypted Direct Messages
-----------------------------------
`draft` `optional` `author:fiatjaf` `author:motorina0`
This NIP defines a way for a client to indirectly publish `kind:4` events to a relay with the help of its peers.
## Motivation
2023-04-10 08:07:14 -04:00
One way to increase the privacy of Encrypted Direct Messages ([NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md)) is for peers to derive new `one-use-only` keys when they communicate (see [NIP704 ](https://github.com/motorina0/nips/blob/dm-one-use-keys/704.md )).
2023-04-10 08:33:03 -04:00
This technique hides from the "general public" that two clients are chatting. However, the relay(s) in the middle can still see who is publishing events and who is listening for events with specific public keys (and correlate the two).
2023-04-10 08:00:12 -04:00
## Suggestion
2023-04-10 08:33:03 -04:00
Any client can ask its peers to re-publish messages on its behalf. The simplified version of the interaction is as follows:
2023-04-10 08:20:28 -04:00
- `Alice` wants to chat with `Bob` . She builds the `kind:4` nostr event but does NOT sent it to the relay(s).
2023-04-10 08:33:03 -04:00
- instead `Alice` creates a `kind:4` event for `Carol` where the content is the event for `Bob` . `Alice` publishes this event to the relay(s).
2023-04-10 08:20:28 -04:00
- `Carol` receives the event, unwrapps it and publishes to the relay(s) the event for `Bob` .
- the relay(s) see the event as comming from `Carol` instead of `Alice`
2023-04-10 08:33:03 -04:00
People can easily run very lightweight republish services for free and provide anonymity for everybody else.
## Implementation
Define a new very generic `republish` event with `kind:20001` (ephemeral) in the form:
```json
{
...
"kind": 20001,
"content": < encrypted JSON of the event that is to be republished > ,
"tags": [
["p", < pubkey of the person that is chosen to republish this > ],
["relays", "wss://relay.com", "wss://otherrelay.com", "and so on, there could be many of these"]
]
}
```
Then whenever the chosen republisher sees a note like that they automatically decrypt it using NIP-04 method and publish it to the chosen relays.
- the chosen relays could (and probably should) be different from the relay used to broadcast the republish event.
- there could be many republish events with the same underlying encrypted event.
- there could be multiple nested levels of republish events.