IPFS Integration - Roadmap and discussion
See original GitHub issueCarried over from https://github.com/brave/browser-laptop/issues/9556
@diasdavid wrote:
Hi there brave team! I’m David, from the IPFS project.
I’m looking into the IPFS integration into the Brave browser and I’m hoping you could clarify some design details, just so that I’m sure I understand how everything is pieced together.
Right now, the most straightforward way is to mimic what WebTorrent did and create an extension. I’ve noticed that it gets its own WebPage, located at https://github.com/brave/browser-laptop/tree/master/js/webtorrent and that this page gets bundled in with WebPack – https://github.com/brave/browser-laptop/blob/master/webpack.config.js#L153-L169 --. I can create something similar, no problem.
- Where do I capture
ipfs://
,dweb://
and evenhttp(s)://ipfs.io/ipfs/
urls so that they get resolved through the IPFS Extension?- How do I create a control panel like the one I see Dashlane/1Password
- Currently, we have full web applications that are hosted and served through IPFS. We can start by just adding IPFS support for download of files but ideally, we would like to see pages be rendered. Any advice on how to hint Brave the content type? Drop it into the dom like it’s 🔥?
Thanks in advance! Super excited to do this 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:36
- Comments:26 (3 by maintainers)
Top GitHub Comments
Notes on bringing IPFS to Brave in 2019
I had a chat with @bbondy about ways we can deliver better IPFS experience in Brave, given where both projects are right now.
Below is a short (well, I tried…) summary of takeaways and low hanging fruits we were able to identify to speed up IPFS integration.
Today: IPFS works in Brave, but UX could be much better
IPFS Companion extension can be installed in Brave from Chrome Store, with some caveats:
http://127.0.0.1:8080/ipfs/
instead ofipfs://
and origin-based security perimeter will be shared by all IPFS websites.Future: how it could work
We want to ship native IPFS support with Brave in 2019. What we mean by that in UX terms is:
MVP:
Ideal:
ipfs://
in location bar (native protocol handler)How to get there?
In 2019 there are two ways to do enable it, each comes with own set of challenges:
(A) Bundling go-ipfs binary with Brave and talking to it via ipfs-companion
ipfs://
scheme in location bar would solve Origin-based security, but requires (currently missing) protocol handler API in WebExtension context(B) Embedded js-ipfs running in ipfs-companion (WebExtension context)
blessed_extension
and gain access to raw socket APIs, which would enable local discovery and p2p transports (see relevant PoC for Firefox: libdweb discovery and transport)ipfs://
scheme in location bar would solve Origin-based security, but requires (currently missing) protocol handler API in WebExtension contextipfs://
and proper protocol handler API, then this is not an issue, as payload can be injected inside of the handler. We already confirmed this approach works in libdweb experiment: protocol handler API.blessed_extension
in Brave, then access tosockets.tcpServer
, enables us to expose js-ipfs HTTP Gateway over a regular TCP port. Not as good as (Fix 1), but as good as Gateway exposed by (go-ipfs) and does not require changes to Brave.Which one is more feasible?
While (A) was the way we planned to integrate in 2018, (B) is self-contained (execution context is limited to ipfs-companion extension), which may be easier to manage, audit and ship today, as IPFS project has a lot of relevant plumbing in place in js-ipfs and ipfs-companion thanks to mozilla/libdweb and other work that happened in recent months.
Shipping Brave-powered js-ipfs node in ipfs-companion being
blessed_extension
(B) may simply take less work.Sidenote: both (A) and (B) can benefit from native Protocol Handler API:
What are the next steps?
IPFS roadmap for bringing IPFS to Brave in 2019 will include (P0 - priority):
blessed_extension
and making use of raw socket APIs for:Note: “Bundling go-ipfs with Brave” is still a possibility, and work done on extension responsible for binary updates may be resumed and used in the future, but we want to see if we can expose HTTP Gateway over
chrome.sockets.tcpServer
. If that is possible, we may be able to ship sooner than later.If js-ipfs approach takes too much time, or (P0/MVP) does not work as expected, we can always focus back on bundling go-ipfs.
Will creators be able to earn Brave Rewards for content distributed over IPFS?
Creators could claim their IPNS by publishing the
brave-payments-verification.txt
under their IPNS. Brave could verify this using a public HTTP gateway such ashttps://cloudflare-ipfs.com/ipns/<id>/.well-known/brave-payments-verification.txt
.The Brave client would have to recognize and attribute time spent on
http://127.0.0.1:8080/ipns/<id>/*
,https://*/ipns/<id>/*
(public gateways),ipns://<id>/*
, anddweb://ipns/*<id>
to a normalized address likeipns://<id>
and handle this in the rewards system.