3.2. Frontend responsibilities

The frontend is where almost all sensitive logic lives.

When the client starts, it connects to the wallet and uses it to establish identity and user intent. From there, it creates or derives a messaging keypair that is used only for messaging. This keypair is stored locally and never uploaded in full.

When sending a message, the frontend performs the following steps:

  • fetch or reuse the recipient’s public messaging key

  • encrypt the message locally

  • send the resulting ciphertext to the backend

The plaintext message only exists in memory long enough to be displayed to the user and encrypted. Once encryption is complete, the original text is no longer part of the system state.

On the receiving side, the client fetches encrypted messages addressed to the wallet and attempts to decrypt them using the locally stored private messaging key. Only messages intended for that key become readable.

This makes the frontend more than just a UI layer. It is effectively a cryptographic endpoint that happens to render a chat interface. From a security perspective, the frontend is trusted; from a usability perspective, it must hide that complexity and feel like a normal messenger.

Last updated