IPFS - Hands On Intro

IPFS - Hands On Intro

Intro slides for a "Hands On Introduction to IPFS". These slides do not include the demo part-- which is the bulk of that talk.

A9670c143716320893863524a0efbaff?s=128

Juan Batiz-Benet

May 04, 2015
Tweet

Transcript

  1. ipfs.io @IPFSbot Juan Benet @juanbenet 2015-04-25 The Permanent Web

  2. None
  3. None
  4. 1. Why - The Problems! 2. How - The Overview

    3. What - The Demo
  5. None
  6. None
  7. None
  8. None
  9. Location Addressing

  10. http://10.20.30.40/foo/bar/baz.png location path http://example.com/foo/bar/baz.png

  11. http://10.20.30.40/foo/bar/baz.png you

  12. http://10.20.30.40/foo/bar/baz.png 10.20.30.40 you

  13. http://10.20.30.40/foo/bar/baz.png 10.20.30.40 you

  14. Bandwidth Latency Offline Security Permanence Multiple Devices Data Sovereignty …

    PROBLEMS
  15. Bandwidth & Latency

  16. https://www.flickr.com/photos/powerchu/1695143481/

  17. None
  18. None
  19. None
  20. 1MB

  21. 1MB x 8 = 8 MB

  22. None
  23. 30

  24. 30 x 1MB x 8 = 240 MB

  25. https://

  26. 200 MB

  27. 200 MB x 30 x 8 = 48 GB

  28. Online vs Offline

  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. surprise oppression

  36. Permanence

  37. None
  38. 1. IPFS?

  39. None
  40. None
  41. None
  42. None
  43. None
  44. None
  45. None
  46. None
  47. None
  48. None
  49. None
  50. None
  51. 1. Why - The Problems! 2. How - The Overview

    3. What - The Demo
  52. 1. Motivation

  53. Content Addressing 1. Motivation

  54. http://10.20.30.40/foo/bar/baz.png location path http://example.com/foo/bar/baz.png 1. Motivation

  55. http:// location path http:// 1. Motivation /ipns/example.com/foo/bar/baz.png /ipfs/QmW98pJrc6FZ6/foo/bar/baz.png content path

  56. http://10.20.30.40/foo/bar/baz.png you 1. Motivation /ipfs/QmW98pJrc6FZ6/foo/bar/baz.png

  57. http://10.20.30.40/foo/bar/baz.png 10.20.30.40 you 1. Motivation /ipfs/QmW98pJrc6FZ6/foo/bar/baz.png HTTP

  58. http://10.20.30.40/foo/bar/baz.png 10.20.30.40 you 1. Motivation /ipfs/QmW98pJrc6FZ6/foo/bar/baz.png IPFS

  59. 1. Motivation p2p distribution /ipfs/

  60. 1. Motivation p2p distribution /ipfs/

  61. a new hypermedia distribution protocol The Permanent Web 2. Overview

  62. web 2. Overview

  63. SFS web DHT + 2. Overview

  64. SFS web DHT 2. Overview routing network exchange merkledag naming

    applications
  65. merkledag 2. Overview the model IPFS nodes

  66. merkledag 2. Overview the model IPFS nodes (content) (programs)

  67. in IPFS data forms a dag 2. Overview

  68. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! 1 3 5 2 4 suppose links:
  69. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! suppose H(<1>) = QmW98pJrc6FZ We can resolve: /ipfs/QmW98pJrc6FZ as 1 /ipfs/QmW98pJrc6FZ/foo as 2 /ipfs/QmW98pJrc6FZ/bar as 3 /ipfs/QmW98pJrc6FZ/foo/biff as 3 /ipfs/QmW98pJrc6FZ/baz as 4 1 3 5 1 2 2 3 4 4 3 suppose links: 1
  70. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! suppose H(<1>) = QmW98pJrc6FZ We can resolve: /ipfs/QmW98pJrc6FZ as 1 /ipfs/QmW98pJrc6FZ/foo as 2 /ipfs/QmW98pJrc6FZ/bar as 3 /ipfs/QmW98pJrc6FZ/foo/biff as 3 /ipfs/QmW98pJrc6FZ/baz as 4 1 3 5 1 2 2 3 4 4 3 suppose links: 1
  71. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! suppose H(<1>) = QmW98pJrc6FZ We can resolve: /ipfs/QmW98pJrc6FZ as 1 /ipfs/QmW98pJrc6FZ/foo as 2 /ipfs/QmW98pJrc6FZ/bar as 3 /ipfs/QmW98pJrc6FZ/foo/biff as 3 /ipfs/QmW98pJrc6FZ/baz as 4 1 3 5 1 2 2 3 4 4 3 suppose links: 1
  72. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! suppose H(<1>) = QmW98pJrc6FZ We can resolve: /ipfs/QmW98pJrc6FZ as 1 /ipfs/QmW98pJrc6FZ/foo as 2 /ipfs/QmW98pJrc6FZ/bar as 3 /ipfs/QmW98pJrc6FZ/foo/biff as 3 /ipfs/QmW98pJrc6FZ/baz as 4 1 3 5 1 2 2 3 4 4 3 suppose links: 1
  73. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! suppose H(<1>) = QmW98pJrc6FZ We can resolve: /ipfs/QmW98pJrc6FZ as 1 /ipfs/QmW98pJrc6FZ/foo as 2 /ipfs/QmW98pJrc6FZ/bar as 3 /ipfs/QmW98pJrc6FZ/foo/biff as 3 /ipfs/QmW98pJrc6FZ/baz as 4 1 3 5 1 2 2 3 4 4 3 suppose links: 1
  74. can resolve unix-style paths across dag links 2. Overview QmbTJW4iGGBS

    3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz QmbTQmPMEFgh 1020 biff this node has some data… this node also has some data. but no links! suppose H(<1>) = QmW98pJrc6FZ We can resolve: /ipfs/QmW98pJrc6FZ as 1 /ipfs/QmW98pJrc6FZ/foo as 2 /ipfs/QmW98pJrc6FZ/bar as 3 /ipfs/QmW98pJrc6FZ/foo/biff as 3 /ipfs/QmW98pJrc6FZ/baz as 4 1 3 5 1 2 2 3 4 4 3 suppose links: 1
  75. any data structures are represented as dags 2. Overview

  76. 2. Overview unix files and dirs any data structures are

    represented as dags
  77. blob, tree, commit unix files and dirs any data structures

    are represented as dags 2. Overview
  78. blob, tree, commit unix files and dirs any data structures

    are represented as dags blocks, txns, wallets 2. Overview
  79. blob, tree, commit unix files and dirs any data structures

    are represented as dags blocks, txns, wallets kv-stores 2. Overview
  80. blob, tree, commit unix files and dirs any data structures

    are represented as dags blocks, txns, wallets kv-stores 2. Overview
  81. unixfs as a dag 2. Overview

  82. files are dag nodes unixfs as a dag 2. Overview

  83. files are dag nodes BIG files may be split into

    many unixfs as a dag 2. Overview
  84. directories are also dag nodes files are dag nodes BIG

    files may be split into many unixfs as a dag 2. Overview
  85. which link to others directories are also dag nodes files

    are dag nodes BIG files may be split into many unixfs as a dag 2. Overview
  86. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object>

  87. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt

  88. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt XLYkgq61DYaQ8Nhk

  89. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt foo aCpDMGv XLYkgq61DYaQ8Nhk data1

  90. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt foo aCpDMGv XLYkgq61DYaQ8Nhk data1

  91. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt foo aCpDMGv XLYkgq61DYaQ8Nhk data1 aCpDMGvV2BGHeYER

  92. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt foo aCpDMGv XLYkgq61DYaQ8Nhk data1 bar.txt UEnRQAw

    aCpDMGvV2BGHeYER data2
  93. ipfs paths /ipfs/<hash-of-object>/<name-path-to-object> /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt foo aCpDMGv XLYkgq61DYaQ8Nhk data1 bar.txt UEnRQAw

    aCpDMGvV2BGHeYER data2 UEnRQAwe3N8SzbUt data3
  94. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15

  95. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1

  96. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1 <hash1>

  97. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1 tx <hash3>

    <hash1> data2 parent <hash2>
  98. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1 tx <hash3>

    <hash1> data2 <hash3> parent <hash2>
  99. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1 tx <hash3>

    <hash1> data2 <hash3> data3 15 <hash5> parent <hash2> 14 <hash4>
  100. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1 tx <hash3>

    <hash1> data2 <hash3> data3 15 <hash5> <hash5> parent <hash2> 14 <hash4>
  101. ipfs paths: blockchain /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15 parent <hash1> XLYkgq61DYaQ8Nhk data1 tx <hash3>

    <hash1> data2 <hash3> data3 15 <hash5> <hash5> data4 input0 <hash6> parent <hash2> 14 <hash4> output0 <hash7>
  102. in IPFS data forms a dag it’s called the merkle

    dag because the links are hashes 2. Overview
  103. in IPFS data forms a dag it’s called the merkle

    dag because the links are hashes 2. Overview
  104. content addressing merkle dag linking routing pki namespace concepts

  105. merkle tree

  106. git objects

  107. blockchain

  108. merkle dags

  109. in IPFS data forms a dag nodes have links and

    data [ (hash, size, name), … ] QmbTJW4iGGBS 3987 foo QmbTQmPMEFgh 1020 bar QmZFJguywFUY 6787 baz anything you want []byte links data 2. Overview
  110. an IPFS node 2. Overview

  111. has pki based identity an IPFS node 2. Overview

  112. has pki based identity connects to others an IPFS node

    2. Overview
  113. can store part of the dag has pki based identity

    connects to others an IPFS node 2. Overview
  114. has pki based identity connects to others can get more

    from peers an IPFS node can store part of the dag 2. Overview
  115. has pki based identity connects to others can be run

    as a server can get more from peers an IPFS node can store part of the dag 2. Overview
  116. has pki based identity connects to others can be run

    as a server or embedded in apps app
 
 can get more from peers an IPFS node can store part of the dag 2. Overview
  117. 2. Overview IPFS nodes form p2p networks transport agnostic and

    with NAT traversal
  118. 2. Overview IPFS nodes form p2p networks transport agnostic and

    with NAT traversal
  119. they find each other and content with routing systems, like

    DHTs 2. Overview
  120. and exchange dag nodes like files in http or bittorrent

    2. Overview
  121. and exchange dag nodes like files in http or bittorrent

    2. Overview
  122. and exchange dag nodes like files in http or bittorrent

    2. Overview
  123. 1. Why - The Problems! 2. How - The Overview

    3. What - The Demo - install - run a node - stream media - publish website - boot a vm
  124. 3 ways to install IPFS 1. npm install -g go-ipfs

    2. go get github.com/ipfs/go-ipfs/cmd/ipfs 3. install packages on the website
  125. ipfs.io

  126. ipfs.io

  127. in go-ipfs:

  128. in go-ipfs: ipfs node

  129. in go-ipfs: ipfs node cli

  130. in go-ipfs: ipfs node cli library

  131. in go-ipfs: ipfs node cli library http api

  132. in go-ipfs: ipfs node cli library http api http/ipfs gateway

  133. in go-ipfs: ipfs node cli library http api http/ipfs gateway

    webui
  134. in go-ipfs: ipfs node cli library http api http/ipfs gateway

    webui DEMO
  135. None
  136. a new hypermedia distribution protocol The Permanent Web

  137. #ipfs on