Skip to content

Private messages#69

Merged
hackergrrl merged 10 commits into
masterfrom
private-messages
Apr 13, 2021
Merged

Private messages#69
hackergrrl merged 10 commits into
masterfrom
private-messages

Conversation

@hackergrrl

@hackergrrl hackergrrl commented Jan 27, 2020

Copy link
Copy Markdown
Member

This is a work-in-progress!

This PR adds private messages, that enable two individual users (feeds) to communicate with each other such that other participants in the cabal will sync their messages, but not be able to read them. The messages are encrypted using private-box, which uses chloride.

The cross-stack implementation is tracked by cabal-club/commons#8

  • Core API for publishing messages to a recipient
  • Kappa View for indexing sent and received private messages
  • Core API for reading private message conversations (via ^ kappa view)
  • Core API for listing PM convos
  • Tests

@hackergrrl hackergrrl changed the title Private (1:1) messages [DRAFT] Private (1:1) messages Jan 27, 2020
@hackergrrl hackergrrl changed the title [DRAFT] Private (1:1) messages [DRAFT] Private messages Jan 27, 2020
@hackergrrl hackergrrl mentioned this pull request Jan 27, 2020
11 tasks
@todrobbins todrobbins added the enhancement New feature or request label May 21, 2020
@hackergrrl hackergrrl mentioned this pull request Jun 20, 2020
@khubo

khubo commented Nov 19, 2020

Copy link
Copy Markdown
Member

@noffle I could pick this up if you can guide a bit. Only api for fetching pm's by users is remaining?

@Gronis

Gronis commented Apr 8, 2021

Copy link
Copy Markdown

How would this work if I have multiple devices (with different private keys). Will only a specific device have access to the private message feed? I guess this is the case and it is not ideal.

@cblgh

cblgh commented Apr 8, 2021

Copy link
Copy Markdown
Member

@Gronis yes you are correct, that's basically the limitation

depending on how we do it, we could support private messages among multiple identities which mitigates this somewhat. the limitation of this approach remains though

@Gronis

Gronis commented Apr 8, 2021

Copy link
Copy Markdown

Yea. Most p2p systems with a private key as authenticator have this problem. I have yet to see a good solution.

Maybe the user identity and the device key should be separated somehow, and then, different device keys can be added or removed to the user identity by signing from a device which already is associated with the same user identity, while also providing a secret. It would be a p2p 2FA system kind of.

Anyways, I'm kind of off topic here. Good discussion anyways.

@okdistribute

Copy link
Copy Markdown
Member

Delta chat accomplishes this by transferring private keys across devices with an Autocrypt Setup message

@hackergrrl

hackergrrl commented Apr 9, 2021

Copy link
Copy Markdown
Member Author

Hey y'all. I reviewed this code and here are the next steps I see:

  • Finish writing the kappa view
    • Decide how we want to store indexed PMs. We could store them in plaintext (faster to fetch), or only store the msgIds and decrypt them on fetch (slower, ensures that the plaintext only exists in memory -- but does this matter?). (The current code that writes to leveldb in this view is old copypasta.)
    • Write kappa view API for fetching private messages. I think an API that mimicks the Messages kappa view API would be best, so that cabal-client can do similar logic. (The current code under api: is just old copypasta.)
    • Emit events as new PMs come in. (You index your own msgs too though, so we'd need to decide if we want to emit for our own messages (does the Message view do this?))
  • Write end-to-end tests that show you can PM someone, and then use the kappa view's API to read that conversation history out.

After the cabal-core implementation is done, we can figure out the API that will be exposed on cabal-client and implement it there, before threading it up into clients. I really like the idea of having an API that mirrors the existing messages API as much as possible, presenting PM convos as much like channels as makes sense.

@okdistribute

Copy link
Copy Markdown
Member

Awesome @noffle ! Very exciting!

Re:

Decide how we want to store indexed PMs. We could store them in plaintext (faster to fetch), or only store the msgIds and decrypt them on fetch (slower, ensures that the plaintext only exists in memory -- but does this matter?).

I think that on-disk encryption can be useful for some communities, but Cabal isn't billing itself a 'security-first' app to high-risk users. Since it's still very much a beta project I think that storing them as plaintext on the device is sufficient if it's easier to implement (also the better performance is a plus of course!)

@hackergrrl

Copy link
Copy Markdown
Member Author

@okdistribute: I think that on-disk encryption can be useful for some communities, but Cabal isn't billing itself a 'security-first' app to high-risk users. Since it's still very much a beta project I think that storing them as plaintext on the device is sufficient if it's easier to implement (also the better performance is a plus of course!)

I agree!

@hackergrrl

Copy link
Copy Markdown
Member Author

Tests are green! I'll merge soon if there's no issues.

Do either of you have spoons to review @cblgh @substack?

@cblgh

cblgh commented Apr 12, 2021

Copy link
Copy Markdown
Member

@noffle :0 :0 :0 :0

AWESOME!!!!! i'll try to do a review pass rn! gonna get like a pot of chamomille lol

@cblgh cblgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
image
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

i have some suggestions adding comments and stuff, github should make it possible to batch the ones you think are good additions & you can discard the rest. also left my lil thought trail cause hey why not

NICE JOB KIRA!!! 🖤 💜

Comment thread README.md
Comment thread index.js Outdated
Comment thread index.js Outdated
Comment thread index.js
Comment thread index.js
Comment thread views/private-messages.js
Comment thread views/private-messages.js Outdated
Comment thread test/test.js
Comment thread index.js Outdated
Comment thread index.js Outdated
noffle and others added 9 commits April 12, 2021 13:19
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
@hackergrrl hackergrrl merged commit 6b07050 into master Apr 13, 2021
@cblgh

cblgh commented Apr 13, 2021

Copy link
Copy Markdown
Member

WOOOOOOOOOOOOOOOO 🎉 🎉 🎉

@hackergrrl hackergrrl changed the title [DRAFT] Private messages Private messages Apr 13, 2021
@ralphtheninja ralphtheninja deleted the private-messages branch September 20, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants