AgregoreWeb / agregore-browser

A minimal browser for the distributed web (Desktop version)
https://www.youtube.com/watch?v=TnYKvOQB0ts&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=14
GNU Affero General Public License v3.0
715 stars 66 forks source link

Replace petnames in hostname with explicit key creation #191

Closed RangerMauve closed 1 year ago

RangerMauve commented 2 years ago

At the moment a bunch of Agregore's protocol handlers support "petnames" where you can make up a custom name and place it in the hostname of a p2p protocol to generate a custom keypair with an alias.

e.g. hyper://example will generate a hyper://PUBLIC_KEY url under the hood from example and your master key. This is useful for auto-generating websites just by navigating to a URL, but it will conflict with situations where hyper://example might be a valid DNS name for something like Handshake and is somewhat blocking adoption of #77

In js-ipfs-fetch we solved this by using POST ipns://localhost?key=KEY_NAME which will return a ipns://PUBLIC_KEY_HERE URL. Similarly you can resolve an existing key with GET ipns://localhost/?key=KEY_NAME.

I've started tracking this for hypercore-fetch here: https://github.com/RangerMauve/hypercore-fetch/issues/29

Should also adopt it for mutable torrents in bt-fetch

RangerMauve commented 1 year ago

We've got this for hypercore. You can also use GET hyper://localhost?key=KEY_NAME to get the full URL and POST hyper://localhost?key=KEY_NAME to create a new key. It will error out if you try to GET a key that hasn't been created.

Still need to figure out for mutable torrents I think.

RangerMauve commented 1 year ago

This is the case now in version 2.0+ :)