Nethereum.SimpleWindowsWallet icon indicating copy to clipboard operation
Nethereum.SimpleWindowsWallet copied to clipboard

Private Key Import is expecting a file with a JSON string but Metamask only produces a simple hex string in the file it exports

Open mwherman2000 opened this issue 7 years ago • 2 comments

I'm using Metamask to export my private key. It exports it as a simple hex string of characters - not a JSON structure.

The Wallet expects a JSON formatted private key.

Can you add support for the Metamask formatted private key?

Best regards, Michael Herman (Toronto)

mwherman2000 avatar Jan 13 '18 20:01 mwherman2000

HACK: as QnD workaround, I made the following change to LoadPrivateKey() and it worked:

// var privateKey = service.DecryptKeyStoreFromJson(Password, json).ToHex(); string privateKey = json; // HACK: works for Metamask exported private keys

mwherman2000 avatar Jan 13 '18 20:01 mwherman2000

Hmmm when you export a private key from metamask you get the private key. Not the KeyStore file.

juanfranblanco avatar Jan 14 '18 19:01 juanfranblanco