You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
const bitcore = require("bitcore-lib");
const PublicKey = bitcore.PublicKey;
const Script = bitcore.Script;
var publicKey1 = new PublicKey(
"02a9d50f9817a9cf20f3feb7ad4038e88c8bd471e90dfba3a80c2e0bfd79c89312"
); // public key for path- 44'/0'/0'/0/0
var publicKey = new PublicKey(
"02faf805ea3652cec322dda6f7571d926f359d8abbd73af1512924151edbec90e7"
); // public key for path- 44'/0'/0'/0/1
var pubkeys = [publicKey, publicKey1];
var redeemScript = Script.buildMultisigOut(pubkeys, 2);
console.log(redeemScript.toHex());
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:
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.
The text was updated successfully, but these errors were encountered: