Just another P2P file-sharing system.

Rofi XYZ
3 min readApr 28, 2021

--

When it comes to Peer-Peer file sharing, it means no intermediary exists, commonly known as a signaling server. We’ve always been sharing files through platforms like Dropbox, Google Drive, Microsoft Onedrive, etc.

It was just my curiosity, like when I wanted to transfer the files from either Laptop to Mobile or Mobile to Laptop without the physical cable. I’d always upload the file in Google Drive in a common account then download it again. It’s a hassle, I know. Also, it’s like 3x work if I had the physical cable when it comes to larger files.

The normal network speed provided by the ISP in my area is ~30MBps, but only God knows it’s like 10MBps per second in terms of speed.

There’s no match to USB 3.0 transfer speed for file transfer through the internet since we’re limited to a max 60MBps network speed for daily use.

https://giphy.com/gifs/satisfying-screen-loading-RHEqKwRZDwFKE

But something is better than nothing, so the normal bandwidth of Web Sockets or WebRTC for file transfer is much better than uploading to drive first and download again and be bored in a period of transition.

Fig: Project Architecture

In this project, I’m trying to create an environment where User A can anonymously transfer files to User B with both user's consent.

A transfer is done through the Room created in Web Socket.

Room name is created in a way where it’s encrypted first with User B's public key address, and when receiving it, the public key address of the receiver is verified then transfer starts. So, any third user can not receive the file.

When the peer-peer file transfer is in the process, but any circumstance disconnects the receiver party. On both user consent, the file can be uploaded in IPFS and is tracked with TxHash, and the file can be retrieved anytime and can be downloaded anytime.

If users don’t want to upload in IPFS, then there must be a way like 40% of buffer data is in receiver storage, so only what should download 60% for better performance, transfer speed, and less storage.

Consider sender is disconnected, so receiver for X% of data then they must continue from 100-X%.

In P2P file transfer between only 2 parties, a bottleneck must not occur theoretically. Still, it may occur in the future as a suggestion Node Clustering in server and Load Balancing in sockets.

The project will be done using React.js on the frontend, Node.js, Socket.io on the backend. IPFS is already available. We need to follow the API documentation. I’ll be adding code snippets as well after I’m done with the project.

Fig: Just Share Flowchart

Suppose you want to peek into MV Prototype visit: https://www.behance.net/gallery/118530837/Just-Share. An overview prototype is provided below.

Fig: MV Prototype

I’ll be explaining in-depth in my upcoming light paper.

--

--