Hi @gre , @dhoffmann, @rottenbytes, @fdv, @hyperbolist
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.
Although the same thing is working fine for Bitcoin transactions but the same code when I try to use to sign Bitcoin Cash transaction is not working properly since its producing invalid signature from Ledger Nano S device.
I will detail script here, though I am not sure what shall I change if I need to sign bitcoin cash transaction via 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(
"020a11b1f12e72bfd6c3d6ff57307eef68b970da73f8b6084d6b40fbb5c7e432e2"
); // public key for path- 48'/0'/0'/101/0/0
var publicKey = new PublicKey(
"0259b0fc383c913bcea795c870cf2a554014f804e00a9539a6e6ed443a6479b1f5"
); // public key for path- 48'/0'/0'/102/0/0
var pubkeys = [publicKey, publicKey1];
var redeemScript = Script.buildMultisigOut(pubkeys, 2);
console.log(redeemScript.toHex());
It returns the following Signature when I send call send data to ledger via signP2SHTransaction method:
Sig hash: [ '3045022100b9a7763fb2264e444f18390e6d5033aa652a68dc5534dc1e3bf2250d1606d8380220794b320322f03e38d258094a4edb869714591fe6678e26ea29436163c117f3c1' ]
This signature is unable to sign the transaction in a proper manner and it error while I validate it against the transaction.can you please help me.
What shall i use when wish to sign the bch transaction from ledger nano s device.
Hi @gre , @dhoffmann, @rottenbytes, @fdv, @hyperbolist
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. Although the same thing is working fine for Bitcoin transactions but the same code when I try to use to sign Bitcoin Cash transaction is not working properly since its producing invalid signature from Ledger Nano S device.I will detail script here, though I am not sure what shall I change if I need to sign bitcoin cash transaction via 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-
48'/0'/0'/101/0/0
. 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:It returns the following Signature when I send call send data to ledger via
signP2SHTransaction
method:This signature is unable to sign the transaction in a proper manner and it error while I validate it against the transaction.can you please help me. What shall i use when wish to sign the bch transaction from ledger nano s device.