Web3Auth / mpc-core-kit

16 stars 4 forks source link

[v3] wrong signature generated for transaction #148

Closed AyushBherwani1998 closed 4 months ago

AyushBherwani1998 commented 4 months ago

Description

Looks like some other account is being used to generate the signature for sending the transaction. I tried to decode the signature, and from address is different, which results in insufficient funds in account error.

Check the from, it's not the same as the From address which results in insufficient funds from the RPC .

Reproducible Steps:

  1. Use the v3 branch demo
  2. In sendTransaction method add signTransaction to generate signature for the transaction as well.
    try {
      const receipt = await web3.eth.signTransaction({
        from: fromAddress,
        to: destination,
        value: amount,
      });
      uiConsole(receipt);
    } catch (e) {
      uiConsole(e)
    }
  3. Switch to Polygon mainnet
  4. Try to sendTrasnaction and generate the signature
  5. Decode the signature
matthiasgeihs commented 4 months ago

The issue was that makeEthereumSigner did not specify that the input was a hash.

Pushed a fix to https://github.com/Web3Auth/mpc-core-kit/pull/147.

AyushBherwani1998 commented 4 months ago

Works fine in v3-alpha

matthiasgeihs commented 4 months ago

Resolved in #147