ipfs / boxo

A set of reference libraries for building IPFS applications and implementations in Go.
https://github.com/ipfs/boxo#readme
Other
181 stars 83 forks source link

bitswap: opportunistic block fetch over /http* #608

Open lidel opened 2 months ago

lidel commented 2 months ago

Posting this early for feasibility feedback. Main use for this would be https://github.com/ipfs/rainbow/issues/125 and fetching from big providers that currently pay high price for supporting bitswap.

TLDR

Instead of making HTTP retrieval an alternative to bitswap sessions, try a simpler approach that makes both systems improve each other in a backward-compatible way instead.

This is a proposal to enhance Bitswap system with ability to do HTTP retrieval of blocks over HTTP instead of libp2p. The opportunistic HTTP retrieval would happen when a peer announces support for it via /http* multiaddr.

Why

Serving data over HTTP is less expensive for multiple reasons (caching, billing), and if IPFS nodes were able to leverage HTTP retrieval ("bitswap over HTTP") instead of "bitswap over libp2p", that would be net positive for the ecosystem.

On the HTTP side:

On the libp2p side:

Together, we have building blocks to implement and ship an incremental improvement to the public IPFS swarm.

Why doing this in bitswap client?

How

Details TBD, posting this to gather feasibility feedback, broad strokes idea is:

Integration gotchas

Chicken and the egg problem: we don't have bitswap peersids that also announce /http* multiaddrs.

How would ecosystem rollout "bitswap with oportunistic HTTP retrieval"?


Feedback welcome.