šŸ“–
[Deprecated] Launchpad Curriculum
  • README
  • About Launchpad
  • Launchpad Learning Resources
    • The Protocol Labs Network
      • What is the PL Network?
      • Teams in the PL Network
      • Protocol Labs Culture
      • Where We are Headed
      • Open Source Stewardship
      • Open Source Contribution
    • IPFS
      • IPFS Setup (Tutorial)
      • Mutable Content
      • IPFS Public DHT
      • Who Uses IPFS
      • How IPFS Works
      • Data Transfer
      • IPFS Subsystems & Architecture
      • The IPFS Gateways
      • The IPFS API (Tutorial)
      • IPFS Resources
    • IPLD
      • Content Addressing & CIDs
      • Graphs: Merkle DAGs
      • The IPLD Data Model
      • IPLD & IPFS
      • Codecs
      • IPLD Schemas
      • Paths & Selectors
      • Distributed Data Structures
      • The CAR Format
      • IPLD Resources
    • libp2p
      • Core Concepts
      • libp2p Connections and Users
      • Decentralized Messaging
      • Gossipsub
      • Distributed Networking Solutions
      • Nat Traversal and Hole Punching
      • libp2p Resources
    • Filecoin
      • How Filecoin Works
      • Filecoin Cryptoeconomics
      • The Filecoin Protocol
      • Drand
      • Progress & Future Work
      • Filecoin Resources
  • Other Resources
    • Pre-Requisites
      • Web3 & Protocol Labs
      • Building Web3
      • Web3 Tools
    • Protocol Labs Toolkits & SDKs
      • Textile
      • Ceramic
      • Fleek
      • Web3.Storage
      • PiƱata
    • Built On IPFS and Filecoin
    • Additional Learning
Powered by GitBook
On this page
  • Blocks and Nodes
  • Kinds
Edit on GitHub
  1. Launchpad Learning Resources
  2. IPLD

The IPLD Data Model

PreviousGraphs: Merkle DAGsNextIPLD & IPFS

Last updated 2 years ago

IPLD defines a Data Model that details the forms that data can take in memory, and through which a codec transforms that memory to and from encoded bytes.

Like the JSON data model, the IPLD Data Model includes data which include Booleans, Strings, Ints, Floats, Null, Lists and Maps, but also adds and (CIDs).

The Data Model is how we reason about data moving through the various states—in-memory, programmatic access and manipulation, and serialization to and from bytes for storage or transfers.

The data model defines a common representation of basic types that are easily representable by common programming languages and found in the most common and successful serialization formats.

const data = {
 string: "ā˜ŗļø  we can do strings!",
 ints: 1337,
 floats: 13.37,
 booleans: true,
 lists: [1, 2, 3],
 bytes: new Uint8Array([0x01, 0x03, 0x03, 0x07]),
 links: CID(bafyreidykglsfhoixmivffc5uwhcgshx4j465xwqntbmu43nb2dzqwfvae)
}

Read more about the Data Model at

Blocks and Nodes

IPLD data is quantified in terms of nodes and blocks. A node is a point in a graph, while a block is a collective unit of data that is serialized and hashed to generate a content address (CIDs). Blocks typically include many nodes.

If we define an example block of data using JSON:

{"a": ["b", "c"]}

We can see 5 nodes:

  1. The enclosing map

  2. The key (the string "a")

  3. The list

  4. The first list value (the string "b")

  5. The second list value (the string "c")

Kinds

We refer to the different kinds of representable data in the Data Model as "kinds": Booleans, Strings, Ints, Floats, Null, Bytes, Lists, Maps and Links.

The 'recursive kinds' are Maps and Lists (since they can contain other kinds).

Read more about Nodes and their relationship to other IPLD concepts at

We use the term "kinds" here to disambiguate this from "types", which is a term we use at the level.

Read more about IPLD Kinds and specifics of what we expect regarding their bounds and representation at

Kinds
Bytes
Links
ipld.io/docs/data-model
ipld.io/docs/data-model/node
Schemas
ipld.io/docs/data-model/kinds