-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CScript.witness_version() returns 0x51 instead of 1 for taproot #79
Comments
Maybe I should do |
instead of |
I am going to release @kristapsk @AdamISZ @jonasnick plz check |
It looks JoinMarket doesn't call |
@dgpv You could add commit with fix to some branch, then I can test JoinMarket against it, just in case. |
While at it, I decided to change the way secp256k1 library handle and library capabilities is accessed. This allowed the path change to take effect even if This change too can cause breakage in the code that used The changes (including of course the If you can test this changes, that would be great |
This currently breaks JoinMarket, will look at it. If others want to take a look, here's JM changes to install this branch of python-bitcointx. kristapsk/joinmarket-clientserver@2aa06a3 |
Can you tell me how it breaks ? Maybe I can adjust the code to make it more backward-compatible |
|
Ah, yes, this is the expected breakage. It seems that your project uses secp256k1 module directly. In the current code (edit: this is changed already, look in messages below), to get the library handle, you need to call I am now thinking that maybe combining this into one function is better - just return the class that will contain the handle, contexts, and capabilities together. The fact that I will soon update the branch with changes. Yes, there will be breakage, but this is for the better. |
I have updated the code in Please look into this commit cda4b6b to understand how to work with secp256k1 from python-bitcointx from now on. Any comments on the changes are welcome. |
I have released version 1.1.5 with the fixes and changes. Closing this. |
@kristapsk I'll make a branch to update JM for the new API from this version of python-bitcointx. This only affects PoDLE calculation in secp256k1_main.py, I believe. |
It can be said that this is an oversight when implementing taproot support.
The original code from python-bitcoinlib simply returned the first byte of the script as witness version. This worked while the only valid version was zero (petertodd#298).
Correct way would be to do
decode_op_n()
on that first byte before returning it.The problem that it is now already in the library and some code might depend on it returning 0x51
I need to decide how to handle this situation.
Do I simply fix it straightforwardly, and allow the behavior of
witness_version()
to change ? This might break existing code that relies onwitness_version()
returning 0x51 for taproot outputs. I have no way to know if there is such code out there.I can add
CScript.witness_version_value()
that will return decoded version, but then having alsowithess_version()
will be confusing.Shall I remove
witness_version()
altogether to prevent any confusion and replace it witwitness_version_value()
?Or shall I ignore the possibility that there's code that relies on
witness_version()
returning 0x51 for taproot outputs, and fix this straightforwardly ?Can't decide.
The text was updated successfully, but these errors were encountered: