Ask HN: Why is there no P2P streaming protocol like BitTorrent?

236 points by memet_rush ↗ HN
I've been wondering if anyone knows why there is no P2P protocol for mass live stream content in decent quality? specifically what are the technical limitations or is it mostly that people don't want to get destroyed by media company lawyers? I've searched around for a while and i cant find anything like that that can handle thousands of people streaming. The closest is probably Webrtc and that looks like it can only handle 500~ peers.

I was thinking most people nowaday have at least 30mbps upload and a 1080p stream only needs ~10mbps and 720p needs ~5ish. Also i think it wouldnt have to be live, people would definitely not mind some amount of lag. I was thinking the big O for packets propagating out in the network should be Log(N) since if a master is sharing the content then is connected to 10 slaves, then those connected to 10 other slaves and so on.

The other limitation I could think of is prioritizing who gets the packets first since there's a lot of people with 1gbs connections or >10mbps connections. Also deprioritizing leechers to keep it from degrading the stream.

Does anyone have knowledge on why it isn't a thing still though? it's super easy to find streams on websites but they're all 360p or barely load. I saw the original creator of bittorrent was creating something like this over 10 years ago and seems to be a dead project. Also this is ignoring the huge time commitment it would take to program something like this. I want to know if this is technically possible to have streams of lets say 100,000 people and why or why not.

Just some thoughts, thanks in advance!

230 comments

[ 3.3 ms ] story [ 187 ms ] thread
People have tried to build BitTorrent clients to do this. As far as I know they never took off. The primary problem is you oftentimes don't get people who want to share back or who have firewalls or other connections that don't allow them to share back. So you end up with a few people who end up seeding everything out. The second problem is in order to watch a streaming protocol things need to arrive in order. It is totally possible to do with BitTorrent and request the blocks in the order that you want but you may not always be able to get them in the order you want.

In general people aren't tolerant of lag and spinning circles and other such things when they're trying to watch streaming content. If you're fine with just watching it a little bit later might as well queue it up and left the whole thing down load so it's ready when you're ready.

what about having something reasonable for lag, like 30-60 seconds would that make a big difference or you think it would just eventually degrade too? Also do you think there's any way you can prioritize seeders in such a protocol? like some kind of algorithm that the more you share the more you're prioritized in getting the most up to date packets.

The main reason I would think it would be useful is 1. since streaming sites seem to lose a lot of money and 2. sports streams are really bad, even paid ones. I have dazn and two other sports streaming services and they still lag and are only 720p

With sports streams you specifically want low lag, don’t you? It’s no fun being spoilered by people cheering (or not) next door.
i wouldn't mind a minute of lag tbh if the quality and reliability was better. I'm pay $20 a month for dazn and it still lags and buffers lol
> what about having something reasonable for lag, like 30-60 seconds would that make a big difference or you think it would just eventually degrade too?

I think you would probably need something more in the neighbourhood of 10 minutes to really make a difference. If you could make a stable p2p live streaming app with the number of peers all watching the same stream in the hundreds and only 30 seconds latency, i'd consider that pretty amazing.

> Also do you think there's any way you can prioritize seeders in such a protocol? like some kind of algorithm that the more you share the more you're prioritized in getting the most up to date packets.

If we are talking about a livestream (and not "netflix" type streaming) then i don't think seeders are a thing. You can't seed a file that isn't finished being created yet.

If you mean more generally punishing free-riders, i think that is difficult in a live stream as generally data would be coming in from a different set of peers than the peers you are sending data out to, so its difficult (maybe not impossible) to know who is misbehaving.

Apparently PeerTube can do 10s delay to hundreds (not thousands) of viewers.
stremio works fine and is quite popular.

It's similar to popcorn time that was killed by legal ways so I'd say they did take off.

Stremio smartly avoids being killed by making pirating an optional plugin you have to install from another site so they get deniability.

