cryptolandtech / moonlet

Moonlet is a portal to the decentralised world.
https://moonlet.xyz/
MIT License
16 stars 5 forks source link

Wrong private key displayed #128

Closed micovi closed 5 years ago

micovi commented 5 years ago

I am trying to export my account via private key, but the key provided in settings is wrong. When I am using zilliqa-js library function CP.getAddressFromPrivateKey(privkey); it's returning me a different address.

Can you help me with details about how can I get the good private key for the address displayed in the Moonlet?

Thanks

krisboit commented 5 years ago

@micovi i assume you are using the latest version from Chrome store, right ?

I will try to reproduce your problem as soon as possible (most probably in a few hours).

micovi commented 5 years ago

@krisboit yes, I just installed the extension from Chrome store.

You can reproduce by next steps:

I am using Chrome Version 73.0.3683.75 (Official Build) (64-bit) on OSX if it makes any difference.

krisboit commented 5 years ago

@micovi i took a look, everything seems to be fine in Moonlet, i think i know what's the problem.

Moonlet will give you the private key in this format: 0x1234...

When you use zilliqajs library you need to drop the 0x

const CP = require('@zilliqa-js/crypto');
console.log(CP.getAddressFromPrivateKey("1234..."));

Give it a try and let me know about the results :)

micovi commented 5 years ago

It works now, I haven't noticed the 0x in front of the privatekey.

thank you for your help :)