bushi blog Let's all love Lain

Gemini and IPFS

IPFS provides an underlying distributed storage, which allows files and data to be hosted in a decentralized manner. Gemini is a very simple protocol, and while it’s usually centralized from a single server, the .gmi files can easily be hosted on IPFS just like any other file or website. If you’re new to IPFS, be sure to skim through IPFS Concepts Of course, hosting the files is different from serving the files.

Gemini probably couldn’t pull directly from IPFS. Instead, there would need to be a something running between IPFS and the client to properly communicate the protocol.

While a client could just fetch files directly, Gemini still needs to be able to perform transactions and confirm things like TLS. IPFS seems to be primarily accessed through a web browser, so the hosted Gemini files don’t exactly work like they should.

For example: https://ipfs.io/ipfs/QmUAiFm3GfTMQH9HnHhYERLGEHFzZJXPx8Q2JS3crXiPGD This is the Gemini folder for this site, allowing one to see all the files. It sort of behaves like an index, but navigating to any of the pages in a web browser just shows the file, and doesn’t fill in the links (expected): https://ipfs.io/ipfs/QmXpFa5CF3cGwUVDXk3Sq1G5d247frbnCUBEracXXJKzjT?filename=index.gmi .

Instead of both storing and serving content with IPFS for Gemini, it seems that IPFS would only serve as storage, with a Gemini-IPFS proxy(?) acting as the server. Another method might be to add IPFS support to Gemini clients, but then you basically circumvent/throw out all the TLS and certificating, unless the cert is hosted along with the Gemini files…

It’s possible to create a client to read directly from IPFS, but I think that would be expanding the abilities of the client beyond what is needed. I think a better answer would be creating a Gemini server and having IPFS behind that. This also ensures that the files being shared are pinned. Just like how there are HTTP -> IPFS gateways, and HTTP -> Gemini gateways, a Gemini -> IPFS gateway could also be created, or chain them together into Gemini -> Http -> IPFS.

Another thing to consider is updating files and making sure they are available. If the IPFS hosting the node goes down, it’s important that the files are also available somewhere else on the network, which is where pinning services come in. These are services that you post a content address to and they pin the content on their side. This ensures that even if your own node goes down, the files will still be available from the pinning service. Of course, it is best if you also use multiple pinning services, just so there is additional distributed redundancy.

Interacting with IPFS isn’t too difficult, since it is usually done through the daemon instead of interacting with the network directly. I want to do more investigating, but my thinking is it wouldn’t/shouldn’t be too difficult to create simple “glue code” that allows other protocols to easily take advantage of IPFS storage without needing to be aware of it.

Home About Crypto Webring Links SitemapRSS|EmailMastodon