IPFS Technical Analysis

  • First, what IPFS that?

Star file system IPFS (Inter-Planetary File System) is a globally oriented, peer to peer distributed version of the file system, to create a lasting and distributed file storage and sharing of network transport protocols. The goal is to supplement (or even replace) the current Hypertext Transfer Protocol (HTTP) Internet rule, all computing devices connected together with the same file system.

IPFS simple terms is that one can never exist, a plurality of nodes and there is no centralized file storage and sharing system.

  • Two, IPFS origin

      IPFS is an open source project, developed by the Protocol Labs began in 2014 with the help of the open source community. It was originally designed by Juan Benet, he set up a laboratory to develop IPFS mind precisely in order to design a protocol to establish a more secure, efficient and open networks. He entered Stanford University, learn computer technology, in research and development of distributed storage network technology.

  • Three, IPFS principle

Principle with content-based alternative addresses based on the address of the domain name, the user is not looking for an address, but the content is stored somewhere, you do not need to verify the identity of the sender, but only need to verify the contents of the hash, so by It allows speed web faster, safer, more robust, more durable.

IPFS files are not normally present on the A node. Slices exist but some other child nodes. Extraction. IPFS a file list of all the nodes in parallel to crawl, and finally makes up a complete locally. Files. Parallel speeds far greater than the direct file download complete files of speed, users will soon be able to get the file locally, you can continue to share it with other people. Distributed storage methods can effectively solve the risk of data loss, while reducing storage pressure of individual databases.

In IPFS, each file and all data is assigned a unique encrypted fingerprint. IPFS duplicate files with the same hash value is deleted via a network, determines which files are redundant after the calculation repeated. And track version history for each file. Each network node stores content only want to store, retrieve information they want. When find the file, find the file through a hash value stored in the network node to change the file, find the file you want. And each node in addition to storing data, it also stores a hash table is used to record the location where the file is stored, the download file facilitates query.

Using IPNS that is decentralized naming system, each file can be named as the name of collaboration readable. You can find the file you want quickly after the search.

IPFS vision is to make all of the network terminal nodes not only plays the role of the browser using Browser or Terminal Client. Everyone involved IPFS, everyone is a network node, everyone can be a server, thus the formation of a decentralized distributed network.

 

When we search / download content, IPFS network system will be from our nearest distance (this is not the physical distance, is the mathematical distance) of a number of storage nodes, chips (not the entire file) to transfer data or files to us, it is several transport nodes simultaneously downloaded to our devices (like P2P, BT technology), very fast. Of course, out of the downloaded file fragmentation from these nodes will eventually be integrated into a complete document presented to us.

IPFS network is a fine-grained, unreliable, distributed, easily combined content delivery network (Content Delivery Network, CDN). This is the difference IPFS and HTTP, the HTTP protocol is traditional downloading the entire file to transfer, download speed is relatively slow on many devices from a single central server.

 

IPFS files uploaded to the network will be divided into several blocks, and that if one of them accidentally damaged, how to do it? Do not worry, IPFS system has a fault tolerance, meaning fault tolerance is assumed that a file is divided into 10 parts, of which four damaged, you can still restore the original files based on the remaining six. So, your files can be permanently stored in IPFS inside the network.

 

  • Four, IPFS mining background

The mining system to give IPFS FIL (Filecoin), Filecoin is stored in a decentralized network, Filecoin two markets: the storage and retrieval of market market, these two markets the same structure but differ in structure.
Filecoin : IPFS the data based on the value of the application, through incentives and economic model similar to Bitcoin, so that more and more people to create nodes, provision of services, to allow more people to use IPFS.. (Service provided is called, it was to provide storage services, was to provide search services, storage and retrieval market market is decentralized to the exchange).

Storage market , the customers pay to the memory of miners, so that it stores data. Retrieving the market , the customer to retrieve data after retrieving the miners pay. (Paid: Filecoin)
storage miners network provides data storage, storage miners by providing disk space and respond to customer requests to participate Filecoin operation.
Retrieving miners network provides data retrieval service to retrieve the miners by providing user data retrieval request required to participate Filecoin operation.
(1) storage miners can serve simultaneously retrieve the miners;
(2) storing the miners need mortgages storage disk space, but you do not need to retrieve the miners.

 

  • Five, IPFS and Http What are the advantages compared to?

