Using IPFS

IPFS or the InterPlanetary File System is a protocol and peer-to-peer network for storing and sharing data in a distributed file system. It's an amazing technology that allows people to share content and "repin" the content to strengthen the bandwith for the file.

An IPFS document is generally accessed by knowing it's file hash and then using an IPFS gateway to load the file. For example here is a link to an IPFS share featuring the music found on the Voyager Golden Record. The file hash for this document is QmaFP38LkSFURqmGsv1TW6ncjuftRrZP8f78RR2Dd4hCGp. By knowing the file hash you can use any IPFS gateway to access this document. For example: https://cloudflare-ipfs.com/ipfs/QmaFP38LkSFURqmGsv1TW6ncjuftRrZP8f78RR2Dd4hCGp/

https://ipfs.io/ipfs/QmaFP38LkSFURqmGsv1TW6ncjuftRrZP8f78RR2Dd4hCGp/

DWEB domains have built-in support for linking directly to IPFS files via Decentraweb's IPFS gateway. A user who has the DWEB Resolver enabled can access the above IPFS file via a normal DWEB domain. Live examples: http://golden.record/ (if you are connected to Goerli Test Resolver) http://goldenrecord.sagan/ (if you are connected to Mainnet Resolver)

Replace all instances of https://dns.decentraweb.org/ with https://dns-goerli.decentraweb.org/ if you'd like to do the steps in Testnet!

  1. Before you start you should know the IPFS Hash of the document you want to link to. You can use a service like https://pinata.cloud/ to upload a file (up to 1GB free) and get an IPFS hash.

  2. Visit https://dns.decentraweb.org/, click "Manage Name" button and click the subdomain you want to link to IPFS.

  3. Decentraweb allows you to use your own Smart Contract Resolver. In most cases you should just use Decentraweb's default by clicking the "Use Decentraweb Resolver" button. This will trigger an on chain transaction.

  4. Once this is complete you will see two new additions on the page for setting (IPFS) "Content" and "DNS records". Click the blue edit button on the "Content" and past in a reference to your IPFS file. For example: ipfs://bafybeifq6kpf3zybrk4dhhmeg7xc2kjlw2l4mhgfjkmmhaj4uszwf7hfse

  5. Save your changes and within 1-minute CONGRATS you should be able to see your IPFS file via your DWEB subdomain. If it doesn't display, ensure you are running the DWEB Resolver.

Last updated