It works well and save my ass from needing 1000s' of subscriptions.

I was going to cite stremio too, it's far from perfect but it works fine most of the time.
The biggest issue I've seen with these is the networking limitations in a browser - there might be hundreds of seeders for a video and using a normal streaming torrent video player works well, but as torrent clients in the browser need to use WebRTC / WebTorrent, there might be just 0-5 seeders supporting it. I don't see much adoption for WebTorrents before the widely used standard Bittorrent clients support the protocol.
Popcorn Time did this and it worked great. Starting a torrent wasn't instant, but once a buffer was built up, it streamed just fine.

Popcorn Time got taken down pretty hard because they became too popular too fast.

A commercial solution could have a seed server optimized for streaming the initial segments of video files to kickstart the stream, and let basic torrents deal with the rest of the stream.

Popcorn Time still works and used by everyone who cares. It's just not as hyped anymore.
Isn't that what multicast is for?
i guess but im thinking like multicast with the people sharing like bittorrent, just live. so you'd need to factor in people leaving and people leeching
So a multicast like derivative that is peer aware and can redistribute locally any available parts - which would require some sort of caching, which would probably break copyright etc... So perhaps that's the reason why nothing exists. \o/
Multicast doesn't work on the Internet.
You might have a look at Librecast [0] which is a R&D project funded by Horizons Europe NGI0 programme via NLnet, aiming to the bring multicast to the current unicast internet and smoothen the transition of projects that adopt it. A great intro to multicast and Librecast is given in Brett Sheffield's 2020 LinuxConfAU talk "Privacy and Decentralization with Multicast" that is available on Peertube [1].

> To enable multicast on the unicast Internet we start by building an encrypted overlay network using point-to-point links between participating nodes. Once established, our overlay network can run whatever protocols we require, unimpeded by routers and middleboxes and which is resistant to interception, interference and netblocks.

[0] https://www.librecast.net/librecast-strategy-2025.html

[1] https://spectra.video/w/9cBGzMceGAjVfw4eFV78D2

The protocol seems like an excellent idea, but #3365a3 on black for the website text is one of the worst designs for open-source project websites I've seen yet.

Off-topic but I'm impressed with how many potentially revolutionary projects get funding from NLNet.

I had a teacher in uni who was fairly convinced that some kind of intelligent multicast was the solution here.

But after working in ISP for a while I realised that the issue is getting ISP's to use cool protocols is just impossible and everything must be built at higher levels.

looks interesting! surprised something like that never caught on. I looking for something like Twitch basically. It has really good quality and is live. But obviously Twitch is just losing money and using all Amazons resources so I wanted to see if there's a more sustainable p2p approach
What do you mean by never caught on? It's 'live' at https://joinpeertube.org/ where you can either go to https://joinpeertube.org/browse-content and put something into that search form, or limit that search to specific 'instances' under https://joinpeertube.org/instances

Or to get back to your original question: https://docs.joinpeertube.org/use/create-upload-video

edit: Your'e not limited to these addresses, for one there are other instances, for another you can selfhost your own, if your'e into that.

Technically that is one of many possible solutions, 'ready to roll' right now.

addit: Regarding sustainability, and who is behind it, maybe https://framasoft.org/en/ would be of interest?

Linked from there https://framablog.org/2024/12/17/peertube-v7-offer-a-complet...

and

https://framablog.org/2025/04/10/2025-peertube-roadmap/

Thanks! i will just check it out.

I just meant like never caught on as in like it's not super popular, but looks like it's on the come up. would be nice to have a real youtube competitor lol

Yes. It's the typical 'hen & egg' problem. I'm watching there from time to time, and even found some things (independent trance/ambient/goa music) which didn't exist on YT at all! Though the selection is limited, compared to YT or whatever, it's less algorithmic, and because of this you're not forced to use most exaggerated grimacing or clickbaity titles, IF you have no commercial interests and give a shit about ads.

If that's your thing. And you have some sort of presence online elsewhere, then you can link to peertube, no matter which, or selfhosted, without problem.

That's why I pointed you to it. If you need/want the most massive audience, because of platform familarity/network effect, then probably not. At least not now. But someone has to start somehow :)

For massive video distribution, getting acquired by a company with "infinite bandwidth" is the sustainable approach.

Orchestrating p2p realtime video distribution is going to have a lot of problems, and spend VC money until someone acquires you is just a lot easier.

Here's a small list of challenges you'd face:

You'll need to have a pretty good distribution network to handle users who just can't manage to p2p connect.

Figuring out the right amount of user's bandwidth you can use without people getting upset; there's a lot of internet accounts with bandwidth quotas, especially for mobile

Trying to arrange so that users connect to users with the least transmission delays would be needed to reduce overall latency. Between cross oceanic connections having unavoidable latency, the potential of buffer bloat, and having a reasonable jitter buffer, pretty soon you have wild delays and potential rebuffering.

Bandwidth constraints / layer switching is going to be a big challenge; it's one thing when your server can just push the best stream the client can manage, but if you're streaming from a peer and the stream is too big, the peer probably doesn't have a smaller stream to switch to and there's no good way to know if where the bandwidth constraint is ... maybe you should switch to the same stream from someone else or maybe you should switch to a smaller stream. Can you get even packets from one peer and odd packets from another ... should you?

AceStream is P2P, its primary use is to stream pirated live sports though. But looking it up, it seems to have been infected by "blockchain!" geniuses.
It still works without any blockchain and there are dockerfiles and images for using it with CLI only on github. It's closed source through and the UI was a forked version of VLC - it's also been suspected to spread malware - CLI tools look fine through but who knows.

Surprisingly the channels that are available work really well if you just use the mpegts stream.

In a past life I've added a few channels to a tvheadend instance on a VPS. It reliable crashed Kodi watching some channels and I've wondered if it's just broken streams or something more interesting is going on.

If you open the ports and watch popular channels it's easily saturating bandwidth - there is no limit.

I've since stopped using it it's the kind of thing that breaks not often enough to be not useless but often enough to be annoying.

It's IPv4 only and seems to use it's own tracker or at least calls to some URLs for initial peer discovery.

Building something similar as true open source would be great but I guess the usecase is mostly illegal streaming.

Be careful - it's attempting to use upnp to open ports on the router and even if just looking through the lists makes you upload fragments.

Still fascinating tool. It's getting to close to what op is looking for but I think it has scalability issues and everything about it is kind of shady and opaque.

One of the main things that hindered acestream is probably it remaining mostly proprietary. There was an explosion of different bittorrent implementations past the first one, which forced everyone to properly standardise.

I was hopeful about bittorrent-live when that was announced, but they didn't open source that for some reason either.

The only entities that could use such a thing are major streaming platforms, and projects trying to stream copyrighted content without consent.

The former don't want to use it as it degrades their control over the content, and the later don't want to make a new system cause systems that are built on torrents are good enough.

> degrades their control over the content

Encryption (can work with sharing), signatures, fall back to CDN. Control is not an issue.

> torrents are good enough.

Torrents can't do the massive market of livestream, like sports or season finales or reality TV / news. This is the entire point of the question.

> The only entities

And everyone kicked off of YouTube or doesn't want to use big corporations on principal, like Hacker Cons or the open source community.

> Encryption (can work with sharing), signatures, fall back to CDN. Control is not an issue.

And of course if an encryption key gets leaked, you can just rotate it. Since it’s a stream, past content is not as important.

(That said, I don’t think it will help — any DRM can be cracked, and there’s plenty of online TV streaming sites even with the current centralized systems.)

you can stream blockbuster movie which got released yesterday. DRM is important.
"Torrents can't do the massive market of livestream" CAN do, why are we not using them is not technical reason, it is that most people just pay apple tv / netflix and not have to install anything on their computer, and UI / interface is 10000 times better.

or very similar point - i had conversation with some big youtuber and person was confused why he is not more popular with certain demographic. reason was that said demographic was watching on big TV and content he was filming was big head directly in front of camera. so they do not like having 3 feet big head right in front of them... most young people watch things on mobile..

I worked for a company called Streamroot which sold exactly this, and I can tell your first paragraph is indeed correct but the second isn't: we had major streaming platforms as customers when I was there (not global giants like Netflix or YouTube, but big european players like Canal+ or Eurosport) and we also had plenty of warez websites (streaming sport, animes, porn, etc.).

I then left and the company later got acquired by Level 3 so I don't know exactly how it evolved but it's likely that they abandoned the illegal streaming market for reputational reasons and stuck with big players.

> I then left and the company later got acquired by Level 3 so I don't know exactly how it evolved

It just struck me that there are probably plenty of large media companies that use all sorts of proprietary video streaming products for distribution that we've never heard of, simply because the tech isn't available to consumers.

Media companies are generally pretty secretive about their tech (Netflix being the exception to this rule), so there isn't much to be found about this. The piracy community (because, let's be real here) also won't be interested in a non-free (speech and beer) streaming solutions like these. So that's probably why there is just very little public information available.

But if you use paid digital TV products (Eurosport being a perfect example here) then you are probably already using all sorts of P2P streaming protocols you've never heard of.

This tech has been developed several times but ultimately CDNs are now so cheap that P2P is pointless. You can't ignore development cost since it dominates all other costs in this case.
If CDNs are so cheap, why is YouTube insistent that they should get paid for their bandwidth? I already pay for my bandwidth and am quite happy to use it for something like YouTube.

The real reason is centralised architecture gives them control and ability to extract rent.

> why is YouTube insistent that they should get paid for their bandwidth?

What are you talking about?

YouTube has a lot more costs than bandwidth. And a lot of ads and Premium revenue goes to creators.