IPFS have content-addressable, versioning, distributed hypermedia-point agreement, its goal is to replace the HTTP protocol.

Let me talk about what is HTTP.

HTTP refers to Hypertext Transfer Protocol (English: HyperText Transfer Protocol), computer networks and hypermedia information systems application layer protocol. HTTP is the foundation of data communication of the Internet. But there are still some inevitable shortcomings:

HTTP efficiency is low, the cost of expensive central servers, and rely backbone, files and data easily lost, network attacks and security issues such as frequent.

Specifically, the resulting efficiency is very low in the center of the http protocol, and the cost is also high. By using HTTP protocol every time you need a complete centralized server to download files from (web, video, pictures, etc.), slow and inefficient. If you use P2P download way, you can save nearly 60% of the bandwidth. P2P file divided into small blocks, downloaded from multiple servers at the same time, very fast.

Another is the web files are often deleted. We may encounter in the course of the Internet, the collection of a page, the browser will display the web page 404 when in use. And now web storage costs are very high, time is up to 100 days. So often you will find web files are deleted. . IPFS provides (like the git version control tools as) historical versions of files back function, you can easily view historical versions of files, data can be stored permanently

IPFS goal is to replace the traditional HTTP, you can use IPFS What benefits?

(1) a cosmic library, file data storage humans

       IPFS is a distributed storage network, whether it is text, pictures, music, video, etc., can become storage resources. For you, the equivalent of an infinite network disk space for the business enterprise, too, vast amounts of data can be stored. Further, they can open the file address, the address can be shared. Because it is distributed storage, your documents and data will not be lost.

(2) your files safe you call the shots

  • In IPFS system, files and data unique exists, a file on the IPFS network, the content will impart a unique encrypted hash value based on the calculated. IPFS means that after the operation generated hash addresses are unique. This address can not be altered, nor characteristic deleted. Thus, once data is stored in the IPFS, it will be complete. The traditional HTTP network, hackers can attack you, steal your files. In IPFS network, all files and data are dispersed over many nodes, and are encrypted, there is no way a hacker attack.
  • For files, only you have the private key of your hand, is unique, you have complete control over their own file security. In a traditional network, such as the payment of a sum stored in a wallet, in fact, your password and account is in the center of the server, not just a person you know account password, of course, general formal payment wallet will not risking arbitrary legal risks open your password, but once the server platform or paralysis attack, all your information is likely to be stolen. The IPFS is a good solution to these problems and ensure the security of files and data.

(3) do not have to spend more money, better network use

I.e. P2P data transmission by way point to point transmission IPFS can save 60% of the cost of bandwidth. In the traditional center of the network, server costs are enormous.

Meanwhile, IPFS there are duplicate file detection mechanism, resource redundancy problem does not arise. The traditional HTTP movie will be stored repeatedly, resulting in a great waste of network resources.

(4) as the block chain infrastructure

There is a data capacity issues block chain project, IPFS can seamlessly with whom, as the infrastructure exists.

  • Six, the IPNS naming system

If we want to query the file or information you want on the IPFS network, just enter the corresponding hash value, you can retrieve the file. Since this is a global network unique hash value, query up very fast.

However, if the hash values ​​to distinguish file, I do have to remember that much of the hash value of a string? A hash value, but there are 64 numbers the letters ah, remember much trouble ah. If I build on a site that IPFS network, generate a hash value of such a complex, which is not conducive to the promotion ah, can also cause difficulties in communication.

In fact, of course not. Because the hash value is not easy to remember, just not as easy to remember IP addresses. So Protocol Labs laboratory protocol came up IPNS (InterPlanetary Name System), IPFS domain naming system, so, IPFS IPNS can use the hash value mapped easy to remember name.

Workflow example with a speech of IPFS

For example, I want to watch a video called ABC's:

1. Add files IPFS network, the network of search called ABC (ABC is mapped by IPNS come the name).

2. IPFS network quickly index hash value on the block chain, feedback out of search results.

3. You pay a little Filecoin token, access to the local file cache ABC, ABC file is not downloaded from the cloud server or above, but the contribution by the participants IPFS network, it could be your nearest network node. The advantage is that, not only without intermediate servers, and network transmission efficiency is the fastest.

