karask / python-bitcoin-utils

Library to interact with the Bitcoin network. Ideal for low-level learning and experimenting.
MIT License
262 stars 99 forks source link

There is a difference between the nodejs bitcoinjs signature text information and the python-bitcoin-utils signature text information #103

Open wyq000 opened 4 days ago

wyq000 commented 4 days ago

The final length of the nodejs signature is 128 bits, why is the final length of the python-bitcoin-utils signature 130 bits? What causes this difference?

karask commented 3 days ago

Hi @wyq000 ,

The sizes of valid signatures can vary, even for the same txs. Are the txs you are comparing legacy or segwit/toproot?

Also, I always use bitcoin-core as reference (other libraries typically to the same). Iirc, there is only one case that bitcoin-utils' library produces different (valid!) signatures than bitcoin-core.

I could try to check this further if you provide the tx for me to check.