You are correct. It's about control and money.
There was Joost in 2008, from Skype founders. Skype was originally P2P until Microsoft acquisition and killing this legally questionable feature - need to feed the big brother (: Joost raised ~$50M.

I remember it as it was one of rare apps built in XUL, the same framework as Mozilla apps (Firefox).

https://en.m.wikipedia.org/wiki/Joost

I distinctly remember living alone in my first apartment and trying to use Joost like a TV. It was a dismal experience.
PriitK of Joost/Sykpe was also involved in the original Kazza. I've told previous stories of his involvement in a 1990s MMO spaceship game, where he recreated the original buggy/cheat-filled client (Subspace) and released the now standard replacement (Continuum).
Came to share this too. I used Joost at this time. Got me into watching the world poker tour on the platform and into playing poker and watching other live poker.
Skype's call quality was great when it was P2P. Went downhill when it was no longer on P2P.
I would see that easiest way to bring something like that would be some adaptation of m4u format, just instead of URLs to video it could have URL to torrent/magnet.

one issue I can imagine would be that each part would discover peers independently where assumption that most peers of previous parts should be expected to also have those files.

second idea would be to use ipfs in that way instead of torrent. that would probably have much easier time for reusing peer discovery between parts and also would solve issue when to stop seeding as this is already build in into protocol.

I guess that creating distributed twitch basing on ipfs would be feasible but not sure how many people would like to install ipfs node before that could use that. that's kind of chicken and egg problem, you need a lot of people before this system starts work really well, but to get interest it need to really perform well so people would migrate from twitch like services.

ofc you can use public gateways. afaik cloudflare have public ipfs endpoint that could serve as fallback

I would think that the easiest way would be to not use torrents, because torrents have fixed top-level hashes. Instead, create a new protocol like bittorrent but streaming.
There's iroh.computer which can use a relay/ do direct nat punching.

They use bao hashing which is something that I discovered through them (IIRC) and its really nice.

Could create such a protocol though bittorrent/ipfs is fine

I once wanted to create a website which was just a static website.

and I used some ipfs gateway to push it with my browser and got a link of that static website, all anonymous.

Kind of great tbh.

Shame it's being abused by crypto bros who want to treat it as money.

There are other genuinely useful crypto projects (like Monero for privacy and I don't like the idea of smart contracts)

I really want to tell you the fact that most crypto is scam. These guys first went into crypto and now I am seeing so much crypto + AI.

As someone who genuinely is interested in crypto from a technology (decentralization perspective)

I see transactions as a byproduct not the end result & I see people wanting to earn a quick buck feel really weird.

Also crypto isn't safe. I just think like now its better to correlate as a tech stock though 99% of the time, its run by scams, so absolutely worse.

The technology is still fascinating. But just because the technology is fascinating doesn't mean its valuable. Many people are overselling their stuff.

That being said, I have actually managed to use crypto to create a permanent storage (something like ipfs but its forced to store it forever) , so I think this can be used where anonymity/decentralized is required. But still, this thing could be done without including money in the process as well & crypto is still not as decentralized as one might imagine.

> Shame it's being abused by crypto bros who want to treat it as money.

Iroh contributor here. I don't know what you are referring to. Iroh is just a library to provide direct QUIC connections between devices, even if they are behind a NAT. We don't have any plans doing a blockchain or an ICO or anything like that.

I am not aware of any project called Iroh that is a scam, but if there is, please provide a link here. It's not us.

I know there have been some scammers trying to make a BLAKE3 coin or something, a year ago.

I actually wasn't referring to iroh but rather ipfs / the stratos thing that I mentioned.

My only gripe with iroh currently is that its browser wasm feels too much for me/ I don't want to learn rust.

So I actually wanted to build something that required connectivity and I used nostr because nostr is great for website and not gonna lie ,its awesome as well (but nostr is also riddled with crypto bros :( )

OK, thanks for the clarification.

I have nothing against crypto in principle, but I really don't want Iroh to be associated with crypto scams.

Iroh is just a library for p2p connections. You can use it for crypto, but I would say that the majority of our users are non-crypto(currency).

We will try to make the wasm version easier to use, but if nostr works well for you, go for it! Not the right place if you want to avoid crypto bros though :-)

Haven't used Nostr recently, but isn't it associated with bitcoiners rather than crypto bros? At least it used to be that way.
Build it. Use Go. Maybe nknorg/nnet for P2P. Signed HLS segments. Have Go also serve the web front-end with a WASM web worker. Public nodes can run on a very lightweight VPS/server with an autocert domain. Viewers browser join the swarm with WASM-- this way people can just type in a web address so it's very user friendly but the domain doesn't actually have to serve any data. I would just use a trusted pubkey to sign P2P updates so nodes can block naughty IP addresses. Should get you very friendly user experience, easy node deployment, pretty low latency, and bittorrent level of legal resilience.
Octoshape developed this tech, I believe it was sold to some american tv networks.
> Also i think it wouldnt have to be live, people would definitely not mind some amount of lag.

I work on low latency and live broadcast. The appropriate latency of any video stream is the entire duration of it. Nobody else seems to share this opinion though.

BitTorrent is already a streamable P2P protocol. You just need a client that can prioritize downloading the file parts in order.

It is a thing.

It doesn't work for live streaming without modifications though.
Fair enough.

For live streaming there is WebRTC. It is also a thing.

But its not really p2p in the sense the original poster meant (as in its not an overlay network). Its p2p in the sense that tcp/ip is p2p, not in the sense that bit torrent is.
I believe Popcorn Time worked this way, but I may be wrong. Never dug too deeply into it.
It did.

All of it started with the webtorrent project though. One of the first demos was booting Ubuntu while streaming the incomplete live ISO image, quite impressive for the time.

This is great tech for media files. Currently better than any other. But making it would make those media files very easy to redistribute, and it is hard to change that without loosing the P2Pness goodies.

If Popcorn Time had a synchronized multi-resolution catalog, bandwidth-sensitive auto switch and some paid seed servers, it would be better than any other streaming service (technically speaking).

I would not be surprised if the rise of CG-NAT put another nail in the proverbial coffin of P2P video streaming and related sharing.
The only way this will be possible is if there is widespread adoption of an Internet overlay network similar to Tailscale in its design. Fortunately or unfortunately depending on how you look at it Tailscale is limited to Layer 3 so Multicast doesn't work (it depends on IGMP to function correctly).
Why do you think so?
Why Tailscale? Are you aware of IPv6?
AFAIK IPv6 multicast across the internet is pretty much dead. ISPs seem to block it because of its DDoS potential. They use it themselves of course (very useful for streaming live TV across their private VLANs) but as an outsider you'll have to convince every ISP and backbone provider to trust your multicast stream, which they probably won't.

Tailscale (or any other P2P overlay network) could solve this problem by re-enabling the multicast support that most ISPs block. It's not a terrible idea.

Edit: a comment elsewhere linked https://www.librecast.net/librecast.html which seems to be doing exactly this.

Transit and peering agreements between ISPs typically exclude multicast, meaning packets are dropped at network boundaries.
It is a thing.

For livestreams there's AceStream built on BitTorrent, but I think it's closed-source. They do have some SDK but I never looked into it. It's mostly used by IPTV pirates. I've used it a few times and it's hit-or-miss but when it works well I have been able to watch livestreams in HD/FullHD without cuts. Latency is always very bad though.

Then for video-on-demand there are some web-based ones like PeerTube (FOSS) and I think BitChute? Sadly webtorrent is very limited.

Latency.
Twitch streamers seem to be fine with the 10-60 second latency Twitch adds, depending on how bad their network is performing. Requirements will differ per industry but I don't think latency is a killer necessarily.
Twitch does not add 10-60 seconds of latency. The average latency with default OBS settings is 3-6 seconds.

Source: I worked on the Twitch video system for 6 years.

There are streaming sites on the high-seas that use webtorrent. Interestingly (at least for me), this bypasses firewall based IPS/inspection that looks for bittorrent because it's all https. People use it to stream movies at work lol. Good for them I guess.
There are at least two projects like this for watching anime. I won't name them in this forum but they do exist if you look for them.
A lot of comments mention it has been a thing in various forms through the internet’s brief history. The interesting question is why didn’t it take off—especially when the technology was there.

One possibility as you allude to is licensing. In a P2P streaming model “rights” holders want to collect royalties on content distribution. I’m not sure of a way you could make this feel legal short of abolishing copyright, but if you could build a way to fairly collect royalties, I wonder if you’d make inroads with enforcers. But overall that problem seems to have been solved with ads and subscription fees.

Another data point is that the behemoths decided to serve content digitally. Netflix and Spotify showed up. The reason the general population torrented music is because other than a CD changer, having a digital library was a requirement in order to listen to big playlists of songs on your… Zune. Or iPod. That problem doesn't exist anymore and so the demand dried up. There was also an audiophile scene but afaik with Apple Lossless the demand there has diminished too.

And finally, since people were solving the problem for real, we also entertained big deal solutions to reduce the strain on the network. If you stream P2P your packets take the slow lane. Netflix and other content providers build out hardware colocated with last mile ISPs so that content distribution can happen even more efficiently than in a P2P model.

In short: steaming turned into a real “industry”. Innovators and capitalists threw lots of time and money at the problem. Streaming platforms emerged, for better and for worse. And here we are today, on the cusp of repeating the past because short sighted business mongers have balkanized access with exclusive content libraries for the user numbers.

Peertube does this AFAIk (or they plan to do this)