Skip to content

Instantly share code, notes, and snippets.

@vmx
Created January 18, 2023 11:01
Show Gist options
  • Save vmx/1a5da11e283c84fcf445fa52b977ef7a to your computer and use it in GitHub Desktop.
Save vmx/1a5da11e283c84fcf445fa52b977ef7a to your computer and use it in GitHub Desktop.
IPLD Shallow dive 2023-01-18
title tags description slideOptions
IPLD Shallow Dive
IPLD, Launchpad
Launchpad V8 presentaiton 2023-01-18
width theme
1280
blood
<style> .container { scrollbar-width: none; } .container::-webkit-scrollbar { display: none; } .reveal h1, .reveal h2 { color: #ffaf00; text-shadow: 5px 5px #000 !important; } .reveal h2 { margin-bottom: 0.5em; } /* .pdf-page h1 { text-shadow: 5px 5px #000 !important; } */ .reveal .progress, .reveal .controls { color: #ffaf00; } .reveal a { /*color: #87ff00;*/ color: #00afd7; text-decoration: underline; } .reveal a:hover { color: #00afd7; text-decoration: none; } .reveal strong { color: #ffaf00; } .reveal .slide-number { background-color: inherit; } .reveal .slide-number a { text-decoration: none; } </style>

IPLD Shallow Dive


Goals of this talk

  • What IPLD is and how it works
  • Know why Multihashes and CIDs are needed for IPLD

IPLD + Multiformats


IPLD

Content-addressed structured data


IPLD

Content-addressed structured data


Structured data

  • Your pen and paper todo list todolist

Structured data

  • Consists of a list of:
    • item todo
    • status (done/not done)

     

 

 


Structured data

  • For computer you might encode it as Markdown
 - [x] Watch previous shallow dives
 - [ ] Prepare presentation

   

 

 

 


Structured data

  • For computer you might encode it as JSON
[{
    "item:": "Watch previous shallow dives",
    "done": true
}, {
    "item:": "Prepare previous shallow dives",
    "done": false
}]

 

 

 


Structured data

  • For computer you might encode it as CBOR
82A2656974656D3A781C57617463682070726576696F7573207368616C6C
6F7720646976657364646F6E65F5A2656974656D3A781E50726570617265
2070726576696F7573207368616C6C6F7720646976657364646F6E65F4

   

   

 


Structured data

  • The IPLD Data Model describes the structure (list of items and statuses)
  • The IPLD Codec, how it is represented (pen and paper, Markdown, JSON, CBOR) => This makes it different from many other serialization systems like Protocol Buffers, where the data model is coupled with the encoding

   

Note:

  • Systems have different need: e.g. human readable vs. efficient for computer

IPLD

Content-addressed structured data


Content-addressing

 

digraph hierarchy {
  edge [color="#ffffff", fontcolor="#ffffff", fontname=D2Coding, fontsize=16, minlen=2]
  graph [bgcolor="transparent", color="#ffffff", nodesep=1, rankdir=LR]
  node [color="#ffffff", fontcolor="#ffffff", fontname=D2Coding, fontsize=16, shape=box, width=2, height=1]

  subgraph ipld {
    edge [
      color="#222222"
      fontcolor="#222222"
    ]
    node [
      color="#222222"
      fontcolor="#222222"
    ]
    
    data_model[label="IPLD Data Model"]
    subgraph cluster_block {
      edge [
        minlen=1
      ]
      graph [
        color="transparent"
        fontcolor="#222222"
        fontname=D2Coding
        fontsize=20
        label="Block"
      ]
    
      bytes_ipld[label="Bytes"]
      cid[label="CID"]

      bytes_ipld -> cid [label="hashing"]
    }
  
    data_model -> bytes_ipld [label="encode with", taillabel="      IPLD Codec"]
  }

  structured_data[label="Structured Data"]
  bytes[label="Bytes"]
  address[label="Address"]
  
  structured_data -> bytes [label="encode"]
  bytes -> address [label="hashing"]
}

Content-addressing

 

digraph hierarchy {
  edge [color="#ffffff", fontcolor="#ffffff", fontname=D2Coding, fontsize=16, minlen=2]
  graph [bgcolor="transparent", color="#ffffff", nodesep=1, rankdir=LR]
  node [color="#ffffff", fontcolor="#ffffff", fontname=D2Coding, fontsize=16, shape=box, width=2, height=1]

  subgraph ipld {
    data_model[label="IPLD Data Model"]
    subgraph cluster_block {
      edge [
        minlen=1
      ]
      graph [
        color="transparent"
        fontcolor="#222222"
        fontname=D2Coding
        fontsize=20
        label=<<b>Block</b>>
      ]
    
      bytes_ipld[label="Bytes"]
      cid[label="CID"]

      bytes_ipld -> cid [label="hashing"]
    }
  
    data_model -> bytes_ipld [label="encode with", taillabel="      IPLD Codec"]
  }


  structured_data[label="Structured Data"]
  bytes[label="Bytes"]
  address[label="Address"]
  
  structured_data -> bytes [label="encode"]
  bytes -> address [label="hashing"]
}

Content-addressing

 

digraph hierarchy {
  edge [color="#ffffff", fontcolor="#ffffff", fontname=D2Coding, fontsize=16, minlen=2]
  graph [bgcolor="transparent", color="#ffffff", nodesep=1, rankdir=LR]
  node [color="#ffffff", fontcolor="#ffffff", fontname=D2Coding, fontsize=16, shape=box, width=2, height=1]

  subgraph ipld {

    data_model[label="IPLD Data Model"]
    subgraph cluster_block {
      edge [
        minlen=1
      ]
      graph [
        color="#ffaf00"
        fontcolor="#ffaf00"
        fontname=D2Coding
        fontsize=20
        label=<<b>Block</b>>
        penwidth=2
      ]
    
      bytes_ipld[label="Bytes"]
      cid[label="CID"]

      bytes_ipld -> cid [label="hashing"]
    }
  
    data_model -> bytes_ipld [label="encode with", taillabel="      IPLD Codec"]
  }
  

  structured_data[label="Structured Data"]
  bytes[label="Bytes"]
  address[label="Address"]
  
  structured_data -> bytes [label="encode"]
  bytes -> address [label="hashing"]
}

Multihash

  • Part of a CID
  • Describes which hash function was used
  • Used for verifying the data
    • Data changes => hash changes => If hash matches the data, it's a very very very high probability that the data is the expected on (it's so high that you can take it for granted)

Example: org chart

 

digraph G {
  bgcolor="#222222"
  graph [
    nodesep=1
    splines=ortho
  ]
  edge [
    color="#ffffff"
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding,
    fontsize=20,
    shape=box,
  ]
  
  Alice[width=1]
  Bob[width=2]
  Cameron[width=2]
  # Helper points to make edges go sideways, based on
  # https://stackoverflow.com/questions/49053316/orthogonal-edges-layout-in-graphviz/68297726#68297726 
  point1 [label="", shape=point, width=0]
  point2 [label="", shape=point, width=0]
  
  Alice->point1[arrowhead=none]
  Alice->point2[arrowhead=none]
  point1->Bob:nw
  point2->Cameron:ne
}

   


Example: org chart

Single person:

digraph G {
  bgcolor="#222222"
  node [
    color="#ffffff",
    fontcolor="#ffffff",
    fontname=D2Coding,
    fontsize=20,
    shape=record,
    width=2
  ]

  person [     
    label = "{name\l|team\l|staff\l - One\l - Two\l}"
  ]
}

   


Example: org chart

Alice

digraph G {
  bgcolor="#222222"
  node [
    color="#ffffff",
    fontcolor="#ffffff",
    fontname=D2Coding,
    fontsize=20,
    shape=record,
    width=2
  ]

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - Bob\l - Cameron\l}"
  ]
}

   


Example: org chart

digraph G {
  bgcolor="#222222"
  edge [
    color="transparent"
    fontcolor="#222222"
    fontname=D2Coding
    fontsize=20
  ]
  graph [
    nodesep=1
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=record
    width=2
  ]

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - Bob\l - Cameron\l}"
  ]
  bob [     
    label = "{name: Bob\l|team: FilDev\l}"
  ]
  cameron [     
    label = "{name: Cameron\l|team: FilDev\l}"
  ]

  bob_block [
    color="transparent"
    fontcolor="#222222"
    label = "Block\n(CIDofBob\n+ bytes)"
  ]
  cameron_block [
    color="transparent"
    fontcolor="#222222"
    label = "Block\n(CIDofCameron\n+ bytes)" 
    width=2.5
  ]
  
  bob -> bob_block[label="  encode\n  & hash"]
  cameron -> cameron_block[label="  encode\n  & hash"]
}

Example: org chart

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
  ]
  graph [
    nodesep=1
  ]
  node [
    color="#ffffff",
    fontcolor="#ffffff",
    fontname=D2Coding,
    fontsize=20,
    shape=record,
    width=2
  ]

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - Bob\l - Cameron\l}"
  ]
  bob [     
    label = "{name: Bob\l|team: FilDev\l}"
  ]
  cameron [     
    label = "{name: Cameron\l|team: FilDev\l}"
  ]
  
  bob_block [
    color="#ffaf00"
    fontcolor="#ffaf00"
    label=<<b>Block<br/>(CIDofBob<br/>+ bytes)</b>>
  ]
  cameron_block [
    color="#ffaf00"
    fontcolor="#ffaf00"
    label=<<b>Block<br/>(CIDofCameron<br/>+ bytes)</b>>
    width=2.5
  ]
  
  bob -> bob_block[
    color="#ffaf00"
    fontcolor="#ffaf00"
    label=<<b>  encode<br/>  &amp; hash</b>>
    penwidth=2
  ]
  cameron -> cameron_block[
    color="#ffaf00"
    fontcolor="#ffaf00"
    label="  encode\n  & hash"
    label=<<b>  encode<br/>  &amp; hash</b>>
    penwidth=2
  ]
}

Example: org chart

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=2
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=record
    width=2
  ]
  
  alice->point1[arrowhead=none]
  alice->point2[arrowhead=none]
  point1->bob:nw
  point2->cameron:ne

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - CIDofBob\l - CIDofCameron\l}"
  ]
  bob [     
    label = "{name: Bob\l|team: FilDev\l}"
  ]
  cameron [     
    label = "{name: Cameron\l|team: FilDev\l}"
  ]

  # Helper points to make edges go sideways, based on
  # https://stackoverflow.com/questions/49053316/orthogonal-edges-layout-in-graphviz/68297726#68297726 
  point1 [label="", shape=point, width=0]
  point2 [label="", shape=point, width=0]
}

IPLD concepts in org chart

  • CIDs: Content Identifiers
  • DAG: Directed acyclic graph (arrows are not forming loops)
  • IPLD pathing: Accessing a specific item in a DAG
  • IPLD Selectors: More complex traversals than pathing

IPLD pathing

Example: CIDofAlice/staff/0/name => Bob    

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=2
    splines=ortho
  ]
  node [
    color="#ffffff",
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20,
    shape=record
    width=2
  ]
  
  alice->point1[arrowhead=none]
  alice->point2[arrowhead=none]
  point1->bob:nw
  point2->cameron:ne

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - CIDofBob\l - CIDofCameron\l}"
  ]
  bob [     
    label = "{name: Bob\l|team: FilDev\l}"
  ]
  cameron [     
    label = "{name: Cameron\l|team: FilDev\l}"
  ]

  # Helper points to make edges go sideways, based on
  # https://stackoverflow.com/questions/49053316/orthogonal-edges-layout-in-graphviz/68297726#68297726 
  point1 [label="", shape=point, width=0]
  point2 [label="", shape=point, width=0]
}

IPLD pathing

Example: CIDofAlice/staff/0/name => Bob CIDs are transparent links. It's not: CIDofAlice/staff/0/CIDofBob/name

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=2
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=record
    width=2
  ]
  
  alice->point1[arrowhead=none]
  alice->point2[arrowhead=none]
  point1->bob:nw
  point2->cameron:ne

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - CIDofBob\l - CIDofCameron\l}"
  ]
  bob [     
    label = "{name: Bob\l|team: FilDev\l}"
  ]
  cameron [     
    label = "{name: Cameron\l|team: FilDev\l}"
  ]

  # Helper points to make edges go sideways, based on
  # https://stackoverflow.com/questions/49053316/orthogonal-edges-layout-in-graphviz/68297726#68297726 
  point1 [label="", shape=point, width=0]
  point2 [label="", shape=point, width=0]
}

IPLD pathing

