Roger
InterPlanetary File System
⠂ IPFS is a protocol designed to create a permanent and decentralized
method of storing and sharing files
⠂ Faster, safer and more open web
⠂ IPFS aims to replace HTTP and build a better web for all of us
2
Network Topology
⠂ Centralised
� Single server
� Difficult to scale
� Single point of failure
⠂ Decentralised
� Multiple servers
� Demand and failures better
handled
� Expensive
3
IPFS Topology
⠂ Fully distributed network
⠂ Acts both server and client
4
The web of tomorrow needs IPFS today
5
HTTP is inefficient and expensive
⠂ HTTP downloads a file from a
single computer at a time,
instead of getting pieces from
multiple computers
simultaneously.
⠂ IPFS makes it possible to
distribute high volumes of data
with high efficiency
6
Humanity's history is deleted daily
⠂ The average lifespan of a web
page is 100 days.
⠂ IPFS provides historic
versioning (like git) and makes
it simple to set up resilient
networks for mirroring of data.
7
The web's centralization limits opportunity
⠂ The Internet is a real
accelerator of innovation. But
the increasing consolidation of
control is a threat to that.
⠂ IPFS remains true to the
original vision of the open and
flat web.
8
Our apps are addicted to the backbone
⠂ All trivial compared to
interplanetary networking.
� Developing world
� Offline
� Natural disasters
� Intermittent connections
⠂ IPFS powers the creation of
diversely resilient networks.
9
How IPFS works?
10
11
Application
Naming
MerkleDAG
Exchange
Routing
Network
Web
SFS
Git
BitTorrent
DHT
The Stack
12
Application
Naming
MerkleDAG
Exchange
Routing
Network
Web
SFS
Git
BitTorrent
DHT
Using the Data
Defining the Data
Moving the Data
IPLD: InterPlanetary Linked Data
⠂ Any data structure can be
represented as a DAG
13
Merkle DAG
14
test_dir
└ bigfile.js
└ hello.txt
└ my_dir
└ my_file.txt
└ testing.txt
Versioned file systems
15
test_dir
└ bigfile.js
└ hello.txt
└ my_dir
└ my_file.txt
└ testing.txt
IPNS: InterPlanetary Name System
⠂ IPNS is a way to add a small amount of mutability to the permanent
immutability that is ipfs.
⠂ Store a reference to an ipfs hash under the namespace of peerID ( public
key hash )
16
/ipns/Qmaaaaaaaaaaa
/ipfs/Qmbbbbbbbbbbbb/website_hash
Demo
17
Demo: Add / Cat / List files
18
# add / download single file
> ipfs add/get <FILE_PATH>
# cat file
> ipfs cat <FILE_HASH>
# add / download folder
> ipfs add/get -r <FOLDER_PATH>
# list folder
> ipfs ls -v <FOLDER_HASH>
Demo: Large file ( > 256 KB)
19
# add / download large file
> ipfs add/get <FILE_PATH>
# get links of large file
> ipfs object get <FILE_HASH>
Demo: Pinning
20
# 1. add file
# 2. pin operating
> ipfs pin ls --type=all
# 3. remove cache
> ipfs pin rm -r <FILE_HASH>
# 4. remove cache
> ipfs repo gc
Demo: Playing videos
21
# add mp4 file
> ipfs add test.mp4
# playing video using browser
https://ipfs.io/ipfs/<VIDEO_HASH>
http://localhost:8080/ipfs/<VIDEO_HASH>
Demo: Git, even more distributed
22
# git clone (ex: bitmarklib)
> git clone --bare https://github.com/bitmark-inc/go-
bitmarklib.git
> cd go-bitmarklib
> git update-server-info
# add git repo to IPFS
> ipfs add -r .
# try it
> git clone https://ipfs.io/ipfs/<GIT_HASH>
Demo: Inter-Planetary Naming System (IPNS)
23
# add file
# publish to the network
> ipfs name publish <FILE_HASH>
Published to <your peer ID>: <that hash>
# resolve
> ipfs name resolve <PEER_ID>
# try it
https://ipfs.io/ipns/<PEER_ID>
Demo: IPFS for websites
24
# 1. add website
> ipfs add -r <WEBSITE_FOLDER>
# 2. publish to the network
> ipfs name publish <WEBSITE_HASH>
# 3. try it
https://ipfs.io/ipns/<PEER_ID>
https://gateway.ipfs.io/ipns/<PEER_ID>
Appendix
25
Appendix
26
⠂ Large file ─ 3.77 TB
� https://gateway.ipfsstore.it:8443/ipfs/QmXd2t4WbhpDf643ija6byLE4q3L8GBQ
3u773wWh5zVRT4
⠂ Filecoin
� $200 Million In 60 Minutes ( 257 million raised )
Thanks!
Any Quesions?
27

Ipfs

  • 1.
  • 2.
    InterPlanetary File System ⠂IPFS is a protocol designed to create a permanent and decentralized method of storing and sharing files ⠂ Faster, safer and more open web ⠂ IPFS aims to replace HTTP and build a better web for all of us 2
  • 3.
    Network Topology ⠂ Centralised �Single server � Difficult to scale � Single point of failure ⠂ Decentralised � Multiple servers � Demand and failures better handled � Expensive 3
  • 4.
    IPFS Topology ⠂ Fullydistributed network ⠂ Acts both server and client 4
  • 5.
    The web oftomorrow needs IPFS today 5
  • 6.
    HTTP is inefficientand expensive ⠂ HTTP downloads a file from a single computer at a time, instead of getting pieces from multiple computers simultaneously. ⠂ IPFS makes it possible to distribute high volumes of data with high efficiency 6
  • 7.
    Humanity's history isdeleted daily ⠂ The average lifespan of a web page is 100 days. ⠂ IPFS provides historic versioning (like git) and makes it simple to set up resilient networks for mirroring of data. 7
  • 8.
    The web's centralizationlimits opportunity ⠂ The Internet is a real accelerator of innovation. But the increasing consolidation of control is a threat to that. ⠂ IPFS remains true to the original vision of the open and flat web. 8
  • 9.
    Our apps areaddicted to the backbone ⠂ All trivial compared to interplanetary networking. � Developing world � Offline � Natural disasters � Intermittent connections ⠂ IPFS powers the creation of diversely resilient networks. 9
  • 10.
  • 11.
  • 12.
  • 13.
    IPLD: InterPlanetary LinkedData ⠂ Any data structure can be represented as a DAG 13
  • 14.
    Merkle DAG 14 test_dir └ bigfile.js └hello.txt └ my_dir └ my_file.txt └ testing.txt
  • 15.
    Versioned file systems 15 test_dir └bigfile.js └ hello.txt └ my_dir └ my_file.txt └ testing.txt
  • 16.
    IPNS: InterPlanetary NameSystem ⠂ IPNS is a way to add a small amount of mutability to the permanent immutability that is ipfs. ⠂ Store a reference to an ipfs hash under the namespace of peerID ( public key hash ) 16 /ipns/Qmaaaaaaaaaaa /ipfs/Qmbbbbbbbbbbbb/website_hash
  • 17.
  • 18.
    Demo: Add /Cat / List files 18 # add / download single file > ipfs add/get <FILE_PATH> # cat file > ipfs cat <FILE_HASH> # add / download folder > ipfs add/get -r <FOLDER_PATH> # list folder > ipfs ls -v <FOLDER_HASH>
  • 19.
    Demo: Large file( > 256 KB) 19 # add / download large file > ipfs add/get <FILE_PATH> # get links of large file > ipfs object get <FILE_HASH>
  • 20.
    Demo: Pinning 20 # 1.add file # 2. pin operating > ipfs pin ls --type=all # 3. remove cache > ipfs pin rm -r <FILE_HASH> # 4. remove cache > ipfs repo gc
  • 21.
    Demo: Playing videos 21 #add mp4 file > ipfs add test.mp4 # playing video using browser https://ipfs.io/ipfs/<VIDEO_HASH> http://localhost:8080/ipfs/<VIDEO_HASH>
  • 22.
    Demo: Git, evenmore distributed 22 # git clone (ex: bitmarklib) > git clone --bare https://github.com/bitmark-inc/go- bitmarklib.git > cd go-bitmarklib > git update-server-info # add git repo to IPFS > ipfs add -r . # try it > git clone https://ipfs.io/ipfs/<GIT_HASH>
  • 23.
    Demo: Inter-Planetary NamingSystem (IPNS) 23 # add file # publish to the network > ipfs name publish <FILE_HASH> Published to <your peer ID>: <that hash> # resolve > ipfs name resolve <PEER_ID> # try it https://ipfs.io/ipns/<PEER_ID>
  • 24.
    Demo: IPFS forwebsites 24 # 1. add website > ipfs add -r <WEBSITE_FOLDER> # 2. publish to the network > ipfs name publish <WEBSITE_HASH> # 3. try it https://ipfs.io/ipns/<PEER_ID> https://gateway.ipfs.io/ipns/<PEER_ID>
  • 25.
  • 26.
    Appendix 26 ⠂ Large file─ 3.77 TB � https://gateway.ipfsstore.it:8443/ipfs/QmXd2t4WbhpDf643ija6byLE4q3L8GBQ 3u773wWh5zVRT4 ⠂ Filecoin � $200 Million In 60 Minutes ( 257 million raised )
  • 27.

Editor's Notes

  • #3 星際檔案系統(縮寫IPFS)是一個旨在建立持久且分散式儲存和共享檔案的網路傳輸協定。它是一種內容可尋址的對等超媒體分發協定。 什麼是 IPFS ? 直白來說就是 BitTorrent,也是更快速更安全的網頁,未來希望可以取代
  • #4 中心化 單一伺服器、難以擴容、單點故障就會整組壞光光 ======================================================== 非中心化 多伺服器、容錯率提高,但是容易變成單一巨大網路服務公司,就違反http當初設立的中心思想 (ex: google, amazon)
  • #5 分散式網路,每個節點本身就是Server以及Client
  • #7 HTTP一次從一台電腦下載文件,而不是同時從多電腦中獲取文件。 IPFS可以高效率地分發大量的數據
  • #8 IPFS提供歷史版本(如git),並且可以簡單地設置彈性網絡來進行數據鏡像。 因為現在的情況是,只要公司的伺服器關閉,就再也無法取得網頁的任何資料
  • #9 網路集中化會限制許多機會 網路是創新的加速器, 但控制權的日益鞏固是對此的威脅,會造成今日網路被少數幾家巨型公司所掌控。 因此 IPFS 對於開放和平坦的網絡的原始願景是真實的
  • #10 發展中國家。 離線。 自然災害。 間斷連接。 與行星際網絡相比,都是微不足道的。 我們使用的網絡是20世紀。 我們可以做得更好 IPFS為創建具有或不具有互聯網骨干連接性的持久可用性提供了多樣的彈性網絡。
  • #12 dht分散式雜湊表(Distributed Hash Table): 用來找擁有某資料的節點,在不需要伺服器的情況下,每個用戶端負責一個小範圍的路由,並負責儲存一小部分資料,從而實現整個DHT網路的尋址和儲存
  • #17 IPFS哈希代表不可變的數據,這意味著它們是不能被更改的,否則會導致哈希值的變更。這是一件好事,因為它鼓勵數據的持久性,但我們仍然需要一種方法來找到最新的IPFS哈希以表示你的網站。IPFS通過一種​​特殊的功能來實現,即IPNS。 IPNS允許用戶使用一個私有密鑰來對IPFS哈希附加一個引用,使用一個公共密鑰哈希(簡稱pubkeyhash)表示你的網站的最新版本。如果用戶使用過比特幣,可能會對此比較熟悉,一個比特幣地址也是一個pubkeyhash。 如果該鏈接不起作用,不用擔心。能夠通過更改pubkeyhash所指向的內容,而pubkeyhash卻永遠保持不變。這樣,網站的更新問題就得到了解決。 接下來,只需要保證這些網站的位置是人類可讀的,所有問題就解決了。
  • #19 blocks are uninterpreted blobs (ipfs block) and objects are blocks in unifs format. ipfs block --> Manipulate raw IPFS blocks.