Closed ademcan closed 4 years ago
There is no guarantee that signatures are deterministic. Or that they are deterministic in the same way.
Please perform the two actions above and tell me if anything fails.
If both succeed this issue should be closed. Thank you.
Thank you very much Jonathan for your quick reply.
I realised that I have the same issue as in #20 where only the flag byte is different for simple strings (like 'test'). But when using a more complex message to sign the signatures are completely different.
I just would like to mention that I didn't have this problem with legacy addresses. I am using the same code as I did previously with a legacy address, here the only difference is the p2sh(p2wpkh) address, hence the {segwitType: 'p2sh(p2wpkh)'} option (and the private key obviously)
Sounds like Electrum differs from Trezor then.
non-legacy message signatures are not standardized, and we just followed Trezor.
ah, wait.
Are you converting the private key to the Electrum format for p2sh-p2wpkh?
That might be it
No, I am not converting the key, using directly the private key and then using: const keyPair = bitcoin.ECPair.fromWIF(pkey)
I am also wondering if the string handling is the issue, as Electrum probably considers \n differently than JS. I will come back to you after some more tests and close the issue if I find a solution.
Thank you @junderw, solved with the PR mentioned above!
I am trying to sign a message with a nested segwit address (3*). I got the address, the message and the private key, and also opened the wallet on Electrum. However, when signing with Electrum I get a different signature compared to when signing with bitcoinjs-message with the following code:
Do you have any idea what the issue could be? Thanks for your help and for the great work!