CRYPTO NEWS

Ethers.js and Metamask RPC Error Already processing eth_requestAccount

I’m having a problem using Metamask with Ethers.js. I have the following set-up:

Metamask installed on Edge browser.
Hardhat localhost node.
Node.js localhost http server.

I can connect to Hardhat via Metamask without any problems, but if I close the browser and open it again (or just "Lock" Metamask to logout) I can no longer connect to Metamask and instead get this error:

RPC Error: Already processing eth_requestAccounts. Please wait. {code: -32002, message: ‘Already processing eth_requestAccounts. Please wait.’}

No matter how long I wait I get the above error. I understand what the message means, but don’t see any reason why it should appear in these circumstances.

Here’s my (abbreviated) code:

provider = new ethers.providers.Web3Provider(window.ethereum); await provider.send("eth_requestAccounts", []); 

I want Metamask to pop-up as normal and ask for a password and it doesn’t. I have to open Metamask, login, disconnect "localhost" from the list of connected sites, then I can connect via the above code. But as I said, if I then logout of Metamask or close and re-open the browser, I get the RPC error.

I’d really appreciate any help on this!

How is ECDH shared secret represented in SoftHSM

I am working on implementing ECDH with some HSM. According to the theory behind ECDH, the generated shared secret is a point on the elliptic curve (x, y) which is exactly what is returned by the HSM. But when I test with SoftHSM via PKCS#11 library, the ECDH function returns a symmetric key directly even::Listen

I am working on implementing ECDH with some HSM. According to the theory behind ECDH, the generated shared secret is a point on the elliptic curve (x, y) which is exactly what is returned by the HSM.

But when I test with SoftHSM via PKCS#11 library, the ECDH function returns a symmetric key directly even with KDF parameter set to null. I did some research and found that some bytes of the shared secret is returned as the value of the symmetric key: https://github.com/google/boringssl/blob/master/include/openssl/ecdh.h#L82

However, I am confused how such operation can be performed on the shared secret if it is represented in the form of a EC point (x, y).

Does anyone know how SoftHSM handles ECDH with KDF parameter as null? Especially, what form is the shared secret in after being generated in SoftHSM but before being processed and put in a key object?

Thanks

Ethers.js and Metamask RPC Error Already processing eth_requestAccount

Shopping cart
There are no products in the cart!
Continue shopping
0