SanR — Messenger Update!

in SanR2 years ago

https://images.hive.blog/DQmbsCn6xmLvrDjmFZho87RiWtSnZtZ8R2Dhwn8DoFfTaEY/messaging%20update%20(1).png

SanR has just released a new peer-to-peer messaging feature where players can now directly contact one another through encrypted messages through the blockchain, all on the SanR platform!

How do we do it?

In the exciting world of Ethereum dApps, implementing private peer-to-peer messaging has been challenging with limited options. After careful consideration, we chose to leverage the powerful features of MetaMask’s browser extension API. Specifically, we utilized eth_getEncryptionPublicKey and eth_decrypt to enable secure messaging within our platform.

While this approach has some limitations, we’re always looking ahead to explore even better solutions. We might explore alternatives, such as the Waku protocol shortly. Stay tuned as we continue to innovate and improve your dApp experience!

Here is how to get started with messaging on SanR

For example, if you want to send a private message to a user named Bob on SanR, you would share your public encryption keys with SanR to facilitate this.

To begin, each player will be presented with the option to try out messaging on SanR and enable communication with other users by sharing their public key on the landing page. Enabling the feature is quick and easy, so you can get started in no time!

Once provided with the public key, players will be directed to the message tab on your profile page, where they can start messaging each other!

On here, you can initiate direct conversations with other players who have already enabled their messenger feature! To send each message, you will need to sign a signature request for it to be successfully delivered.

Once sent out, the message will then be encrypted using the sender’s and receiver’s public encryption keys, resulting in two strings as shown below.

Afterwards, both messages are transformed into NFTs and placed on the SanR blockchain. Since the messages are fully encrypted, anyone can see that a user sent a message to Bob, but the actual contents remain hidden. Only the sender and Bob possess the ability to decrypt and read the messages using their MetaMask browser extension.

Once the messages have been decrypted through Metamask the contents of the decrypted messages can then be freely seen on the app whenever your wallet is connected.

That’s all there is to the messenger feature for SanR! We hope you have a great time exploring it and building strong relationships with other traders in the community. Enjoy your journey!

Resources:

https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686

https://docs.metamask.io/guide/rpc-api.html#eth-decrypt-deprecated

https://docs.metamask.io/guide/rpc-api.html#eth-getencryptionpublickey-deprecated

Thanks for reading! We hope to see you all participate and join the community for some fun! 🥳 🥳

Follow us:

SanR — https://sanr.app/?utm_source=leof

SanR 🐲 Telegram — https://t.me/sanr_protocol

Posted Using LeoFinance Alpha