paulmillr / micro-key-producer

Produces secure keys and passwords. Supports SSH, PGP, BLS, OTP and many other formats
MIT License
34 stars 9 forks source link

Is it possible to implement extended private/public keys? #13

Closed barthuijgen closed 10 months ago

barthuijgen commented 10 months ago

The library https://github.com/paulmillr/scure-bip32/blob/main/index.ts implements extended keys where you can do hdkey.fromExtendedKey(master.publicExtendedKey).deriveChild(x)

I'm looking for this feature using ed25519 and found this nice hdkeys implementation: https://github.com/paulmillr/ed25519-keygen/blob/main/src/hdkey.ts it looks very similar to scure-bip32, I've tried porting over the code from scure-bip32 to use ed25519 but not to much success, so I figured I should just ask. Is this possible at all?

paulmillr commented 10 months ago

it may be possible

spec https://github.com/satoshilabs/slips/blob/master/slip-0010.md

barthuijgen commented 10 months ago

That page says this:

Public parent key → public child key This function always fails for ed25519 since normal derivation is not supported.

I'm looking to be able to derive from the public extended key so this seems to me like it won't be possible for ed25519?

paulmillr commented 10 months ago

seems like it

paulmillr commented 10 months ago

FYI non-hardened keys are not secure in terms of privacy.