Greetings! Iāve been following IPFS for over an year now. Iām very captivated by its idea, which ties into an old fascination with the possibility of turning the internet into a worldwide mesh network free of ISP control. Thank you for your wonderful work, and I eagerly await the day that IPFS is finally a mainstream protocol used everywhere
Onto my question: Iāve been pondering if and how a website fully hosted within IPFS can be coded to offer user support, allowing people to register and create profiles on which they can make changes and upload content. I know some have argued this is a bad idea, because IPFS is mostly good with static content onlyā¦ I do however believe that dynamic websites are equally important and IPFS wonāt get far without supporting them: What can you do with a site where there are no users capable of posting anything?
Although Iām still new to a lot of things, I can see why this is a tricky question with no clear answer: First of all, all files are subject to immutability, meaning that once created they cannot be edited and must be published as new files with new hashes (URLās). Further more, IPFS sites arenāt provided by a web server that can work with specific libraries to modify them in realtime, such as a PHP script reading and writing from / to a MySql databaseā¦ files are offered as they are, only JavaScript running on browsers can do any kind of processing as far as Iām aware.
Considering those harsh limitations, which as far as Iām aware have no solution, Iāve been trying to think of a workaround. The closest thing that comes to mind so far is this:
The user accesses a HTML page on which a button gives them the option to register. Upon clicking this button, a JavaScript function generates two keys: A public and a private key (like SSH). The user is given both keys, and informed that the public one represents their username while the private one acts like a password. At the same time, the JS function generates a JSon database which contains all the settings of this user: Whenever someone views their profile, this JSon file is fetched and the data transposed by their browser into the HTML file. Whenever changes are made to the profile, this JSon file is replaced with a new one containing new entriesā¦ Iām unsure how the site itself can be modified to point to the new file as the userās present configuration, but I assume thatās where IPNS comes in. Lastly, the public and private keys are used to check who the user is whenever they make changes to their profile, similarly to checking that they are logged in: Only if the private key provided matches the public key of the channel do modifications get approved, meaning a new user JSon is generated and the site is modified to point to it.
I assume this is a bit like a person jumping off a roof with cardboard wings and actually hoping they will fly; Iāve never heard of a user management system that works this way, and it feels like a very questionable methodā¦ still it feels borderline possible! I would like to know what you think of this ideaā¦ and if itās indeed a mistake, what alternative ways are there to allow secure user functionality on a dynamic site hosted exclusively in the IPFS cloud? Thank you.