-
Sender and recipient each need to create keypair using these libraries. (we cannot use Solana's for now as that would not work)
-
then sender somehow needs to get hold of recipient's tweetnacl public key - lets say this happens offline. (for future we could create a mapping of Solana key to Nacl key)
-
Then sender will use recipient public key and their own TweetNacl private key to encrypt it. Then this message will be posted on the relay. Message will have Nonce, Encrypted message and Senders pubKey.
-
The recipient then decrypt using their own private key and senders pubKey. for now this is not built on DApp. but we should be able to on a separate screen. maybe recipient can for now manually copy the fields needed to decrypt on this separate screen.
-
I also created Recipient TweetNacl pb key to be on the data - maybe so they can search for their own messages. (not sure how yet but since its on the data of relay). Maybe in future we need to provide someway to filter their messages based on this?