Skip to content

[frontend] - mplement End-to-End Encryption for Trade Chat Messages #122

Description

@dark-sarge

Location: server/src/routes/messages.ts, frontend/app/trades/[id]/chat/

Description

Buyers and sellers frequently need to coordinate delivery details (recipient phone numbers, network codes) during an active trade. Exchanging this sensitive information in plain server-stored messages is a privacy risk. An end-to-end encrypted trade chat using the Signal Protocol or NaCl box encryption is the appropriate solution.

Acceptance Criteria

  • A /trades/[id]/chat page is accessible to both the buyer and seller of an active trade.
  • Messages are encrypted client-side using the counterparty's Stellar public key (repurposed as a Curve25519 key) via NaCl box before being sent to the server.
  • The server stores only the ciphertext and cannot decrypt messages — it acts purely as a relay.
  • POST /api/trades/:id/messages (authenticated, buyer or seller only) stores an encrypted message.
  • GET /api/trades/:id/messages returns ciphertexts, and the client decrypts them locally for display.
  • Messages are automatically purged from the database 7 days after the trade reaches a terminal status (Completed, Cancelled).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions