Open Winterhuman opened 2 years ago
Resolving TXT records does not happen in web browsers. Nor there is any API for that, even WebExtensions are lacking this capability (Firefox bug from 2018, chromium is even worse because it has no DNS API at all).
This means TXT resolution is possible only when native IPFS node/support is involved (e.g. go-ipfs, Brave). And this occurs only when a DNSLink website or a Public Gateway URL (see is-ipfs) is redirected to a local IPFS node.
Due to this, I don't think this will provide way to "passively discover bootstrappers". Instead, we are looking into saving all discovered peers across restarts – see wip work in https://github.com/ipfs/go-ipfs/pull/8856
I think that is still useful: we can leverage DNSAddr as alternative content routing method to speed up DNSLink website load times by immediatelly getting peers providing the data.
IPFS node that tries to resolve /ipns/en.wikipedia-on-ipfs.org
would
dnslink=/ipfs/{cid}
(latest snapshot)DNSAddr would also provide value for Services that expose Gateway, but do not announce data on DHT (such as some Pinning Services, that provide their own Gateway).
Web browser with IPFS support (Brave, ipfs-companion) could detect DNSAddr records present on their public gateway domain name, and preconnect to dnsaddr peers that provide the data, allowing for the content to load from local node just fine.
I included DNSaddr section in DNSLINK_GATEWAY.md in https://github.com/ipfs/specs/pull/283 – feedback appreciated!
@lidel Assuming https://github.com/ipfs/specs/pull/296 goes through, could we potentially allow exporting TXT records as well in order to get around needing an API from the browser? That way, the TXT records can be fetched from IPFS with DNSSEC allowing the records to be authenticated
Including DNSAddr DNSSEC chain of trust proofs is a good idea. I've added below to my review:
- Fetch DNSSEC proof for both DNSLink and DNSAddr
- DNSAddr TXT records work the same as DNSLink ones, but for peer routing. They are optional, but their presence allows fast recovery when HTTP is down, skipping DHT lookup and opportunistically doing bitswap with trusted provider endpoint etc.
Related: https://github.com/ipfs/go-ipfs/issues/3926
Browsers have a few properties that can be exploited for use by IPFS:
dnsaddr=/ip4/1.2.3.4/tcp/567/p2p/PeerID
so/dnsaddr/domain.tld
can function.This puts browsers in a unique position, browsers naturally discover many websites and thus many potential bootstrap nodes just from user behaviour, I propose encouraging browsers to exploit this behaviour to benefit IPFS bootstraping. Here's an example scenario to demonstrate:
https://website.tld
in their browser, this website happens to have TXT records which contain DNSAddr values.https://website.tld
's DNSAddr values should be saved._dnsaddr.website.tld
to it's own bootstrap list.This system provides resilience to bootstrap downtime and censorship by expanding the bootstrap list to include a wide selection of trusted entities, this also has the potential to reduce latency by contacting bootstraps which are geographically closer.