bittorrent / bittorrent.org

392 stars 101 forks source link

Payments in the BitTorrent protocol #123

Open andrewkerry opened 3 years ago

andrewkerry commented 3 years ago

I'd like to understand what views there are for supporting payments in the BitTorrent protocol.

I personally see enabling payments in the BitTorrent protocol as a way to encourage seeding, discourage leeching, and generally enable peers to e.g. cover bandwidth expenses related to BitTorrent.

My view is that Lightning Network enables peer-to-peer micropayments which could be used for this purpose. I would like to avoid a discussion around currencies or tokens as much as possible but Lightning seems to me to be the most neutral option, as well as technically the most reasonable.

As part of studying this I've written two proof-of-concept implementations of requesting and sending payments over the Lightning Network (modifications to Transmission, and libtorrent/qBittorrent), supporting two different Lightning node implementations (c-lightning and lnd). They seem to work, as proofs-of-concept. It's not very much work technically because most of the heavy lifting is done by the Lightning nodes.

I would be willing to champion this as well but before going there I'd like to understand the general opinion of this community on this topic.

On the protocol specifically, a model similar to some Lightning HTTP middleware might make most sense where a client request is responded to with 402 Payment Requested as well as payment information, client then performs the payment and repeats the request, the server checks the balance for this client and services the request accordingly. In BitTorrent terms, a peer would respond to peer message 6 "request" with a payment request instead of 7 "piece". The payment request could be a BTEP message, the actual payment as well as checking whether the payment request has been serviced would be done using the Lightning Network, and a repeated request would result in 7 "piece" as expected. In practice it seems clients might send multiple requests, receive multiple payment requests, pay all of them, request again, and get the data, which seems to work relatively well.

I'm not an expert neither in the BitTorrent protocol nor Lightning Network so your input on this would be very valuable.

gubatron commented 3 years ago

We've purposefully stayed away from mixing payments and seeding into our client (payment channels was on the table years ago) because we know this will inevitably lead to lots of people being criminally liable for copyright infringement and ending up in prison.

Also, the network has worked just fine without introducing monetary incentives, perhaps adding this will then make people not seed unless they get paid (and end up in a criminal lawsuit), I think it would spoil the spirit of the network.

andrewkerry commented 3 years ago

Thank you for your reply, this is useful.

If you have any links to previous discussions then I'd be grateful (I had searched but couldn't find any).

It's a fair point that introducing payments has the potential to change the spirit of the network (possibly for the worse).

On being criminally liable, I was mostly thinking about legal material, or material the original seeder has created and wants to distribute, and that payments might enable seeders to recoup bandwidth, server and other costs that otherwise would be difficult to recoup. Ideally this would increase the size and utility of the network as people might rather share data via BitTorrent instead of HTTP or centralized platforms (which are typically driven by subscriber or ad revenue). But I agree the combination of copyrighted material and payments is problematic. (Although I'd personally appeal for personal responsibility and suggest seeders not to demand payments if they're sharing copyrighted material - or indeed not share copyrighted material in the first place.)

Still I'd be interested on any further input.

MyrikLD commented 3 weeks ago

I understand correctly that BTT implemented exactly this idea, but a closed implementation? It seems to me that the integration of payment POSSIBILITY into the protocol is currently necessary. This will increase the attractiveness of the network for seeders and content creators. In the BTT implementation, this is presented as an opportunity to increase speed through payment, while maintaining compatibility with free seeders. Lightning integration (or something similar) would allow content creators to receive payment for distributing their content without being tied to the platform and paying a fee. Seeds will be much more motivated to continue seeding. https://www.bittorrent.com/btt/btt-docs/BitTorrent_(BTT)_White_Paper_v0.8.7_Feb_2019.pdf

gubatron commented 2 weeks ago

I wouldn't tie any design to a particular payment tech such as LN (which fails to gain any real traction and is riddled with lots of foundational design issues, not to mention that most bitcoiners want to hodl, perhaps if LN one day supports stablecoins it'd make sense), more likely to succeed with something more generic that can then interface with specific blockchain or L2 solutions, stablecoins on many next generation chains work way better than LN today for very little in fees (USDC/USDT on Solana, Avalanche, Cosmos, etc.)