Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forwarding service to ensure messages get delivered when users go offline #2

Open
Geo25rey opened this issue Nov 23, 2020 · 0 comments

Comments

@Geo25rey
Copy link
Owner

Geo25rey commented Nov 23, 2020

Problem

When users aren't subscribed to the IPFS pubsub topic "Mail" and aren't processing each message that is published on the topic, users will never receive those messages that could have been for them.

Potential Solution

  1. User A encrypts a message meant for User B
  2. User A encrypts the already encrypted message for a forwarding server
  3. User A sends the message for the forwarding server
  4. The forwarding server periodically sends the message meant for User B
  5. User B receives the message successfully
  6. User B encrypts the signer (User A) and ID of the received message for the forwarding server and sends it
  7. The forwarding server receives the request and stops sending User A's message to User B on the basis of only User B can figure out User A sent the message using the specific ID given by the forwarding server
  8. The forwarding server signs and encrypts the encrypted message meant for User B and sends that to User A periodically
  9. User A gets confirmation that User B successfully received the message
  10. User A signs and encrypts the encrypted message meant for User B and the ID from the confirmation message and sends it to the forwarding server
  11. The forwarding server stops sending the confirmation message to User A

Pros

  • No intervention from User A after the message is sent
  • User B will always eventually get the message
  • The forwarding server does not know the content of the message
  • The forwarding server does not know who the message is being sent to (unless User B signs the request to stop the forwarding server to stop sending the message)
  • The forwarding server doesn't need to store a lot of data if only the hash for the message from User A to User B is transferred

Cons

  • The forwarding server knows User A is sending a message at a specific time
  • Contributes a lot of network traffic when scaled up
  • CPU intensive when scaled up

General Notes

  • Network bandwidth intensive (depending on forwarding interval)
  • Light storage use
  • Can be compatible with Filecoin storage network

Further Research to be Done

  • Decentralized hashmap (IPLD spec) for mapping users (like User A) to a (IPLD) list of unreceived and unconfirmed messages
  • Decentralized database (orbitdb) instead of hashmap?
  • Does Pubsub inherently cause high network traffic/congestion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant