superhero-com / superhero-wallet

Superhero Wallet – More than just a way to receive, store & send tokens on the æternity blockchain
https://wallet.superhero.com
ISC License
39 stars 42 forks source link

Open name.chain as a webpage on IPFS in mobile browser or if extension installed #3019

Open davidyuk opened 1 month ago

davidyuk commented 1 month ago

Since Ceres (https://github.com/aeternity/aeternity/issues/3744), we can set arbitrary data to AENS name pointer value. I propose to intercept opening of name.chain and show a bonded webpage on IPFS.

To do so, we need to define an agreement on how to put an IPFS hash in AENS pointer. For example, a webpage

https://ipfs.io/ipfs/QmW7S5HRLkP4XtPNyT1vQSjP3eRdtZaVtF6FAPvUfduMjA

can be stored in http_target (or http_payload) pointer key as

ipfs://QmW7S5HRLkP4XtPNyT1vQSjP3eRdtZaVtF6FAPvUfduMjA
// in general, ipfs://<hash>/<path>#<anchor>

Also, SW can redirect browser to http_target if it starts with http[s]://. For example, opening name.chain may explicitly redirect to https://name.com. Consider adding superhero_ prefix to the pointer key because it probably won't be a final standard.

Obviously, name owner would be able to update website content by changing http_target value.

An IPFS website ideally should be displayed on a separate domain for good-looking URLs in address bar, and to allow using local storage. Checking how Chrome's tor and vpn plugins works may help. Separate domain can be provided by an IPFS gateway, for example https://bafybeidtpkujtj6vlnzjqt24bd5hy5nsh3uucplrqh4bs73mchbhzlnbxu.ipfs.storry.tv/ taken from https://ipfs.github.io/public-gateway-checker/. At least we can make an own gateway that would return IPFS payload by chain name, like name.chain => name.aepps.com 🚀

SW can load IPFS website using public IPFS gateways or their NPM package (decentralised).

nikita-fuchs commented 1 month ago

this is an awesome idea !