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

Questions about scalability #20

Open
draeder opened this issue Nov 6, 2020 · 7 comments
Open

Questions about scalability #20

draeder opened this issue Nov 6, 2020 · 7 comments

Comments

@draeder
Copy link

draeder commented Nov 6, 2020

From what I've been reading in your documentation and some of the issues here, P2PT is a fully meshed browser to browser P2P solution. Is that correct to say it is "fully meshed?"

If so, what would occur if 50,000 people suddenly ran your codepen examples? Would everyone's browsers crash? I believe this issue may address that question, but I want to be certain. Apologies if it is a duplicate.

If so, couldn't P2PT be updated to provide a wide "gossip" protocol similar to the way bugout is doing? If possible, it could take this library to the next level and address issues of scalability at the library level and make it more popular and useful.

@therealadityashankar
Copy link
Contributor

yes, yes it would, peerconnections have limits, see #17

@draeder
Copy link
Author

draeder commented Nov 6, 2020

Yes, I already linked to #17 in my question. I have additional questions if the answer is yes.

@therealadityashankar
Copy link
Contributor

therealadityashankar commented Nov 7, 2020

In #17 I mentioned that peer connections have a limit of 256 connections, browsers simply don't allow more connections than that. I'm not sure if browsers would "crash" per say.

I think bugout is doing the exact same thing that this project is doing, although this project allows for "specific" urls, bugout automatically sets them for you.

Yes, P2PT can be used to provide a worldwide "gossip" protocol similar to bugout, although I've some privacy concerns I've mentioned in #9 , I've not been able to fix the code because I haven't found the time, and yes you're right P2PT can be used to do insane things from building a decentralized blockchain to a lot of different stuff

@draeder
Copy link
Author

draeder commented Nov 7, 2020

@therealadityashankar I've been playing with bugout for over a year.. I had to build out URL construction myself. What I thought was great about P2PT is I didn't have to do anything at all. I ran the codepen in two browser tabs, then on my phone using the mobile network and all three were connected together without doing anything special. Bugout was built to simulate server <-> client using P2P, whereas it seems P2PT was built for true fully meshed P2P.

As for the privacy concerns, bugout is using NACL to encrypt communication between peers, if I understand it correctly. I wish I could help with that issue on P2PT, but my javascript fu just isn't at that level yet.

@subins2000
Copy link
Owner

P2PT's original intent is to easily make WebRTC apps making use of WebTorrent trackers which is publicly available for use. P2PT makes WebTorrent trackers not only for torrenting, but for general purpose WebRTC apps.

Anything that's an extension of it is better to be a separate project. That'd be the best choice.

P2PT is a fully meshed browser to browser P2P solution. Is that correct to say it is "fully meshed?"

Yes

If so, what would occur if 50,000 people suddenly ran your codepen examples? Would everyone's browsers crash?

Idk for sure if browsers would crash, but there's a maximum number of peer connection limit in browsers.

As for the privacy concerns, bugout is using NACL to encrypt communication between peers

Even so it also uses public WebTorrent trackers to establist P2P I believe. So, the trust in WebTorrent tracker is equal in both. NACL can be used on top of P2PT to have a more secure messaging, yes.

@draeder
Copy link
Author

draeder commented Nov 9, 2020

@subins2000 - Thank you for the answers. What I would like to build using P2PT is a global "protocol" of sorts for social networking. Based on what you're saying, I would need to figure out how to extend the mesh beyond the browser limits if the network of connected were to grow beyond those limits. I've seen some ideas for that with WebRTC many-to-many live video that I could explore.

Privacy isn't really a concern to me yet, but securing messages from man in the middle attacks is a concern. I would want to make sure if Alice sends a message to Bob, that message is not altered. Signing the message with a public key is probably a way to do it.

Again, I appreciate the info.

@therealadityashankar
Copy link
Contributor

do note that p2pt is crazy heavy as-is, I'd recommend using browser's native subtlecrypto over https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto over NACL

Also, do note public-key authentication does not prevent MITM attacks, in the end of #9 I proposed a solution for this

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

3 participants