How can I set my own ed25519 key?

Now that ipfs is using ed25519 by default… Instead of using “ipfs init” to generate a random identity, I would like to create and set my own ed25519 key pair. Is it possible?

Thanks

There is no external CLI command to set the libp2p node’s private key. If you wanted to take an existing ed25519 key and use it you could modify your config file appropriately to generate libp2p keys according to the spec.

If you’re using the keys for IPNS publishing (instead of the libp2p identity key) you can import/export keys with the new ipfs key import/export

1 Like

ipfs key rotate or https://github.com/whyrusleeping/ipfs-key

1 Like

I would like to convert pubsec (base58) keys from https://cesium.app

Type: PubSec
Version: 1
pub: BNJDrwA9tRQAnCu82JUo6BnXCU8WFGHMjzPYG7r7JBUv
sec: 55kzhEqc9gsdJqDsG5Y5cAUoLfXCg8GvBh9GivRSsxMKEQcotRwmt9F35yERpT3WeXbtwYkhVoGAZMsXEFFD1u7x

compared to ~/.ipfs/config

{
  "Identity": {
    "PeerID": "12D3KooWNVNzjKcgJKLQHAdgVLVjNQgZYNFExxaCEGtWzA1dopWw",
    "PrivKey": "CAESQGEmzRPrd4P4FKI9Y8bzepjmXyf+8WFVzeSYuKxoaozlvErUhOLxFZc4rceGYXjngqvsILtAxxfyrnYmJcvSx5Q="
  },

It seems to have some representative base difference… base64, multihash prefix?
any help is welcome :sunny: