Skip to content

Feature: end-to-end encryption for conversations #126

@think-in-universe

Description

@think-in-universe

Implement end-to-end encryption for Private Chat with NEAR MPC + Cloud API.

As now we have supported end-to-end encryption in Cloud API, we can implement the end-to-end encryption for any users who can safely manage their private key, e.g. with NEAR MPC if the user has a NEAR account.

The encrypted chat process for streaming

  1. The user logins with NEAR wallet;
  2. Request a private key with NEAR MPC;
  3. Encrypt content with model's public key, and call Responses API with the user's public key in header;
  4. Decrypt the received chunk with user's private key.

Remaining issues:

  • For loading the conversations, some changes will be required in cloud-api for storing the conversations. Now all the encrypted chunks are concatenated with no easy way to distinguish each chunk, making it hard to decrypt the messages by the user.
  • Another solution is decrypting each chunk at frontend, encrypting the concatenated message and inserting the whole message (conversation item) back into the conversation.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions