deso-protocol / backend

HTTP API for a DeSo node
https://docs.deso.org
MIT License
134 stars 88 forks source link

[Feature request] Message enhancements #152

Open tsheaff opened 2 years ago

tsheaff commented 2 years ago

Some enhancements that would make the DM features more powerful:

tsheaff commented 2 years ago

Also as an aside @maebeam or @diamondhands0 I'd love to understand the encryption mechanism a bit better. I see in the code here in seedHexEncryptionKey we're creating a random 32-byte key and saving in local storage or cookie storage. However, what I don't understand is how I'm able to decrypt the same messages on multiple clients, e.g. in my CloutFeed mobile app or on bitclout.com on my laptop, I can read the DMs in both places. What's the mechanism for sharing my encryption key? For end-to-end-encrypted apps like WhatsApp, they use QR code mechanism to share encryption credentials from your phone to your desktop apps.

Once I grok this better, I'd be happy to add a section about this in the public docs for new developers.

maebeam commented 2 years ago

Your mnemonic generates your seedHex which is your private key material. This private key lets you decrypt messages on any device / app. We encrypt the seedHex with 32 random bytes because certain browsers (Safari, Brave, etc) don't allow local storage access from the iframe that signs transactions / decrypts messages.