# How can I link to a different kind of hash-based system

**URL:** <https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762>\
**Category:** Help\
**Tags:** ipld\
**Created:** [July 13, 2017, 8:45am UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762 "2017-07-13T08:45:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![aboodman](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@aboodman](https://discuss.ipfs.tech/u/aboodman)\
**Post date:** [July 13, 2017, 8:45am UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/1 "2017-07-13T08:45:50Z")

</div>

There are lots of hash-based systems out there, descendant from Git, bup, Bitcoin, etc. Is it possible to link directly to content in those systems from IPFS?

---

<div class="post-metadata">

**Author:** ![daviddias](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/daviddias/32/40_2.png) [@daviddias](https://discuss.ipfs.tech/u/daviddias)\
**Post date:** [July 13, 2017, 8:51am UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/2 "2017-07-13T08:51:35Z")

</div>

It is indeed! 🙂 Check the dag examples here: [https://github.com/ipfs/js-ipfs/tree/master/examples/dag](https://github.com/ipfs/js-ipfs/tree/master/examples/dag) it shows how to get through some Ethereum blocks.

---

<div class="post-metadata">

**Author:** ![aboodman](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@aboodman](https://discuss.ipfs.tech/u/aboodman)\
**Post date:** [July 13, 2017, 9:16am UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/3 "2017-07-13T09:16:17Z")

</div>

Answering own question with results of some research. @daviddias please point out anything I got wrong.

Yes, [CID](https://github.com/ipld/cid) (_content id_) is the name of the format IPFS uses to link to hash-based content.

A CID is a string of bytes that specifies:  
(a) the encoding of the cid itself  
(b) the content type of the thing being linked to (e.g., image, git object, etc)  
© the multihash of the thing being linked to

It is possible to add support for new content types by:

- adding a new entry to the list here if necessary for the hash function: [https://github.com/multiformats/multicodec/blob/master/table.csv#L35](https://github.com/multiformats/multicodec/blob/master/table.csv#L35)
- adding a new entry to the same table if necessary for the target content type
- implementing a “resolver” which resolve a cid to a block

Two interesting things here:

- The block that the cid resolves to doesn’t even need to be in IPFS. It can be in some external system. The example @daviddias links to above shows an example of linking directly to data in the Ethereum blockchain.

- The “resolver” doesn’t need to be deployed to all IPFS nodes, only those doing the requesting. The resolution happens before talking to other IPFS nodes.

---

<div class="post-metadata">

**Author:** ![flyingzumwalt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/flyingzumwalt/32/12_2.png) [@flyingzumwalt](https://discuss.ipfs.tech/u/flyingzumwalt)\
**Post date:** [July 13, 2017, 3:53pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/4 "2017-07-13T15:53:48Z")

</div>

@aboodman a lot of what you just outlined is possible because the CID implementation uses IPLD. IPLD is a data model that allows you to treat the entire universe of hash-linked data as a single information space. This is why you can have CIDs for non-IPFS content and can build tools like [git-remote-ipld](https://github.com/magik6k/hit-remote-ipld), which lets you add git repositories to IPFS and _uses the git hash as the IPFS identifier for stuff within that repo_ – it’s resolving git content over IPFS protocol using the original git hashes. [see [thread discussing git-remote-ipld](https://discuss.ipfs.tech/t/git-on-ipfs-links-and-references/730/3)

Read more about IPLD at [https://ipld.io](https://ipld.io)

---

<div class="post-metadata">

**Author:** ![es\_00788224](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@es\_00788224](https://discuss.ipfs.tech/u/es_00788224)\
**Post date:** [July 13, 2017, 6:03pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/5 "2017-07-13T18:03:20Z")

</div>

How does IPLD handle deduplication?

---

<div class="post-metadata">

**Author:** ![aboodman](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@aboodman](https://discuss.ipfs.tech/u/aboodman)\
**Post date:** [July 13, 2017, 6:11pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/6 "2017-07-13T18:11:04Z")

</div>

Thanks. Is it fair to say that CID is a serialization format for IPLD?

---

<div class="post-metadata">

**Author:** ![flyingzumwalt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/flyingzumwalt/32/12_2.png) [@flyingzumwalt](https://discuss.ipfs.tech/u/flyingzumwalt)\
**Post date:** [July 13, 2017, 6:31pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/7 "2017-07-13T18:31:18Z")

</div>

> How does IPLD handle deduplication?

I don’t understand this question. IPLD is a data model. Can you explain a scenario where you would want to use IPLD to handle deduplication?

---

<div class="post-metadata">

**Author:** ![es\_00788224](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@es\_00788224](https://discuss.ipfs.tech/u/es_00788224)\
**Post date:** [July 14, 2017, 1:26pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/8 "2017-07-14T13:26:25Z")

</div>

My bad, I misunderstood the concept. It’s only possible to link _to_ foreign data, not _from_ foreign data?

---

<div class="post-metadata">

**Author:** ![flyingzumwalt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/flyingzumwalt/32/12_2.png) [@flyingzumwalt](https://discuss.ipfs.tech/u/flyingzumwalt)\
**Post date:** [July 14, 2017, 3:30pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/9 "2017-07-14T15:30:54Z")

</div>

> [@aboodman](#):
>
> Is it fair to say that CID is a serialization format for IPLD?

Not quite. CID is an identifer scheme that happens to use IPLD. The [IPLD Spec](https://github.com/ipld/specs/tree/master/ipld#serialized-data-formats) includes info about serialization formats.

---

<div class="post-metadata">

**Author:** ![flyingzumwalt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/flyingzumwalt/32/12_2.png) [@flyingzumwalt](https://discuss.ipfs.tech/u/flyingzumwalt)\
**Post date:** [July 14, 2017, 3:45pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/10 "2017-07-14T15:45:10Z")

</div>

> [@es\_00788224](#):
>
> It’s only possible to link to foreign data, not from foreign data?

IPLD is an abstract data model. It basically says “all Merkle DAGs have basic properties in common, so let’s use those common properties to interlink DAGs across different systems.” This allows you to treat the entire decentralized web – and all DAGs anywhere – as one giant inter-linkable information space. This makes any system that uses IPLD really powerful and dynamic, opening lots of paths for interoperability.

If a system incorporates IPLD into its code, it can link to other hash-linked data in any system. So if two systems both use IPLD they will be able to bidirectionally reference each other’s data. If only one system uses IPLD and the other does not (ie. IPFS uses IPLD but git doesn’t) then your IPLD-based system (IPFS) can point into the other system’s data (git) but that other system won’t be able to point back.

The benefits of incorporating IPLD into your code base are huge, and the cost/overhead is minimal. That makes me suspect that we will see all hash-linked systems gradually incorporate IPLD, which will make the decentralized web exponentially more powerful and flexible.

---

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 29, 2017, 11:31am UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/11 "2017-08-29T11:31:48Z")

</div>

That link is now broken, I assume this is the same with a new name: [https://github.com/ipfs/js-ipfs/tree/master/examples/explore-ethereum-blockchain](https://github.com/ipfs/js-ipfs/tree/master/examples/explore-ethereum-blockchain)

Github needs content addressable links! 🙂

---

<div class="post-metadata">

**Author:** ![singpolyma](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/singpolyma/32/351_2.png) [@singpolyma](https://discuss.ipfs.tech/u/singpolyma)\
**Post date:** [October 2, 2017, 5:53pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/12 "2017-10-02T17:53:27Z")

</div>

If I understand correctly, this is allowing to use the identifiers of the other system to address the content, but the content still needs to be served by an IPFS daemon to be accessible, yes?

---

<div class="post-metadata">

**Author:** ![daviddias](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/daviddias/32/40_2.png) [@daviddias](https://discuss.ipfs.tech/u/daviddias)\
**Post date:** [October 21, 2017, 7:52pm UTC](https://discuss.ipfs.tech/t/how-can-i-link-to-a-different-kind-of-hash-based-system/762/13 "2017-10-21T19:52:16Z")

</div>

You are correct, it is the same tutorial just with a different name 🙂
