e2e encryption - Satellite-im/Core-PWA GitHub Wiki

Hierarchical Deterministic Wallet Generation

  1. User creates an account, and a random bip39 12-word phrase is given.

  2. The seed phrase is converted into a master key that is used to deterministically derive new hierarchical accounts (Ed25519 keypairs)

Payer and user accounts

The first account (derivation path m/44'/501'/0'/0') is used as payer for Solana transactions

A special account is created for storing user information (derivation path user)

Future improvement for the user account: the special account for the user is going to be replaced by a PDA (Program Derived Address to allow future integrations with existing Solana wallets)

Persistence of the wallet

The mnemonic phrase is encrypted (AES Symmetric Encryption) using a user-defined password and stored in the local storage

These can be seen here, using this to create the keypair Message, chat, and files storage

The application makes use of Textile.io for storing chat messages and files. Textile is built on top of IPFS and Filecoin and represents an interface for using these distributed decentralized storage technologies with a DB-like syntax. It has an internal identity mechanism that uses asymmetric keys for both encryption and signing. That way it is possible to prove the origin of a message and also to make sure that the information is accessible only to the other party involved (using E2E encryption or AES encryption depending on the case)

Encryption

We use E2E encryption for 1-to-1 messaging, provided under the hood by textile Mailbox API, and AES symmetric encryption for group messaging.

For group messaging the exchange of the symmetric key happens using E2E encryption.

To share E2E encrypted data on-chain we use ECDH. To achieve this result we start from the user keypair (Ed25519) and we convert it into a Curve25519 that supports ECDH. Then we compute a shared secret between the parties and we use that secret to perform symmetric encryption using AES.

These can be seen here and here

More info on the signing and security at this stage can be found here