bitswap: opportunistic block fetch over /http* #608
Labels
need/triage
Needs initial labeling and prioritization
topic/bitswap
topic/gateway
Issues related to HTTP Gateway
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:
application/vnd.ipld.raw
On the libp2p side:
/http*
multiaddrs are ignored by existing clients, and shoudl be future-proof thanks to libp2p HTTP spec (spec itself being backward-compatible with plain HTTP trustless gateways being mounted on/ipfs
).Together, we have building blocks to implement and ship an incremental improvement to the public IPFS swarm.
Why doing this in bitswap client?
Evolution over revolution.
Ease of adoption
Ease of implementation
How
Details TBD, posting this to gather feasibility feedback, broad strokes idea is:
/http*
multiaddr (bitswap over HTTP), and notify just like when it would be fetched over libp2p.boxo/bitswap/options.go
:boxo/bitswap
, and other GO-based implementations like Kubo would get it as well.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"?
AppendAnnounce
could be where providers add/http*
multiaddr pointing at their trustless gateway, and bitswap clients could pick this up via peer routing. This is one-line config change providers do to signal they prefer clients to use HTTP retrievalQmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC
listening at/dns4/elastic.dag.house/tcp/443/wss
QmUA9D3H7HeCYsirB3KmPSvZh3dNXMZas6Lwgr4fv1HTTp
which has multiaddr/dns4/dag.w3s.link/tcp/443/https
HTTp
peerids? At minimum, we could ask web3.storage to start announcing/dns4/dag.w3s.link/tcp/443/https
under bitswap peerQmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC
, making their announcements compatible with this proposal.Feedback welcome.
The text was updated successfully, but these errors were encountered: