Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

human-friendly IPNS and private files using blockchain #302

Open
@kashishkhullar

Description

@kashishkhullar

Proposal for improved IPNS

IPFS does not support true human-friendly domain names as we currently use such as www.github.com. IPNS implementation has come close to such domain names but yet I cannot just open my browser and type the link with a hash or a long string of names. I would like to propose a solution that might help in solving this problem and create truly human-friendly names with the help of smart contracts in the blockchain.

Motivation

Blockchain has been used in this proposal since it is decentralized and has no downtime.

Working of IPNS using blockchain:

Following presents the working of this proposal:

  1. A user first enters a link like ipfs://my-fav-file.txt
  2. The browser reads “ipfs://” initial protocol and sends the request to a smart contract with the hash of the file name present in the link as a parameter.
  3. The smart contract contains a mapping that maps file name hashes to their content hashes which gets returned as a response to the browser.
  4. The browser receives the response and redirects the user to the required file using the received hash.

Browser extension

If it is required, this functionality can be added to existing browsers by creating an extension. The extension will:

  1. Interecpt the links
  2. check its protocol
  3. make a call to smart contract
  4. redirect users

Private files on IPNS

A file is private as long as we don’t know the content address and if it is encrypted. To prevent users from accessing the content address of the private file following can be implemented:

working Private files on IPNS:

  1. Instead of the initial “ipfs://” protocol we can call it “ipfsp://” ( ipfs private ) to tell the browser to request private files.
  2. The browser will request a smart contract with the hash of the file name.
  3. The smart contract contains another mapping specifically for holding private hashes.
  4. For a file-name hash, this mapping will return a digital signature which actually is the content hash encrypted using the public key of the creator.
  5. The browser will receive the digital signature, the user will then decrypt it with his/her private key, hence providing us the content address of the file which we can now access.

Mutable addressing

Change in the content of the file changes the link to the file. Using the above-described method, one can update the mapping in the smart contract by providing legitimate proof of ownership and update the new link for the given file name. Since a name will map to a single link, multiple names can be given to a different version of the same file which will be recorded in the smart contract separat HEnceely.

Conclusion

The current system is not yet developed/tested and is a concept. If created, our output would be a human-friendly naming system in which we access files on ipfs via their name. eg: ipfs://my-cat-video.mp4, ipfs://my-cat-video-v2.mp4, ipfs://my-cat-video-v3.mp4 etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Mutable DataNaming, Real-Time updates, IPNS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions