So... p2p file sharing over webrtc over nostr is here. This is the PoC.

https://github.com/abh3po/NRTC-File-Sharing

Will share a hosted version that you can seamlessly use soon, we are still better-ing the UI.

Also we might not want to fully commit to a hosted version because I dont want to handle DMCA and CSAM complaints, and i cannot commit to a moderation UI at this moment. We will however try to make the open source code as easy to run as possible.

The Readme is the spec.

Thanks to nostr:nprofile1qyt8wumn8ghj7etyv4hzumn0wd68ytnvv9hxgtcprpmhxue69uhkv6tvw3jhytnwdaehgu3wwa5kuef0qqs2ytd7283uwxdd3vkdc0j0lsshdusrw0esy7m858wxcm5hd77ddkqc0epzd who's shared my excitement about being able to build this and contributed code to help make this real.

Reply to this note

Please Login to reply.

Discussion

Yeah this doesn't look like at all what I was talking about. I was talking about something that would be more for video sharing and streaming, and would enable scaling once more users were watching and hosting copies of the files themselves. This is more like a Nostr based wormhole. Cool though.

But it can enable streaming video sharing, faster than torrents. This is more than a nostr based wormhole, this is like.a cross between Napster and torrents, since you can advertise your files to the network. Kind of like a public seedbox.

You'll see once the UI is up 😛

How does it handle multiple sources?

It doesn't yet, but it can theoretically by hashing the file and indexing the hash.

That will be necessary for video. A sizable video going viral shared from a home connection would quickly cripple the host. You'll need a way to pull chunks from various hosts and assemble them in the client. This is how torrents work, dividing the file into chunks, and hashing the chunks. Then clients can request the needed pieces from any host on demand.

Yes, just told you how it could work.. will get to it in time, I have other work too, im trying my best here 🤣

I'm not sure I understand though, "hash it and index it" is pretty vague.

Say I host a video from my PC. Someone else views it, through a web Interface I'm assuming. What happens on the viewer's end to duplicate the file and contribute to the swarm? Is it automatic, or do they have to download and mirror the file manually?

So when the uploader uploads it the client can hash the file and use a nostr index like h while advertising so that we can search for it with nostr filters.

When someone is viewing a file we can search the network for who else has the same file, and even request for specific chunks from other peers. We're already chunking files in the PoC but its a little finicky.

So the viewer themselves doesn't become part of the swarm? If so that's a missed opportunity for quickly scaling the number of available sources.

Lots of work happening in this vein right now. This from nostr:nprofile1qqsyfhqu9kuu877hhm5j2lkwk5478nuvgza00d3lgmjkkk9px8r57zcprdmhxue69uhhg6r9vehhyetnwshxummnw3erztnrdakj7qgcwaehxw309ahx7um5wgh8xmmkvf5hgtngdaehgtcprfmhxue69uhkvun9v4kxz7fwwdhhvcnfwshxsmmnwshsdsn8sh looks promising too.

https://git.sovbit.dev/enki/torrent-gateway

That can happen too if we also hash chunks and broadcast them, and the viewer accepts that they would be rebroadcasting.

The protocol is simple the client side back breaking work is what will be required to do all this.

It can be the best idea ever, but if no clients integrate it doesn't matter. Even if only *some* major clients don't integrate it's probably a lost cause, because people won't use it due to lower reach. This happens often with Amethyst building in features, but damus & primal are nowhere to be seen.

I wish you luck though.

Thats how protocols work also thats what I like about the spec I've proposed here it can go from something as simple as a wormhole over nostr to a full blown torrent replacement. The clients can chose the complexity they wish to implement. TBH im just going to spec it out and only build out the parts I need for formstr.

The rest I may or may not build upon when I have time.

But the rest is here, waiting to be built upon, if someone wishes to continue.

I know my fair share about clients not adopting my useful specs (polls) 🤣

So now I only build stuff that would atleast be useful for me regardless of other clients adopting it.

Christ, that code is so old. I need to actually commit something again.

🤣

I think nostr:npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr wanted to do something like this, forever, but somehow he just couldn't get around to it. Perhaps too much complexity, for little gain

This looks interesting but what default stun and turn servers are you using? I've tried to get webrtc to work before and it always failed without a TURN server (relay)

If both peers are behind NATs you WOULD need a TURN server. Thats the only way as we understand it, one upgrade that could be done is to fallback to the ToR network if a direct route cannot be established, but that would suck for bandwidth