Open blockchainguyy opened 6 years ago
I also experienced this issue, while working with ledgerjs -- and I think the issue lies there, not in the hw app. The transaction preparing code in @ledgerhq/hw-app-btc
assumes that non-segwit signing transactions won't have inputs which are segwit.
Have this exact issue as well, did you find any resolution @kantai @ayush-techracers? Seems odd that this means you can only include pure legacy utxos in a legacy transaction. Can see this issue being very common.
I was receiving Errors while using signatures produced by
signP2SHTransaction
function of@ledgerhq/hw-app-btc
. So I created a script using bitcore-lib to cross check it against the signature produced by Ledger and pinpoint the change causing the Error. I also verified all my input params and found them to be correct.I will detail both scripts here, though I think it is an issue of ledger's signP2SHTransaction function.
I'm using the following dependencies and node
v8.9.3
:I have created a 2 of 2 Multisig address using the following 2 paths of my ledger-
44'/0'/0'/0/0
,44'/0'/0'/0/1
. I used the following rawTx:I used the following Redeem Script:
Here's the code I used to produce it:
You can decode it here: https://live.blockcypher.com/btc/decodetx/ Here is my ledger's code which is creating a signature for
48'/0'/0'/69/0/0
path:So as I am using the above code when I toggle to segwit as true in calling Ledger P2SH function
signP2SHTransaction
. The ledger device accepts the provided input data and produces the invalid signature.When I toggle to segwit as false in calling Ledger P2SH function
signP2SHTransaction
. The ledger device throws this error:TransportStatusError: Ledger device: Internal error, please report (0x6faa)
While my its legacy transaction so It must run without setting segwit to true. So could you please suggest what might be the problem.