# PeerID key pair algorithm on IPFS

**URL:** <https://discuss.ipfs.tech/t/peerid-key-pair-algorithm-on-ipfs/15063>\
**Category:** Help\
**Tags:** js-ipfs, go-ipfs\
**Created:** [August 29, 2022, 1:51pm UTC](https://discuss.ipfs.tech/t/peerid-key-pair-algorithm-on-ipfs/15063 "2022-08-29T13:51:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zesor1](https://avatars.discourse-cdn.com/v4/letter/z/8c91f0/32.png) [@Zesor1](https://discuss.ipfs.tech/u/Zesor1)\
**Post date:** [August 29, 2022, 1:51pm UTC](https://discuss.ipfs.tech/t/peerid-key-pair-algorithm-on-ipfs/15063/1 "2022-08-29T13:51:08Z")

</div>

Hello, i need to understand how peerID is create from scratch, i saw the source code of js-libp2p-peerID and i found that 3 algorithms is up to create the private and the public key of a peer. RSA, ed25519 and secp256k1 are used for. My question is, there is a parameter to choose which of those we can use to generate key pair ? Or maybe in the go implementation this is different and only one of this has been used ?

---

<div class="post-metadata">

**Author:** ![adin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/adin/32/2679_2.png) [@adin](https://discuss.ipfs.tech/u/adin)\
**Post date:** [August 29, 2022, 1:53pm UTC](https://discuss.ipfs.tech/t/peerid-key-pair-algorithm-on-ipfs/15063/2 "2022-08-29T13:53:20Z")

</div>

Checkout the specs [specs/peer-ids.md at master · libp2p/specs · GitHub](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md).
