I understand that once given a merkle root, a value and a path to that value, you can verify that that particular value exists within the merkle tree identified by itās specific merkle root.
What Iām failing to see is how merkle trees/DAGs are used/created/stored in IPFS, e.g.:
If I choose the CID for a blob Iām storing (say, an Ethereum block), I can resolve the blob into memory and start traversing links. However, those links are in āresolver spaceā as opposed to āIPFS storage spaceā, that is, these links arenāt stored as links in the blob, but I can represent them as links and can traverse and pull blobs with linked CIDs from IPFS.
Likewise, if I store raw JSON (containing merkle-links) with the dag-cbor
multicodec:
- am I just encoding JSON as CBOR and storing a raw CBOR blob in IPFS?
- Or are there merkle-links created within the blob when itās encoded from the raw JSON? Does the graph builder library do something similar to this?
- If so, how are these links used and stored (beyond traversing them with an IPLD resolver)?
- Furthermore, if they are stored in a particular way (distinct from just a regular CBOR blob), are there proofs that are/can be constructed to prove a value exists within a
dag-cbor
object?
Hope some of that made sense!
For context: my goal is to use merkle proofs as a way of returning only some parts of an IPLD object while proving they exist within the IPLD DAG as identified by itās CID. I suspect that IPFS allows this already or that this behaviour is a part of the IPLD spec, but canāt find any good information anywhere.