jbenet / jbenet/random-ideas

JRFC 28 - note on DNS and the Web

Open
#28 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
12
PR merge metrics
No merged PRs in 30d

Description

(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:

``` js
// ipfs (objects)
TXT example.com "ipfs=[/path]"

// ipns (names)
TXT example.com "ipns=[/path]"
```

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

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

// ipfs (objects)
TXT example.com "link=/ipfs/[/path]"

// ipns (names)
TXT example.com "link=/ipns/[/path]"

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

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

// bitcoin
TXT example.com "link=/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/"
> IPFS get /ipfs//bar/baz.txt

or

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

or

< TXT foo.com "link=/http//baz.txt"
> HTTP get http:///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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.