Example: CIDofAlice/staff/0/name => Bob    

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=2
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=record
    width=2
  ]
  
  alice->point1[arrowhead=none]
  alice->point2[arrowhead=none]
  point1->bob:nw
  point2->cameron:ne

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - CIDofBob\l - CIDofCameron\l}"
  ]
  bob [     
    label = "{name: Bob\l|team: FilDev\l}"
  ]
  cameron [     
    label = "{name: Cameron\l|team: FilDev\l}"
  ]

  # Helper points to make edges go sideways, based on
  # https://stackoverflow.com/questions/49053316/orthogonal-edges-layout-in-graphviz/68297726#68297726 
  point1 [label="", shape=point, width=0]
  point2 [label="", shape=point, width=0]
}

IPLD pathing

Example: CIDofAlice/staff/0/name => Bob    

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=2
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname="D2Coding"
    fontsize=20
    shape=record
    width=2
  ]
  
  alice->point1[arrowhead=none]
  alice->point2[arrowhead=none]
  point1->bob:nw
  point2->cameron:ne

  alice [     
    label = "{name: Alice\l|team: FilDev\l|staff\l - CIDofBob\l - CIDofCameron\l}"
  ]
  bob [     
    color="#ffaf00"
    fontcolor="#ffaf00"
    height=0.746
    label = <<b>bytes</b>   >
    penwidth=2
  ]
  cameron [     
    color="#ffaf00"
    fontcolor="#ffaf00"
    height = 0.746
    label = <<b>bytes</b>   >
    penwidth=2
  ]

  # Helper points to make edges go sideways, based on
  # https://stackoverflow.com/questions/49053316/orthogonal-edges-layout-in-graphviz/68297726#68297726 
  point1 [label="", shape=point, width=0]
  point2 [label="", shape=point, width=0]
}

Anatomy of a CIDv1

CIDv1: version + IPLD Codec + Multihash

  • IPLD Codec: how to decode the bytes into structured data
  • Multihash: verify the data

Immutability

 

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [label = ""]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [label = ""]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  dori->{alice1 alice2}
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron1 cameron2 cameron3}
  alice2->point1[color=transparent]
}

Immutability

Someone leaves the company.

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [label = ""]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
    style=filled
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  dori->{alice1 alice2}
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron1 cameron2 cameron3}
  alice2->point1[color=transparent]
}

Immutability

Not quite correct

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [label = ""]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  dori->{alice1 alice2}
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}
  alice2->{cameron1 point1}[color=transparent]
}

Immutability

Person needs to be updated

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [
    color="transparent"
    fillcolor="#ffaf00"
    label=""
    style=filled
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  dori->{alice1 alice2}
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}
  alice2->{cameron1 point1}[color=transparent]
}

Immutability

Create a new person entry…

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [label = ""]
  alice3 [
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
    style=filled
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  
  dori->{alice1 alice2}
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}
  alice2->{cameron1 point1}[color=transparent]

  {rank=same alice2 alice3}
}

Immutability

…that points to the actual team members

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [label = ""]
  alice3 [
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
    style=filled
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  
  dori->{alice1 alice2}
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}
  alice2->{cameron1 point1}[color=transparent]
  alice3->{cameron2 cameron3}[
    constraint=false
    color="#ffaf00"
    penwidth=2
  ]

  {rank=same alice2 alice3}
}

Immutability

We don't need the old entry anymore

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [
    color="transparent"
    label = ""
  ]
  alice3 [
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
    style=filled
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  point1 [label="", shape=point, width=0]
  
  dori->alice1
  dori->alice2[color=transparent]
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}[color=transparent]
  alice2->{cameron1 point1}[color=transparent]
  alice3->{cameron2 cameron3}[
    constraint=false
    color="#ffaf00"
    penwidth=2
  ]

  {rank=same alice2 alice3}
}

Immutability

Also the top-most person needs to be updated

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [
    color="transparent"
    label = ""
  ]
  alice3 [
    color="#ffaf00"
    fillcolor="#ffaf00"
    label = ""
    penwidth=2
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [label = ""]
  dori2 [
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
    style=filled
  ]
  point1 [label="", shape=point, width=0]
  
  dori->alice1
  dori->alice2[color=transparent]
  dori2 -> {alice1 alice3}[
    color="#ffaf00"
    constraint=false
    penwidth=2
  ]
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}[color=transparent]
  alice2->{cameron1 point1}[color=transparent]
  alice3->{cameron2 cameron3}[
    color="#ffaf00"
    constraint=false
    penwidth=2
  ]

  {rank=same alice2 alice3}
}

