-
Notifications
You must be signed in to change notification settings - Fork 47
Description
There is a scenario where the signature produced by bitcoin-lib is different than the one made by bitcoin-core, it's a legacy multisig (P2SH) with 2-of-2 signatures required. For clarity i reproduced the issue in bitcoin using regtest mode and comparing the produced scriptSig with the one from bitcoin-lib,
the example is located here, to run the test:
$ test/functional/regtest_signature.py
The test in bitcoin-lib tries to sign the same input of the same transaction (also with same private keys)
and results in a mismatch of the signature (specifically the last in the 2-of-2), this is located here.This test shows that the signature script (for legacy p2sh multisig) produced in this case is different from the one made by bitcoin-core. I also added sighash tests (both in bitcoin-core and bitcoin-lib) to check that we're signing the same data, those test can be found in the same git branch of the above examples.