web3-react-native icon indicating copy to clipboard operation
web3-react-native copied to clipboard

Extra feature

Open andylim0221 opened this issue 4 years ago • 4 comments

Wonder if we can consider to push features such as extracting private key from keystore available for this package?

andylim0221 avatar Jun 28 '20 16:06 andylim0221

Hey @andylim0221,

Thanks for getting in touch! Sounds good to me. 🚀

Can you propose which existing Web3 APIs you think would be needed to achieve this? Then we'd be able to treat those as a reference. One thing to keep in mind is that this functionality of course might only be available if it is exposed by the native dependencies we're using in this project. But if this is standard behaviour, they should be there.

cawfree avatar Jun 30 '20 22:06 cawfree

In web3, there's web3.eth.accounts.decrypt(keystoreJsonV3, password) which takes keystoreJsonV3 and password as parameters. From my last project, we load the keystore file in and process decryption in native modules with web3j and web3swift respectively. I think it's worth to try out if you have any alternatives.

andylim0221 avatar Jul 02 '20 02:07 andylim0221

Hey @andylim0221, sounds good to me!

It looks like we can get the private key on iOS. It might take a little more searching for a similar function in web3j on Android... I'm sure it must be there somewhere.

cawfree avatar Jul 08 '20 01:07 cawfree

This line seems to provide us with the equivalent key pair, so we should be able to retrieve the private key from here.

cawfree avatar Jul 08 '20 08:07 cawfree