buidl-bitcoin / buidl-python

python3 bitcoin library with no dependencies and extensive test coverage
https://pypi.org/project/buidl/
MIT License
83 stars 26 forks source link

WIP implementation of BIP322 #140

Open wip-abramson opened 2 years ago

wip-abramson commented 2 years ago

This P.R. adds basic support for bip322 signatures following a similar API to the current open P.R. in Bitcoin core (See https://github.com/bitcoin/bitcoin/pull/24058)

There are a few areas that still need some work:

Open to suggestions for how to restructure this to align with the existing library.

Additionally, would be interested in thoughts around this thread - https://github.com/bitcoin/bitcoin/pull/24058/files#r872561862. I was expecting to be able to reproduce the same signature as provided in the bip. But ended up producing a different, valid signature for the same address, message pair. Does this indicate that there is a mismatch between how RFC6979 is implemented between buidl-python and bitcoin core?

Finally, I want to acknowledge Digital Contract Design and @rxgrant for funding my work on this P.R. to date.

Any time you have to review this much appreciated, thanks!

wip-abramson commented 2 years ago

I'd also like to propose either:

This is because currently these fail for bip322 Txs because no fee is specified (None is required)