shapeshift / hdwallet

A library for interacting with hardware wallets from JS/TS.
https://hdwallet.shapeshift.now.sh/
MIT License
208 stars 89 forks source link

Error: The y-parity of the transaction should either be 0 or 1 #327

Closed turboboost55 closed 3 years ago

turboboost55 commented 3 years ago

I'm experimenting with the sandbox sample app, and get the following error in the debug console:

eip1559Transaction.ts:220 Uncaught (in promise) Error: The y-parity of the transaction should either be 0 or 1
    at new FeeMarketEIP1559Transaction (eip1559Transaction.ts:220)
    at Function.FeeMarketEIP1559Transaction.fromTxData (eip1559Transaction.ts:87)
    at Object.<anonymous> (ethereum.ts:166)
    at step (index.js:68)
    at Object.next (index.js:68)
    at fulfilled (index.js:68)
FeeMarketEIP1559Transaction @ eip1559Transaction.ts:220
FeeMarketEIP1559Transaction.fromTxData @ eip1559Transaction.ts:87
(anonymous) @ ethereum.ts:166
step @ index.js:68
(anonymous) @ index.js:68
fulfilled @ index.js:68
Promise.then (async)
step @ thorchainTx.json:1
(anonymous) @ thorchainTx.json:1
__awaiter @ thorchainTx.json:1
(anonymous) @ index.ts:1301
dispatch @ jquery.js:5430
elemData.handle @ jquery.js:5234

Repro Steps:

  1. Open the sandbox
  2. Pair your Keepkey device
  3. Click on the "EIP-1559?" button
  4. Click on the "TX" button
  5. Press the button on the keepkey twice to confirm
  6. Observe nothing shows up in the results text box just below the buttons
  7. Observer the error message in the debug console

KK Model: K1-14AM Firmware: v7.1.8

The error is being thrown in eip1559Transaction.ts:220

    if (this.v && !this.v.eqn(0) && !this.v.eqn(1)) {
      throw new Error('The y-parity of the transaction should either be 0 or 1')
    }

I put a breakpoint on ethereum.ts:164 and observed that the v value was "0x26". Don't know what that means unfortunately.

turboboost55 commented 3 years ago

Any response on this? Currently it does not seem possible to sign an EIP-1559 tx with the Keepkey, which is a bummer. Is Shapeshift committed to supporting EIP-1559 on the Keepkey?

mvpratt commented 3 years ago

@turboboost55 EIP1559 will be supported in the next release. we are putting the finishing touches on right now.

cc @markrypto

markrypto commented 3 years ago

This should be fixed now. You need to update both hdwallet and Keepkey firmware to get correct eip-1559 transactions in the sandbox.