eth-hd-keyring icon indicating copy to clipboard operation
eth-hd-keyring copied to clipboard

Replace `withAppKeyOrigin` option with `getAppKey`

Open Gudahtt opened this issue 6 years ago • 2 comments

The new getAppKey method will return the private app key derived from the provided origin. This serves as an alternative to optionally augmenting each keyring method with a set of options that may contain a withAppKeyOrigin value.

Moving app key generation to a single place makes it easier to limit access to sensitive information, such as the primary private keys. It also allows the consumer to use app keys more efficiently by using the same wallet for successive operations, rather than generating a new private key each time with keccak.

The private app key returned can itself be used to instantiate a new keyring instance, which allows app keys to perform all the same functions that a 'normal' key would allow.

Gudahtt avatar Nov 26 '19 07:11 Gudahtt

This depends upon https://github.com/MetaMask/eth-simple-keyring/pull/35 , and upon v4.0.0 of eth-simple-keyring being published.

Gudahtt avatar Nov 26 '19 07:11 Gudahtt

I will bump the version to v4.0.0 after eth-simple-keyring is published. I can't generate the correct lockfile until then anyway.

Gudahtt avatar Nov 26 '19 07:11 Gudahtt