Immutability

Copy on Write (CoW)

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [
    color="transparent"
    label = ""
  ]
  alice3 [
    color="#ffaf00"
    fillcolor="#ffaf00"
    label = ""
    penwidth=2
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [
    color="transparent"
    label = ""
  ]
  dori2 [
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
    style=filled
  ]
  point1 [label="", shape=point, width=0]
  
  dori->alice1[color=transparent]
  dori->alice2[color=transparent]
  dori2 -> {alice1 alice3}[
    color="#ffaf00"
    constraint=false
    penwidth=2
  ]
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}[color=transparent]
  alice2->{cameron1 point1}[color=transparent]
  alice3->{cameron2 cameron3}[
    color="#ffaf00"
    constraint=false
    penwidth=2
  ]

  {rank=same alice2 alice3}
}

Immutability

This is our new graph

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [label = ""]
  alice2 [
    color="transparent"
    label = ""
  ]
  alice3 [
    #color="#ffaf00"
    #fillcolor="#ffaf00"
    label = ""
    #penwidth=2
  ]
  bob1 [label = ""]
  bob2 [label = ""]
  bob3 [label = ""]
  bob4 [label = ""]
  cameron1 [     
    color="transparent"
    fillcolor="#ffaf00"
    label = ""
  ]
  cameron2 [label = ""]
  cameron3 [label = ""]
  dori [
    color="transparent"
    label = ""
  ]
  dori2 [
    #color="transparent"
    #fillcolor="#ffaf00"
    label = ""
    #style=filled
  ]
  point1 [label="", shape=point, width=0]
  
  dori->alice1[color=transparent]
  dori->alice2[color=transparent]
  dori2 -> {alice1 alice3}[
    #color="#ffaf00"
    constraint=false
    #penwidth=2
  ]
  alice1->{bob1 bob2 bob3 bob4}
  alice2->{cameron2 cameron3}[color=transparent]
  alice2->{cameron1 point1}[color=transparent]
  alice3->{cameron2 cameron3}[
    #color="#ffaf00"
    constraint=false
    #penwidth=2
  ]

  {rank=same alice2 alice3}
}

Immutability

Travel back in time

digraph G {
  bgcolor="#222222"
  edge [
    color="#ffffff"
  ]
  graph [
    nodesep=0.7
    splines=ortho
  ]
  node [
    color="#ffffff"
    fontcolor="#ffffff"
    fontname=D2Coding
    fontsize=20
    shape=box
    height=1
  ]
  
  alice1 [
    label = ""
    color="#ffaf00"
    penwidth=3
  ]
  alice2 [
    color="#ffaf00"
    label = ""
    penwidth=2
  ]
  alice3 [
    #color="#ffaf00"
    #fillcolor="#ffaf00"
    label = ""
    #penwidth=2
  ]
  bob1 [
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  bob2 [
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  bob3 [
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  bob4 [
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  cameron1 [     
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  cameron2 [
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  cameron3 [
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  dori [
    color="#ffaf00"
    label = ""
    penwidth=3
    style=filled
  ]
  dori2 [
    #color="transparent"
    #fillcolor="#ffaf00"
    label = ""
    #style=filled
  ]
  point1 [label="", shape=point, width=0]
  
  dori->alice1[
    color="#ffaf00"
    penwidth=3
  ]
  dori->alice2[
    color="#ffaf00"
    penwidth=3
  ]
  dori2 -> {alice1 alice3}[
    #color="#ffaf00"
    constraint=false
    #penwidth=2
  ]
  alice1->{bob1 bob2 bob3 bob4}[
    color="#ffaf00"
    penwidth=3
  ]
  alice2->{cameron2 cameron3}[
    color="#ffaf00"
    penwidth=3
  ]
  alice2->point1[color=transparent]
  alice2->cameron1[
    color="#ffaf00"
    label = ""
    penwidth=3
  ]
  alice3->{cameron2 cameron3}[
    #color="#ffaf00"
    constraint=false
    #penwidth=2
  ]

  {rank=same alice2 alice3}
}

Where is IPLD used?


The end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment