DEV Community

kamilrashidev
kamilrashidev

Posted on

IPFS (InterPlanetary File System) Explained

1. What is IPFS?

Imagine you have a giant library where everyone can share their books. IPFS is like a giant library for the internet. It helps people store and share files (like books, videos, pictures) all over the world.

2. How is it different from the current internet?

Current Internet (HTTP): When you want to see a webpage or watch a video, your computer asks a specific server (a big computer) for the file. This is like asking one specific library for a book.

IPFS: Instead of asking one place for the file, you ask everyone who has it. It’s like asking all your friends if they have the book you want. If they do, they share it with you.

3. How does IPFS find files?

Unique Address: Every file in IPFS gets a unique address called a hash (a string of letters and numbers). It’s like a special code that represents that file.

Content-Based: In IPFS, you find files based on their content, not where they are stored. If you have the hash code, you can find the file no matter who has it.

4. How do you add files to IPFS?

Put the File in IPFS: You add your file (like a picture or a video) to IPFS. It gets broken into smaller pieces, and each piece gets a hash code.

Get a Hash Code: IPFS gives you a hash code for your file.

This hash code is like the file’s unique address.

Share the Hash Code: If you want to share your file with friends, you give them the hash code. They can use this code to get the file from IPFS.

5. How do you get files from IPFS?

Ask for the File: You use the hash code to ask IPFS for the file.

Find the File: IPFS finds people (nodes) who have the file and asks them for the pieces.

Download the File: Your computer collects all the pieces and puts them back together to give you the file.

6. Why is IPFS cool?

Decentralized: No single server can control or censor the files. It’s like everyone sharing their books with each other.
Faster: Files can come from many sources at once, so downloads can be faster, especially if lots of people have the file.

Permanent: Files can stay available as long as someone is sharing them. Even if the original uploader goes away, others can still have the file.

7. How do you use IPFS?

IPFS Software: You need to install IPFS software on your computer. This software helps you add and get files from IPFS.
IPFS Network: Your computer becomes part of the IPFS network, sharing and receiving files with other computers.

8. A Simple Example

Adding a File: You have a picture of your cat. You add it to IPFS, and it gets a hash code like QmXyZ....
Sharing the File: You give your friend the hash code QmXyZ.... They use this code to get the picture from IPFS.
Getting the File: Your friend’s computer asks the IPFS network for the file with the hash code QmXyZ.... The network finds the file and sends it to your friend.

9. Key Terms

Node: A computer connected to the IPFS network.
Hash Code: A unique address for a file in IPFS.
Decentralized: Not controlled by one single place; shared among many.

10. Summary

IPFS is like a big library for the internet.
Files are found by their content, not location.
You can add, share, and get files using unique hash codes.
It’s faster, more reliable, and more free than the current internet.

Top comments (0)