Coinmonks
Published in

Coinmonks

IPFS in-depth

First of all, What is IPFS?

First, we need to understand a few concepts :

  • Any peer node can ask their peers, they want a tomato 🍅 content.
  • so, If you do have it, you will give 🍅 to them.
  • Else you can give some metadata about the network to help them find another peer who might have it.
  • Note that each node chooses the resources they want to keep and store.
  • Example: 🍅 will be available on different peers nodes who dedicated resources to store it.
  • A 🥔 exists less in the network. so, only a few nodes will provide it.
  • A gateway is an HTTP interface to an IPFS node.
  • On our gateway, we will allow any user to retrieve arbitrary content from IPFS Network.
  • If a user asks for a 🍅 content, nodes with 🍅 will provide. and the same example goes for the 🥔.
  • Name — the name of the Link.
  • Hash — the hash of the linked IPFS object.
  • Size — the cumulative size of the linked IPFS object

What is happening?

Let’s get our hands dirty, Installation steps :

wget https://dist.ipfs.io/go-ipfs/v0.10.0/go-ipfs_v0.10.0_linux-amd64.tar.gz
tar -xvzf go-ipfs_v0.10.0_linux-amd64.tar.gz
cd go-ipfssudo bash install.sh
ipfs --version
> ipfs version 0.10.0

Creating our first IPFS object

ipfs add ipfs-data -r
ipfs object get QmQG1gw59EhQ1PSTxjYrQuv5xhsWBpqwyH5VuBcVQZCxC6 |jq
graphmd QmbFrXkhkYrgVSTTi6C4GbCofiyuDf2f8tMkxwrnyfHyfD | dot -Tpng > tree.png
ipfs object get QmQkwvTvdtxVt9H51MidmhQJqXDEDSa3roT3Tr6Srso9pG | jq
ipfs cat QmNuDn3azR2mQQZ4e77NU6qwZgJ3dLbV768fPopLGgdGDh > space-part1.jpg

The IPFS Cluster

What is Bitswap?

  • Acquire blocks requested by the client from the network.
  • Send blocks in its possession to other peers who want them.

Misunderstandings!

  • Guaranteed availability
  • Performance
  • Security

Do peers tell what I have?

  • Every IPFS node on the network has a unique public identifier, known as a PeerID.
  • Since PeerIDs are long-lived identities, it’s possible for someone to look up your PeerID in the distributed hash table (DHT) that stores public IPFS metadata.
  • DHT contains metadata about the content that is requested or provided by PeerIDs,

Cost of the IPFS Cluster

  • 3 VMs as nodes
  • Private Load balancer
  • Public Load balancer

Security risks

  • You are trusting the gateway to not alter the CID before delivering it to you. Therefore, we can only recommend running a self-hosted gateway.
  • The gateway may keep a protocol of your connection details and the data you have requested.

Major IPFS Users

  • Cloudflare, runs a distributed web gateway to speed up and secure access to IPFS without the need for a local node.
  • Microsoft ION, The digital identity system is built on Bitcoin and IPFS and its objective is to build a technology that allows creating a secure and scalable digital identity system at a global level.
  • Brave, the search engine uses Origin Protocol and IPFS to host its decentralized merchandise store.
  • Opera para Android has default support for IPFS, allowing mobile users to navigate ipfs: // links to access data on the IPFS network.
  • Wikipedia use IPFS They have developed a mirror of their website, which allows them to access Wikipedia from jurisdictions where it is censored.
  • Filecoin, uses IPFS to create a cooperative storage cloud based on IPFS.

Deploying Kalvad’s Website on IPFS Network

ipfs add -r ./sample_website
added QmaYZE5QQVR3TqQSL5WDcwuxUwBqczbMkmbHeoeNEAumbe sample_website/index.cssadded Qme5TzVW4en8HWP49N9nLHwUkAMhCn6zvWteoknmFDhwJg sample_website/index.htmladded QmThzr7LgYmUz6tfTArJK5tbrtidXSA12ZCL4ESy6HB8P2 sample_website/index.jsadded QmSYDncaMte6GPx5jC7kqeXWnrKsCp4nkLfQXPxiAKtECU sample_website/something.htmladded QmQ6HiGM7ikKgdyVuzfL7VukzaMCyxtNRnsnPu4nTPG9X3 sample_website 1.01 KiB / 1.01 KiB [=================================================] 100.00%

Conclusion

--

--

Coinmonks (http://coinmonks.io/) is a non-profit Crypto Educational Publication. Follow us on Twitter @coinmonks and Our other project —  https://coincodecap.com, Email  — gaurav@coincodecap.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store