kadena-io / pact-lang-api

BSD 3-Clause "New" or "Revised" License
20 stars 16 forks source link

restoreKeyPairFromSecretKey #17

Closed TheTrunk closed 4 years ago

TheTrunk commented 4 years ago

This PR adds restoreKeyPairFromSecretKey function allowing to obtain a keyPair (mainly we need publicKey) from a given secretKey. The purpose is that wallets, like ZelCore, need to be able to use deterministic derivation of keypairs without storing any values. This method allows wallets use their own secretKey obtaining the needed publicKey respecting derivation path. In background nacl.sign.keyPair.fromSeed is used. Test provided.