Open levz0r opened 6 years ago
This could also be easily achieved by a 3rd party developer, by creating a simple Dapp that uses one of our supported signature methods to recover the public key.
@danfinlay can you provide some code example?
I'm not very familiar with Web3 API, just started. And atm don't understand how I can achieve extended public key exporting with MetaMask
Can anybody help with this?
Seems like no one on stackoverflow can help too: https://ethereum.stackexchange.com/questions/48337/how-to-export-extended-master-public-key-from-metamask
You can use one of our signature methods to get a signature, and then use something like eth-sig-util to extract a public key from that signature.
This is just a single account's public key, though. I'm not very familiar with xpubs or their security features. We use ethereumjs-wallet under the hood, and it supports a few xpub methods, so we could presumably expose some xpub methods, but this would be an API changing feature request.
I would recommend submitting this as a proposal to Ethereum Magicians, so we can get some expert opinions on that potential feature.
@danfinlay It's definitely not possible to determine an xPub from a single sub pub/priv keypair. That would be a massive security leak and design flaw if that were the case.
You are correct there are methods to support export/display of the xPub key with ethereumjs (https://github.com/ethereumjs/ethereumjs-wallet/blob/cfe0f600880dc6df666f769e54c210ee05bcad47/README.md#hd-wallet-api), but these rely on knowing the seed phrase or the xPub/xPriv keys themselves. As I understand it, MM doesn't remember this information after the first time it's displayed, so maybe it's not possible?
I apologize for asking what may be an ignorant question, but what is the roll of Ethereum Magicians with regards to MetaMask? Why is it better to post a proposal there rather than directly with MM?
Thanks for clarifying, @EvilJordan.
Ethereum Magicians is meant to be a better EIP forum, where any cross-client standard (including new web3 methods) could be passed by the community.
It's especially useful when a method proposed would be cross-client, and so require buy-in from multiple clients (ideally), which is why this could be useful if you wanted Dapps to be able to request an xPub key.
That should be a UI only option (not API), similar to the private key export.
That option could be very usefull for importing into a watch only wallet. I also opened a feature request on MEX => https://github.com/MyEtherWallet/MyEtherWallet/issues/687
That's a very common feature with Bitcoin, that should gain traction in Ethereum imo...
Any solution in existing wallets for this?
Hello, This is a feature request. It would be great to have an option to export the Xpub key of my wallet(s).
Thank you