# Official reference regarding algorithm used for IPNS and for content hashing?

**URL:** <https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557>\
**Category:** Help\
**Created:** [July 1, 2020, 8:05am UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557 "2020-07-01T08:05:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [July 1, 2020, 8:05am UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/1 "2020-07-01T08:05:59Z")

</div>

I have seen mentioned in one of the threads here that IPFS uses Elliptic P256 algorithm for PeerId.  
Is there any official reference for this?

Also what is the current hashing algorithm being used for content addressing? I can’t seem to find this mentioned anywhere in the documentation.

---

<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:** [July 1, 2020, 10:33am UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/2 "2020-07-01T10:33:16Z")

</div>

This seem related: [https://docs.ipfs.io/concepts/content-addressing/#identifier-formats](https://docs.ipfs.io/concepts/content-addressing/#identifier-formats)

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [July 1, 2020, 4:52pm UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/3 "2020-07-01T16:52:12Z")

</div>

Indeed. What about the hashing algorithm used for peer identity?

---

<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:** [July 1, 2020, 5:47pm UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/4 "2020-07-01T17:47:03Z")

</div>

PeerIDs are usually equivalent to v0 cids (but they will be v1 cids soon), the hashed payload being the public key.

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [July 1, 2020, 6:04pm UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/5 "2020-07-01T18:04:26Z")

</div>

> the hashed payload being the public key

…and I am guessing that is ECDSA instead of say RSA? I remember checking the keys in the key-store once and I remember I could not introspect them using common openssl commands…which makes me wonder the more what algorithm and format they are

---

<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:** [July 1, 2020, 7:06pm UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/6 "2020-07-01T19:06:15Z")

</div>

It can be several key types. [https://docs.libp2p.io/concepts/peer-id/](https://docs.libp2p.io/concepts/peer-id/)

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [July 1, 2020, 9:10pm UTC](https://discuss.ipfs.tech/t/official-reference-regarding-algorithm-used-for-ipns-and-for-content-hashing/8557/7 "2020-07-01T21:10:16Z")

</div>

Thanks to your link I landed on the page on Github where the specification can be found. And I see the following:

> Four key types are supported:
> 
> - RSA
> - Ed25519
> - Secp256k1
> - ECDSA

Dropping the link here for others who might have the same question [https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md)
