GitHub set up

IPFS is now super popular all around the world.Some factions saying that it will fully replace http protocal in the future.Some saying its just another technique like bitTorrent.After reading the white-paper of IPFS I am trying to summarize it,If you have some good ideas or find out that I have some wrong options,please point out to let me know.So

What is IPFS?

The InterPlanetary File System (IPFS) is a peer-to-peer distributed file system that seeks to connect all computing de- vices with the same system of files.
Generally speaking IPFS is a system that :

  1. a single BitTorrent swarm, provides a high-throughput, content-addressed block storage model, with content-addressed hyperlinks.Means every clients can download the file and share it just through a hyperlink.
  2. managed in a git repository,So you can checkout the file in every single version, merge different versions etc.
  3. combines a distributed hash table, an incentivized block ex- change, and a self-certifying namespace.So in this point every nodes of IPFS can exchange blocks and get the rewards.The same thing as Bitcoin mining (pow) or Steemit mining(pos).
  4. It does not has single point of failure, and nodes do not need to trust each other.That because it’s working under Self-Certified Filesystems mode.

Why IPFS works good?

Here I briefly describe the design of IPFS, so we can know it from different aspects.

Identities

every node has a data structure like {NodeId,PublicKey,PrivateKey},upon first connecting, peers exchange public keys, and check: hash(other.PublicKey) equals other.NodeId. If not, the connection is terminated.In this way, nodes do not need to trust each other, just to work following this guideline.

Network

IPFS can use any transport protocol.Here are two examples of peer addressing:

1
2
3
4
5
# an SCTP/IPv4 connection
/ipv4/120.79.186.110/sctp/1234/
# an SCTP/IPv4 connection proxied over TCP/IPv4
/ipv4/120.78.255.14/tcp/5678
/ipv4/120.78.255.14/sctp/1234/

Routing

IPFS nodes require a routing system that can find (a) other peers’ network addresses and (b) peers who can serve particular objects. IPFS achieves this using a DSHT based on S/Kademlia and Coral.different use cases will call for substantially differ- ent routing systems (e.g. DHT in wide network, static HT in local network).Thus the IPFS routing system can be swapped for one that fits users’ needs.

Block Exchange

Data distribution happens by exchanging blocks with peers using a protocol called BitSwap.Like BitTorrent, BitSwap >peers are looking to acquire a set of blocks (want_list), and have another set of blocks to offer in exchange (have_list). Unlike BitTorrent, BitSwap is not limited to the blocks in one torrent. BitSwap operates as a persistent marketplace where node can acquire the blocks they need, regardless of what files those blocks are part of. The blocks could come from completely unrelated files in the filesystem. Nodes come together to barter in the marketplace.

This means everyone can turn on some nodes if has enough band-width and volume.Having more nodes means can offering and requiring more blocks as well as getting more rewards.

Object Merkle DAG

a generalization of the Git data structure. Merkle DAGs provide IPFS many useful properties, including:

  1. Content Addressing: all content is uniquely identified by its multi hash checksum, including links.
  2. Tamper resistance: all content is verified with its checksum. If data is tampered with or corrupted, IPFS detects it.
  3. Deduplication: all objects that hold the exact same content are equal, and only stored once. This is particularly useful with index objects, such as git trees and commits, or common portions of data.

Files

IPFS also defines a set of objects for modeling a versioned filesystem on top of the Merkle DAG. This object model is similar to Git’s:

  1. block: a variable-size block of data.
  2. list: a collection of blocks or other lists.
  3. tree: a collection of blocks, lists, or other trees.
  4. commit: a snapshot in the version history of a tree.
    File object formats below use JSON.

IPNS: Naming and Mutable State

  1. Using the naming scheme from Self-Certified Filesystems gives us a way to construct self-certified names, in a cryptographically assigned global namespace, that are mutable.
  2. As encouraged by SFS, users can link other users’ Ob- jects directly into their own Objects (namespace, home, etc),which is called Peer Links.

IPFS Use Case

IPFS is designed to be used in a number of different ways. Here are just some of the usecases will be pursuing:

  • As a mounted global filesystem, under /ipfs and /ipns. 2. As a mounted personal sync folder that automatically
    versions, publishes, and backs up any writes.
  • As an encrypted file or data sharing system.
  • As a versioned package manager for all software.
  • As the root filesystem of a Virtual Machine.
  • As the boot filesystem of a VM (under a hypervisor).

Some Suggestions or Questions I want to ask~~~

  1. The white paper says that the file hyper link will always valid.Since the IPFS is managed by a git,if that version was deleted ,how can the file hyper link still works?
  2. If some personal privacy informations was pushed onto the IPFS maliciously, Who are supposed to be a moniter or what’s the solution to handle with it? as the git version can always rolled back and could not be erased.
  3. I think IPFS won’t be a substitute of Http, according to the white-paper
    GitHub set up
    This just state that in some large files or real-time media streams situations IPFS might work better,So It might be a supplement for the HTTP which can bring convenients to us.
  4. we need to attend in IPFS making some applications or contributions to let the nodes busy and then more people might join us.If the nodes are too free then the band-with and volume resources will be wasted.

Finally,I think IPFS is a very good protocal and a very impressing conception,Let’s see what it will be.