Skip to content

Bitcoin-lib may produce valid but different signatures from bitcoin-core #25

@araspitzu

Description

@araspitzu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions