Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

node.key.gen('name', { type: 'ed25519', size: 256 }) does not work #2553

Closed
Bluebie opened this issue Oct 21, 2019 · 4 comments
Closed

node.key.gen('name', { type: 'ed25519', size: 256 }) does not work #2553

Bluebie opened this issue Oct 21, 2019 · 4 comments
Labels
exp/expert Having worked on the specific codebase is important kind/feature P1 High: Likely tackled by core team if no one steps up status/in-progress In progress topic/libp2p Topic libp2p

Comments

@Bluebie
Copy link

Bluebie commented Oct 21, 2019

  • Version: { version: '0.38.0', repo: 7, commit: '' }
  • Platform: macOS Catalina (nodejs v12.12.0 via Homebrew)
  • Subsystem: libp2p-keychain?

Type:

Bug

Severity:

Medium

Description:

despite documentation, js-ipfs does not support generating ed25519 keys. libp2p-keychain throws an error that ed25519 keys do not have an export function when ipfs.key.gen is called

Steps to reproduce the error:

> const IPFS = require('ipfs'); let ipfs = (new IPFS({ pass: "01234567890123456789" }))
> ipfs.key.gen('ed', { type: 'ed25519', size: 32 })
Promise { <pending> }
> Thrown:
TypeError: keypair.export is not a function
    at ./node_modules/libp2p-keychain/src/keychain.js:215:25
    at ./node_modules/libp2p-crypto/src/keys/ed25519-class.js:97:7
@achingbrain
Copy link
Member

I think this is because the underlying libp2p-crypto module can't export ed25519 keys in the pem format, because the underlying node-forge module doesn't support it, though they are accepting pull requests.

@achingbrain
Copy link
Member

More discussion here: libp2p/js-libp2p-crypto#145

@alanshaw
Copy link
Member

I've updated the JS core interface documentation to clarify the situation ipfs-inactive/interface-js-ipfs-core#549

@alanshaw alanshaw added exp/expert Having worked on the specific codebase is important kind/feature status/in-progress In progress topic/libp2p Topic libp2p labels Oct 29, 2019
@jacobheun jacobheun added the P1 High: Likely tackled by core team if no one steps up label Jun 3, 2020
@jacobheun
Copy link
Contributor

Fixed in #3212

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/feature P1 High: Likely tackled by core team if no one steps up status/in-progress In progress topic/libp2p Topic libp2p
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants