Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JRFC 28 - note on DNS and the Web #28

Open
jbenet opened this issue Oct 13, 2014 · 3 comments
Open

JRFC 28 - note on DNS and the Web #28

jbenet opened this issue Oct 13, 2014 · 3 comments

Comments

@jbenet
Copy link
Owner

jbenet commented Oct 13, 2014

(Originally posted at https://gist.github.com/jbenet/ca4f31dfbaec7c8ce9a8)

note on DNS and the Web

DISCLAIMER: I have not done any review of other systems that already do this. I'm sure there are many, as this is a trivial extension. Further disclaimer: I also dislike DNS, and this note should not be taken to mean otherwise.

DNS is used mostly to map names to IP Addresses and other protocol-specific resources. IPFS will use a TXT record to map to objects or names:

// ipfs (objects)
TXT  example.com  "ipfs=<hash-of-object>[/path]"

// ipns (names)
TXT  example.com  "ipns=<hash-of-publickey>[/path]"

But perhaps much better to use a general, protocol agnostic link:

// format
TXT  example.com  "link=/path/to/resource"

// ipfs (objects)
TXT  example.com  "link=/ipfs/<hash-of-object>[/path]"

// ipns (names)
TXT  example.com  "link=/ipns/<hash-of-publickey>[/path]"

// http
TXT  example.com  "link=/http/<hostname>[/path]"

// bittorrent
TXT  example.com  "link=/bittorrent/<infohash>[/piece]"

// bitcoin
TXT  example.com  "link=/bitcoin/address/<bitcoin-address>"

The key can be link or dnsweb or whatever isn't taken.

This way path file systems can use dns in its paths without locking users into one protocol. I.e. http uses dns, but it's in an http-only context:

consider http://foo.com/bar/baz.txt

> DNS resolve A foo.com 
< A foo.com 10.20.30.40

> HTTP get http://10.20.30.40:80/bar/baz.txt
< ...

But with these links, we could use dns to reference other protocols easily, and make the web cross protocol boundaries seamlessly.

consider /ipns/foo.com/bar/baz.txt

> IPNS "foo.com" is a DNS name, thus resolve with DNS
> DNS resolve TXT (link) foo.com

< TXT foo.com "link=/ipfs/<hash-of-foo>"
> IPFS get /ipfs/<hash-of-foo>/bar/baz.txt

or

< TXT foo.com "link=/bittorrent/<foo-infohash>"
> BitTorrent get <foo-infohash>/bar/baz.txt

or 

< TXT foo.com "link=/http/<bar.com>/baz.txt"
> HTTP get http://<bar.com>/baz.txt

fs root

This fits in well with another idea I have, which I'll detail more in the future. The gist of that is to make all root file systems the same, specifying the protocol in the first path component. (Shoving all your local filesystem into /local for now.)

/dns/foo.com/bar/baz.txt
/http/10.20.30.40/bar/baz.txt
/ipfs/abcabcabcbabcacab/bar/baz.txt
/ipns/foo.com/bar/baz.txt
/bittorrent/abbaabababbaabab/bar/baz.txt
/local/foo/bar/baz.txt

And thus all our filesystems would work nicely together. Links would make sense across protocols.

@andrewtj
Copy link

I also dislike DNS, and this note should not be taken to mean otherwise.

Have you expanded on that anywhere?

@jbenet
Copy link
Owner Author

jbenet commented Aug 15, 2015

@andrewtj not yet. i dislike many aspects, but the more egregious one is the registrar system. it's a racket with terrible UX. (also getting endianness backwards). also lack of sigs ...

@jbenet
Copy link
Owner Author

jbenet commented Sep 3, 2015

Update: this is now known (and implemented) as "dnslink=". should make a small tool to resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants