How to use IPFS (Interplanetary File System) • Benzinga
Web3 has evolved rapidly over the past 18 months, integrating with a wide range of browsers, projects and ecosystems, with stated principles of privacy, anti-censorship, decentralization and ownership. However, the series of changes inherent in the differences between Web3 and Web2 mean that technologies, protocols and ideas that have been kept under “if it ain’t broke, don’t fix it” for nearly 30 years are being replaced fairly quickly. .
One such example is the Interplanetary File System (IPFS), which (in a sense) seeks to replace Hypertext Transfer Protocol (HTTP) by facilitating connectivity between web browsers/applications and web servers.
What is IPFS?
IPFS is a distributed system for storing and accessing various bits of data. The key aspect of IPFS that differentiates it from HTTP and HTTPS is its distributed nature. This concept can be loosely analogous when comparing a proof-of-stake (PoS) blockchain to a traditional bank in the sense that a PoS chain uses a network of distributed validating nodes to validate transactions while a bank has a base centralized data center to which all branches refer. to in order to validate the transactions. Much like a PoS blockchain, IPFS involves a large network of nodes, although these nodes send and receive data packets based on browsing traffic.
IPFS nodes are also similar to peers in a BitTorrent network in that they consist of personal computers that run passively in order to deliver chunks of a larger requested file. This similarity will be discussed later in the article by exploring the technical aspects of how IPFS works.
How to use IPFS for NFTs
In the context of non-fungible tokens (NFTs), IPFS enables the decentralized storage of data to which an NFT points. Decentralization is crucial because centrally storing an NFT’s data allows the creator to retain full control over the images and data an NFT points to, which means a malicious NFT creator could theoretically replace or delete the metadata or images associated with an NFT, drastically changing the value of the NFT, as well as others in the same collection.
Using IPFS to host metadata mitigates this problem by redundantly storing unique hashes that represent immutable data on a network of IPFS nodes, “pinning” services like Pinata and the NFT holder’s local IPFS node, if they choose to do so. Services like nft.storage do this in conjunction with the use of decentralized storage networks like Filecoin.
To view an IPFS link, you can use a public IPFS gateway like IPFS.io or Cloudflare with a non-IPFS browser or the local IPFS node of a native IPFS browser with a CID or using IPFS search or ipfs search engines similar to find the desired content. .
To run an IPFS node, you need external software, either the IPFS desktop application or the IPFS Companion browser extension, which are available for Firefox and Chrome-based browsers, Brave and Opera offering a plug additional semi-native support for IPFS. navigation and accommodation.
What applications use IPFS?
Applications use IPFS over alternative protocols if they are looking to be fully Web3 native and decentralized when it comes to storing assets. Some reasons why a project might want this are covered in the Web3 Fundamentals.
In addition to web browsers like Opera and Brave, which are integrated with IPFS only as a browsing feature, many notable Web3 projects use IPFS to store resources. One such project is Audius, which leverages the decentralized storage and content addressing system offered by IPFS to establish a direct Web3 music streaming service. As mentioned earlier, nft.storage also uses IPFS, albeit in conjunction with Filecoin to provide redundant and decentralized means of saving NFT metadata. This level of integration with Filecoin could potentially carry over to other IPFS integrated projects. Infura also offers an IPFS API which allows applications to use IPFS in a plug-and-play capacity in the future.
How does IPFS work?
IPFS uses cryptographic hashing to provide permanent records – called content identifiers (CIDs) – of the various pieces of a file as they exist at any given time. When an IPFS user searches for a given file, his IPFS node (his personal computer) essentially queries “nearby” nodes that he can interact with (also known as peer nodes) to see if the desired CID is present in any of these peer nodes. . This practice is known as content-based addressing, unlike Web2’s location-based addressing. When the user accesses or downloads the file, their IPFS node caches a copy of the file, becoming another peer that can transmit the content. As with other forms of caching, content may be cleared over time (and may conversely be “pinned”) to preserve a node’s storage space.
If a file stored on IPFS is modified, a separate CID is created for the modified chunks of the file, which means that the original version continues to exist on the IPFS network and the new version contains information indicating that it this is not the original copy. . This fact is the crucial reason why IPFS combats censorship and file tampering by design. A file’s CIDs can be grouped into a singular link using the Interplanetary Name System (IPNS), and a CID can be transformed into a human-readable Domain Name Service (DNS) URL at using DNSLink to replace the hashed key with a .com or .org URL.
IPFS vs Web2 peers
With IPFS having a decent amount of adoption, some direct comparisons can be made between Web2 and the Internet based on IPFS.
The first is Wikipedia, particularly with regard to censorship. When Wikipedia went dark in Turkey in April 2017, IPFS was quick to publish mirrors of the Turkish version of Wikipedia in different languages, circumventing the Turkish government’s court order thanks to full IPFS redundancy, which ensures that mirrors remain accessible if nodes containing them are reachable, regardless of DNS restrictions. Compared to Wikipedia’s normal HTTP configuration, IPFS counters censorship and preserves privacy, but this advantage comes at the expense of speed in regions where both are accessible. This logic can be applied to virtually any web hosting application when comparing IPFS to its Web2 counterparts, including Amazon Web Services (AWS) and Cloudflare.
Next is file sharing in a way similar to Google Drive. IPFS essentially enables a decentralized mode of Google Drive-esque file and directory sharing, which is not subject to cloud storage limits, but is subject to hard disk storage limitations as well as availability limitations of nodes when not using a pinning service or multiple nodes. Additionally, the hashing mechanism in IPFS CIDs provides a tamper protection system that is vaguely similar to the change history on Google Drive, but requires no login.
Why Web3 needs IPFS
Web3 is decentralized by design, and IPFS provides the foundation for this decentralization in a way that is aligned with the ideals of Web3 while providing sustainable scalability as the user base grows in size. Without IPFS, another alternative to HTTP and HTTPS would have to be built with peer-to-peer BitTorrent-esque design, tamper resistance, and human readability once solved. IPFS does all of these things way too well for Web3 to rely on any other protocol on its own. That being said, IPFS isn’t the only core element of Web3, as evidenced by how often Filecoin is implemented alongside IPFS, even though IPFS has some sort of decentralized storage network.