Ipfs for react native apps

What is the ipfs official npm one should use for react native apps development.
How much its cost to store ipfs hashes in ethereum main network and how its calculated.
(Attach references if any)

Thanks

npm i ipfs

I assume that if you want to store an IPFS hash in Ethereum then you also want to register a name that resolves to it. I don’t exactly know how blockchain-based DNS work (ENS, Namecoin, Blockstack, …), but I’m pretty sure that if you want to register a name in the blockchain then the price is not flat-rate but it is put in an auction so this is how it is calculated.

Before registering an ENS or Namecoin name to resolve to an IPFS link, think carefully. If you want to store a link to some content that doesn’t change (or that changes every year so that you can update the link only when the name time-to-live expires), then you can store directly in the blockchain the IPFS multihash (for example mywebsite.eth=ipfs://em08W...). But if you want to store a link to content that changes often, like a blog or a wiki, then I suggest you to store an IPNS link instead (for example mywebsite.eth=ipns://em7h1...), because otherwise once your have registered your name you cannot change the link. Yes the lookup time would be around 1 minute (for the first time at least), but the advantage of mutability for links largely overcomes the drawback of long name lookup.

1 Like

Thanks for the update.

How to store user based content on ethereum.
For example,If in my application I need the user to login via public and private keys and store his content ( like profile feed ) on ethereum…this will be user specific.

How it is possible and any suggestions?
What I expect is a completely decentralized application.

If you want to store plain data in the Ethereum blockchain, I don’t think your question is related to IPFS. But if you want to store an IPFS hash then you can do as I told you. Either way, you should ask on a dedicated Ethereum forum for the technicalties on how to store custom data on the Ethereum blockchain.

If the feed of a particular user is stored as a JSON object for example, then I suggest you to store the IPFS hash on Ethereum and store the JSON file on the IPFS network, because this way you have to store far less information on the blockchain. Given that an user feed is prone to be updated often, you should store on Ethereum an IPNS link because this way you can update the file as much as you want. Finally, you could be concerned to store publicly user information like his feed, and rightfully so. The solution to that is to encrypt the file using a secret key known by the user. If this user wants to share his feed to other persons, he can send them his secret key so that he creates a web of trust.