Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Juan Batiz-Benet

May 04, 2015
Tweet

More Decks by Juan Batiz-Benet

Other Decks in Technology

Transcript

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

    View Slide

  2. View Slide

  3. View Slide

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

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. Location Addressing

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  14. Bandwidth
    Latency
    Offline
    Security
    Permanence
    Multiple Devices
    Data Sovereignty

    PROBLEMS

    View Slide

  15. Bandwidth & Latency

    View Slide

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

    View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. 1MB

    View Slide

  21. 1MB x 8 = 8 MB

    View Slide

  22. View Slide

  23. 30

    View Slide

  24. 30 x 1MB x 8 = 240 MB

    View Slide

  25. https://

    View Slide

  26. 200 MB

    View Slide

  27. 200 MB x 30 x 8 = 48 GB

    View Slide

  28. Online vs Offline

    View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. surprise oppression

    View Slide

  36. Permanence

    View Slide

  37. View Slide

  38. 1. IPFS?

    View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. View Slide

  44. View Slide

  45. View Slide

  46. View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. 1. Why - The Problems!
    2. How - The Overview
    3. What - The Demo

    View Slide

  52. 1. Motivation

    View Slide

  53. Content Addressing
    1. Motivation

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  59. 1. Motivation
    p2p
    distribution
    /ipfs/

    View Slide

  60. 1. Motivation
    p2p
    distribution
    /ipfs/

    View Slide

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

    View Slide

  62. web
    2. Overview

    View Slide

  63. SFS
    web
    DHT
    +
    2. Overview

    View Slide

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

    View Slide

  65. merkledag
    2. Overview
    the model
    IPFS nodes

    View Slide

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

    View Slide

  67. in IPFS
    data forms a dag
    2. Overview

    View Slide

  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:

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  75. any data structures are
    represented as dags
    2. Overview

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  81. unixfs as a dag
    2. Overview

    View Slide

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

    View Slide

  83. files are dag nodes
    BIG files may be
    split into many
    unixfs as a dag
    2. Overview

    View Slide

  84. directories are
    also dag nodes
    files are dag nodes
    BIG files may be
    split into many
    unixfs as a dag
    2. Overview

    View Slide

  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

    View Slide

  86. ipfs paths
    /ipfs//

    View Slide

  87. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt

    View Slide

  88. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt
    XLYkgq61DYaQ8Nhk

    View Slide

  89. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt
    foo aCpDMGv
    XLYkgq61DYaQ8Nhk
    data1

    View Slide

  90. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt
    foo aCpDMGv
    XLYkgq61DYaQ8Nhk
    data1

    View Slide

  91. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt
    foo aCpDMGv
    XLYkgq61DYaQ8Nhk
    data1
    aCpDMGvV2BGHeYER

    View Slide

  92. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt
    foo aCpDMGv
    XLYkgq61DYaQ8Nhk
    data1
    bar.txt UEnRQAw
    aCpDMGvV2BGHeYER
    data2

    View Slide

  93. ipfs paths
    /ipfs//
    /ipfs/XLYkgq61DYaQ8Nhk/foo/bar.txt
    foo aCpDMGv
    XLYkgq61DYaQ8Nhk
    data1
    bar.txt UEnRQAw
    aCpDMGvV2BGHeYER
    data2
    UEnRQAwe3N8SzbUt
    data3

    View Slide

  94. ipfs paths: blockchain
    /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15

    View Slide

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

    View Slide

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

    View Slide

  97. ipfs paths: blockchain
    /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15
    parent
    XLYkgq61DYaQ8Nhk
    data1
    tx

    data2
    parent

    View Slide

  98. ipfs paths: blockchain
    /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15
    parent
    XLYkgq61DYaQ8Nhk
    data1
    tx

    data2

    parent

    View Slide

  99. ipfs paths: blockchain
    /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15
    parent
    XLYkgq61DYaQ8Nhk
    data1
    tx

    data2

    data3
    15
    parent
    14

    View Slide

  100. ipfs paths: blockchain
    /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15
    parent
    XLYkgq61DYaQ8Nhk
    data1
    tx

    data2

    data3
    15

    parent
    14

    View Slide

  101. ipfs paths: blockchain
    /ipfs/XLYkgq61DYaQ8Nhk/parent/tx/15
    parent
    XLYkgq61DYaQ8Nhk
    data1
    tx

    data2

    data3
    15

    data4
    input0
    parent
    14
    output0

    View Slide

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

    View Slide

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

    View Slide

  104. content addressing
    merkle dag
    linking
    routing
    pki namespace
    concepts

    View Slide

  105. merkle tree

    View Slide

  106. git objects

    View Slide

  107. blockchain

    View Slide

  108. merkle dags

    View Slide

  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

    View Slide

  110. an IPFS node
    2. Overview

    View Slide

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

    View Slide

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

    View Slide

  113. can store part
    of the dag
    has pki based
    identity
    connects
    to others
    an IPFS node
    2. Overview

    View Slide

  114. has pki based
    identity
    connects
    to others
    can get more
    from peers
    an IPFS node
    can store part
    of the dag
    2. Overview

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  119. they find each other and content
    with routing systems, like DHTs
    2. Overview

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  123. 1. Why - The Problems!
    2. How - The Overview
    3. What - The Demo
    - install
    - run a node
    - stream media
    - publish website
    - boot a vm

    View Slide

  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

    View Slide

  125. ipfs.io

    View Slide

  126. ipfs.io

    View Slide

  127. in go-ipfs:

    View Slide

  128. in go-ipfs:
    ipfs node

    View Slide

  129. in go-ipfs:
    ipfs node cli

    View Slide

  130. in go-ipfs:
    ipfs node cli library

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  135. View Slide

  136. a new hypermedia distribution protocol
    The Permanent Web

    View Slide

  137. #ipfs on

    View Slide