damus-io / damus

iOS nostr client
GNU General Public License v3.0
2k stars 289 forks source link

Local DM Translation #1964

Open alltheseas opened 8 months ago

alltheseas commented 8 months ago

DM translations are disabled since we cache translations on the purple api server. We will re-enable once we have a device-local translator.

cc @tyiu @jb55

alltheseas commented 5 months ago

@semisol does purple translation API translate DMs?

cc @jb55

Semisol commented 5 months ago

@Semisol does purple translation API translate DMs?

cc @jb55

It does not translate DMs. Unfortunately, some problems exist, primarily that Noswhere and Damus Purple store translated text for caching.

We could implement a solution where we use EC2 with Nitro enclaves, the client authenticates the code running on the enclave does not log translations (via attestation and hardcoded set of image hashes), and the data transfer between the translation API and the enclave is secured via TLS. But this will come at a steep cost which I do not think is logical for Damus.

Semisol commented 5 months ago

This partially depends on #1478

alltheseas commented 5 months ago

What are the privacy implications of DM translations service @Semisol

Semisol commented 5 months ago

What are the privacy implications of DM translations service @Semisol

In this case, it's pretty secure actually, both from unintentional visibility and someone willingly trying to log DMs. Of course, the translation provider, say AWS, would see the note but they have compliance requirements, and you could opt out from any data being stored. So it could get subpoenaed, but very unlikely.

Cost is a bigger factor.

alltheseas commented 5 months ago

@tyiu what's your view of translations of DMs - is this a non-need?

tyiu commented 5 months ago

@tyiu what's your view of translations of DMs - is this a non-need?

It's a niche use case but I imagine some would find it useful. But it's insecure to translate DMs through the server. We should perform translations locally if we are to do it at all.

jb55 commented 5 months ago

On Wed, May 08, 2024 at 10:12:43AM -0700, alltheseas wrote:

@tyiu what's your view of translations of DMs - is this a non-need?

translating DMs is a terrible idea, I would only do it locally.

alltheseas commented 3 months ago

@tyiu suggested to use new #2302 API translation from iOS 18 update for private DM translations!