# Dag-pb and UnixFs confusion

**URL:** <https://discuss.ipfs.tech/t/dag-pb-and-unixfs-confusion/15077>\
**Category:** Uncategorized\
**Created:** [August 30, 2022, 8:09pm UTC](https://discuss.ipfs.tech/t/dag-pb-and-unixfs-confusion/15077 "2022-08-30T20:09:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ABengrine](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@ABengrine](https://discuss.ipfs.tech/u/ABengrine)\
**Post date:** [August 30, 2022, 8:09pm UTC](https://discuss.ipfs.tech/t/dag-pb-and-unixfs-confusion/15077/1 "2022-08-30T20:09:21Z")

</div>

Hi, learning about dab-pb and unixFs I must say that I am a little bit confused about how the Merkle DAG is linked in IPFS.

Does a CID point to an Unixfs struct based on this protobuf and in the field data we may find data encoded with dag-pb, dag-cbor, …  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/2/29f4ba2cf31fe067721e0dff07bb31c7fe658b76.png)

Or a CID points to a Dag-pb, Dag-Json struct and in the field data we will find a unixfs protobuf struct.

Which structure really build the Merkle DAG ? Thanks a lot

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [August 30, 2022, 8:23pm UTC](https://discuss.ipfs.tech/t/dag-pb-and-unixfs-confusion/15077/2 "2022-08-30T20:23:40Z")

</div>

By default, when you add something with Kubo, the CID points to a block of dag-pb type. That is, the block is the serialization of a protobuf ([go-merkledag/merkledag.proto at master · ipfs/go-merkledag · GitHub](https://github.com/ipfs/go-merkledag/blob/master/pb/merkledag.proto)). That node has two things: Links and Data.

Links is a list of other CIDs. Data is a binary payload.

That binary payload in this case corresponds to the unixfs protobuf ([go-unixfs/unixfs.proto at master · ipfs/go-unixfs · GitHub](https://github.com/ipfs/go-unixfs/blob/master/pb/unixfs.proto)).

A dag-pb merkledag does not necessarily have to carry a unixfs payload, but in the case of IPFS unixfs files, it is what it does. The idea is also that in order to sync, announce or generally traverse this Merkle DAG, you don’t need to interpret/parse all the unixfs data. You just need to follow the links. Payload is irrelevant and thus ipfs can be agnostic to it.
