amethyst icon indicating copy to clipboard operation
amethyst copied to clipboard

Use IPFS for image upload

Open kdunn926 opened this issue 2 years ago • 3 comments

While I was investigating how the image upload was implemented I noticed it depends on imgur. Would there be any interest in trying to use an IPFS get/put integration instead? I'd imagine using something like https://github.com/textileio/android-ipfs-lite.

I'm willing to put in some work to do this. Thoughts?

kdunn926 avatar Feb 02 '23 17:02 kdunn926

Seconded. Distributed file storage like IPFS and torrents would be preferable to centralized storage.

dtrammell avatar Feb 03 '23 19:02 dtrammell

Nice, I would welcome the implementation.

But wouldn't that require that other clients also support IPFS to show the image?

vitorpamplona avatar Feb 03 '23 20:02 vitorpamplona

Yes, like any other integration, clients would have to support the service or protocol that you implement here for them to be interoperable. So far, most clients are enabling support for embedding specific types of URIs, like YouTube videos or Spotify URIs, or HTTP URIs that point to images. This would just be another integration. As more people see the ipfs:// links in their feed, they will probably begin asking their client vendors to support integration.

dtrammell avatar Feb 04 '23 05:02 dtrammell

It could make sense to enable nostr-relays itself to be a storage for large media. All is needed a suitable incentive structure (payments) to make is desireable for node-operators to invest in the resources.

hannpet avatar Feb 05 '23 06:02 hannpet

The preferred route would certainly require other clients to handle IPFS content. An incremental step away from fully-centralized hosting would be to use decentralized storage with a centralized IPFS HTTP gateway (e.g. ipfs.io, cloudflare-ipfs, etc). In that scenario, Amethyst could do the IPFS put but publish the URL to the content from one of the public gateways. Once other clients add support for IPFS, the published URL could be easily switched to ipfs://.

Edit: Adding a cross-link to a Damus discussion about media uploads.

kdunn926 avatar Feb 06 '23 18:02 kdunn926