paritytech / paritytech/web3-storage

Investigate: Bitswap support in the provider for Bulletin interoperability

Open
#390 1 comment 0 reactions 1 assignee View on GitHub

@bkontur is already working on this.

Since Sep 5, 2026.

Dominant language
Rust
Stars
12
Forks
3
Avg merge
2d 2h
Merged PRs (30d)
33

Description

Note: This issue description is AI-generated and needs further triage
and thinking before acting on it. Treat it as a starting point for
discussion, not a finalized plan.

Summary

The provider currently supports HTTP-only data retrieval. This issue proposes
investigating Bitswap support in the provider, reusing the existing Bitswap
implementations from polkadot-sdk (sc-network) and litep2p as much as
possible, rather than writing a new one.

The goal is a shared, content-addressed retrieval plane between the provider
and the Bulletin Chain: a client asks for a CID and any peer holding the data
(Bulletin node or storage provider) can answer.

Motivation

  • Easier migration from Bulletin (e.g. dotNS machinery). If the provider
    serves the same CIDs over the same Bitswap plane as Bulletin, data can be
    replicated and served from either side with no client-side changes and no
    flag day. Rollback is trivial while both sides serve.
  • Coexistence. Bulletin as commitment/authorization tier + provider as
    durability/capacity tier, connected by a single retrieval plane. Bitswap is
    the read-only glue that makes storage location transparent to consumers.
  • Ecosystem compatibility. Bulletin already serves data via Bitswap
    (IPFS/Kubo-compatible), so matching it keeps one client stack working across
    both.

Scope

  1. Reuse assessment
    • polkadot-sdk (sc-network) Bitswap server: how coupled is it to the
      substrate client/block backend? Can the store interface be abstracted so
      the provider plugs in its own storage backend?
    • litep2p Bitswap support: server-side completeness, limits, and whether
      it can be embedded standalone in the provider.
    • Which of the two is the smaller lift, and can needed generalizations be
      upstreamed instead of forked?
  2. Parity with Bulletin parameters
    • Block/message size limits, CID versions/codecs, chunking/DAG parameters
      must match Bulletin's so identical CIDs resolve identically on both sides.
  3. Alternative approach: client-side switch instead of provider-side Bitswap
    • Instead of adding Bitswap to the provider, extend the TrustedApi/HOST
      layer to switch between retrieval transports (Bitswap for Bulletin, HTTP
      for the provider) behind one CID-based interface. Clients get the same
      "resolve CID from wherever it lives" property without any provider
      changes. Evaluate both directions and compare complexity, trust
      implications, and how well each supports gradual migration.

Non-goals

  • Provider discovery mechanics (DHT vs chain-published hints) — assumption to
    be stated in the report, implementation tracked separately.

Deliverables

  • Short report: reuse feasibility (polkadot-sdk vs litep2p), parameter
    parity with Bulletin, and recommendation between provider-side Bitswap vs
    the TrustedApi/HOST transport switch.
  • If provider-side Bitswap looks feasible: small PoC serving a CID also stored
    on Bulletin, with one client retrieving the same CID from either source.

References

  • Bulletin Chain TransactionStorage / Bitswap serving
  • polkadot-sdk sc-network Bitswap implementation
  • litep2p Bitswap protocol support

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.