4. If ABC file happens to have several people around you, that IPFS network will put this file split into a small piece of a small piece, saving storage costs of these nodes, but also allows you to download the video in the most efficient way.

5. The ABC video files cached on your own computer, you can not only watch, but also provide resources for other people need to ABC this video.

6. In addition, you can also post their own new content to the network, and have access to Filecoin tokens, because you have made contributions to the network.

In this way, the entire network to achieve optimal efficiency of the use of documents.

  •  Seven scenarios
  •  

    IPFS technology-based applications has been more and more, there are already many successful projects, from the data stored in the file transfer, from social media to the sale and purchase transactions, these APP, applications, platforms, is restructuring the entire Internet. In the figure above, this project is the underlying protocol IPFS interstellar file system Daquan. Some of it using a variety of protocol stacks, worthy of our attention.

    1.Filecoin: IPFS is based on distributed storage block chain project, is IPFS official team development projects. IPFS can exist independently and is Filecoin IPFS stimulation layer.

    2.Poseidon: IPFS a network-based centralized, distributed search engine that allows users to quickly retrieve files on IPFS network, to find the required data, and users can also get involved in mining through incentive certificate. Known as the block chain version of Google. Google is the world's largest search engine, but it is centralized. Poseidon supports tagging namely mining, supports dual dig POSC + FILECOIN.

    3.Orbit: is a data platform, in the beginning of the birth IPFS has played its role. Orbit can be developed with a "local area network" anonymous chat network.

    4.Textile: a digital asset platform, Textile Photos is the official development of decentralized version of the album, is committed to replace Instagram.

    5.Peepeth: Peepeth is a distributed social platform, it can be seen as the block chain version of Twitter. Including Ethernet Square V God in per capita use. But I suggest that the platform is more complex registration process, the normal use of some difficulty.

    6.GLOBAL UPLOAD: IPFS is a global file upload, where you can be IPFS Upload the file to the network, access to the hash address. Web site is simple and easy to use. The need for ordinary people, it is a great upload files to IPFS assistant.

    In fact, IPFS technology has been applied to many areas. Is still on the map, you will find IPFS project types, basically covering the current fields. But also we need to pay attention to domestic projects pyramid scheme by the name of IPFS has occurred, or plagiarism IPFS function, and then declared that their projects are more advantageous, and so on and so on, from the beginning is a scam.

 

  • Eight, encrypted storage

(1) HealthWalletStorage IPFS series storage

Reference: http://www.healthwallet.cc/storage.html#storage3

 

(2)

The following diagram simple representation of the workflow IPFS:

 

John intends to upload a PDF document to IPFS: he first put PDF files on computer work area; then, use this command to add IPFS relevant files and documents obtained hash value. After the above action, the PDF file can be accessed on the IPFS above.

 

John is now going to share this PDF to his colleague Mary by IPFS. He just need to get the hash told Mary, then Mary will be able to find what you want, download the document from IPFS above. 

Asymmetric encryption technology allows us to use public key encryption file recipient, then the recipient after IPFS download files from, and then decrypt the private key can be. Even if the evil side made from IPFS this file, can not do anything, because they can not decrypt its contents. Let us re-set at the front of the workflow, the introduction of encryption and decryption process: 

 

 

 

John intends to upload a PDF to IPFS, but only intended to give Mary a person to see. He will put in the work area PDF computer, and then use the public key to encrypt Mary. Then add this file is encrypted using IPFS related commands, and received hash value of the encrypted file. After the above action, the encrypted files can then be accessed in IPFS above. After Mary that hash value, it can be downloaded from IPFS, and with her secret key decrypted original PDF file.

Either party attempt to evil, because there is no key is Mary, so they can not decrypt the file, thus ensuring the security file sharing IPFS above.

 

(3)CarBlock

Reference: http: //www.woshipm.com/blockchain/992480.html

GitHub: https://github.com/zhangerna/carblock

 

(4)textile.photos

Reference: http://www.btb8.com/fil/1810/18253.html

Github:

https://github.com/textileio/photos    https://www.textile.photos/

 

Guess you like

Origin www.cnblogs.com/ccbupt/p/11677919.html