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

IPFS: Re-distributing the Web

IPFS: Re-distributing the Web

Slides from my presentation at DTN Conf (http://dtn.is) on May 2015

Juan Batiz-Benet

May 24, 2015
Tweet

More Decks by Juan Batiz-Benet

Other Decks in Programming

Transcript

  1. ipfs.io
    @IPFSbot
    Juan Benet
    @juanbenet
    2015-05-24
    The Permanent Web

    View full-size slide

  2. WIFI
    SSID: /
    PASS:

    View full-size slide

  3. WIFI
    SSID: /
    PASS:

    View full-size slide

  4. ipfs.io
    @IPFSbot
    Juan Benet
    @juanbenet
    2015-05-24
    The Permanent Web

    View full-size slide

  5. ipfs.io
    @IPFSbot
    Juan Benet
    @juanbenet
    2015-05-24
    The Permanent Web
    Distribute

    View full-size slide

  6. ipfs.io
    @IPFSbot
    Juan Benet
    @juanbenet
    2015-05-24
    The Permanent Web
    Re-

    View full-size slide

  7. 1. What is IPFS?
    2. IPFS Intro
    3. Layering
    4. Datastructures
    5. Demo

    View full-size slide

  8. What is IPFS?

    View full-size slide

  9. What is IPFS?

    View full-size slide

  10. A protocol to upgrade the web

    View full-size slide

  11. Distributed
    Offline

    View full-size slide

  12. Permanent
    Distributed
    Offline

    View full-size slide

  13. Permanent
    Distributed
    Smarter
    Offline

    View full-size slide

  14. Permanent
    Distributed Safer
    Smarter
    Offline

    View full-size slide

  15. Permanent
    Distributed Safer
    Smarter
    Offline
    Faster

    View full-size slide

  16. 2026
    1991 2015

    View full-size slide

  17. 2026
    1991 2015
    24 11

    View full-size slide

  18. 2026
    1991 2015
    24 11
    11

    View full-size slide

  19. 2026
    1991 2015
    24 11
    11

    View full-size slide

  20. What is IPFS?

    View full-size slide

  21. hyperlinks media

    View full-size slide

  22. a hypermedia transport protocol
    HTTP

    View full-size slide

  23. What is IPFS?

    View full-size slide

  24. 1. A Protocol Stack
    2. Tools + Programs
    3. A Live System

    View full-size slide

  25. web
    DHT
    SFS
    routing
    network
    exchange
    merkledag
    naming
    applications
    The Stack

    View full-size slide

  26. routing
    network
    exchange
    merkledag
    naming
    applications
    The Stack

    View full-size slide

  27. routing
    network
    exchange
    merkledag
    naming
    applications
    The Stack
    Defining the Data
    Moving the Data
    Using the Data

    View full-size slide

  28. routing
    network
    exchange
    merkledag
    naming
    applications
    The Stack
    Defining the Data
    Moving the Data
    Using the Data

    View full-size slide

  29. routing
    network
    exchange
    merkledag
    naming
    applications
    IPNS
    Bitswap
    QUIC TCP
    uTP WebRTC WebSockets
    Git Bitcoin
    VLC
    Etherpad Chat
    UDT
    CJDNS
    Kad DHT mDNS

    View full-size slide

  30. routing
    network
    exchange
    merkledag
    naming
    applications
    IPNS
    Bitswap
    QUIC TCP
    uTP WebRTC WebSockets
    UDT
    CJDNS
    Kad DHT mDNS
    Git Bitcoin
    VLC
    Etherpad Chat

    View full-size slide

  31. routing
    network
    exchange
    merkledag
    naming
    applications
    IPNS
    DNS Namecoin
    Bitswap HTTP
    BitTorrent
    Kad DHT
    Chord mDNS
    Gossip Delegated
    FTP
    TOR
    QUIC TOR
    TCP
    uTP WebRTC WebSockets
    Git Bitcoin
    VLC
    Etherpad Chat
    I2P
    I2P
    CJDNS UDT

    View full-size slide

  32. IP
    UDP
    TCP SCTP
    Ethernet
    CSMA WIFI
    TP
    Coax Satellite
    Fiber Radio
    PPP
    HTTP SMTP
    FTP
    NFS Skype
    Pigeons
    Chat

    View full-size slide

  33. IP
    UDP
    TCP SCTP
    Ethernet
    CSMA WIFI
    TP
    Coax Satellite
    Fiber Radio
    PPP
    HTTP SMTP
    FTP
    NFS Skype
    Pigeons
    Chat

    View full-size slide

  34. Content Addressing
    1. Motivation

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  40. 1. Motivation
    p2p
    distribution
    /ipfs/

    View full-size slide

  41. 1. Motivation
    p2p
    distribution
    /ipfs/

    View full-size slide

  42. merkledag
    2. Overview
    the model
    IPFS nodes

    View full-size slide

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

    View full-size slide

  44. in IPFS
    data forms a merkle 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 full-size slide

  45. 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 full-size slide

  46. 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 full-size slide

  47. 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 full-size slide

  48. 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 full-size slide

  49. 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 full-size slide

  50. 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 full-size slide

  51. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  58. unixfs as a dag
    2. Overview

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  62. 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 full-size slide

  63. ipfs paths
    /ipfs//

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    data2
    parent

    View full-size slide

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

    data2

    parent

    View full-size slide

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

    data2

    data3
    15
    parent
    14

    View full-size slide

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

    data2

    data3
    15

    parent
    14

    View full-size slide

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

    data2

    data3
    15

    data4
    input0
    parent
    14
    output0

    View full-size slide

  79. an IPFS node
    2. Overview

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  84. 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 full-size slide

  85. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  91. 4 ways to install IPFS
    0. wget from an ifs link
    1. npm install -g go-ipfs
    2. go get github.com/ipfs/go-ipfs/cmd/ipfs
    3. install packages on the website

    View full-size slide

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

    View full-size slide