-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitcoin Core 0.20.1 seems to cause an issue with wally_psbt_sign #213
Comments
Workaround: running the following logic before signing will allow you to sign: For each input, if utxo and witness utxo are both present, delete utxo That undoes the core 20.1 change so the current signing logic will work; its not a proper fix but should get you going. |
@jgriffiths Thanks for the tip, I can easily just fork the repo make my changes then and use my fork as a dependency while I wait. Cheers :) |
@Fonta1n3 I don't have much time to look at this, but if you have a testnet/regtest PSBT from core 20.1 and a private key that would sign it correctly if it was from an earlier version of core, please paste it here in base64, and when I get a chance I'll see if we can fix this simply. The signing logic needs reworking and support for bip32 key signing but it might be a while before I can get to that due to other more commitments right now. |
@jgriffiths I would really greatly appreciate it, because my app is so reliant on Bitcoin Core and Libwally and it is incorporated in node boxes like Nodl, myNode, BTCPayServer I can not simply stop people from updating... I can hack, but C code scares me.
The two signing keys:
|
@Fonta1n3 Thats helpful, thanks - can you also post the result of your signing this with core 20.1? |
@jgriffiths The above actually is signed, but with Libwally of course. Or do you want me to import the WIF's into core then use walletprocesspsbt? |
@jgriffiths I have been testing with removing the Strangely even when I've bypassed bitcoind and am trying to finalize with Libwally instead which does at least finalize the psbt but I always get an error when broadcasting (scriptsig field is always empty):
|
I was hoping for this yes, it will let me check the core result vs wally (for various reasons I dont have v20.1 handy to test right now). |
@jgriffiths Ok, I have recreated the psbt after importing the two WIF's above using 0.20.1.
If you need any other info please do let me know, and thanks very much for your time. |
Hi @Fonta1n3 please try #215 - this includes a fix and test case showing wally now produces the same result as core with the above inputs. If you encounter any more signing issues and can provide the same test case info as your last commit that would really help when fixing. If you can confirm that PR works for you, I'll clean it up and get it reviewed for master. Thanks! |
@jgriffiths Thank you very much, I am going through it. A number of changes seem to break libwally-swift's PSBT.swift so its going to take me a little while.. |
@jgriffiths I was unfortunately unable to cope with all of the changes that are in your PR due to the fact I am (as I said above) working via the libwally-swift wrapper.. However!! I saw you commit message |
I am working off of 0.7.7 so its really only relevant to that codebase but here is the updated
|
@Fonta1n3 Great that you can confirm the fix. We will get this out in a v0.7.9 release at some point and libwally swift can do the upgrade for you (there are a lot of other fixes in the changes that you should really pick up). I'm closing this now in expectation of #215 being merged shortly. Thanks for your help again. |
I have been using LibWally 0.7.7 (via libwally-swift) heavily in my apps for signing psbt's locally. However after updating Bitcoin Core to 0.20.1 I am having major issues which break the apps signing ability.
Please bitcoin/bitcoin#19650 for details. Just so the flow is clear:
bitcoin-cli walletcreatefundedpsbt
wally_psbt_sign
to sign the psbt with child private key that matches the inputs pubkey, which does in fact sign and can be seen in the decoded psbtbitcoin-cli finalizepsbt
does not recognize the psbt as complete and will not finalize itIf I bypass
bitcoin-cli finalizepsbt
and use LibWally to finalize it does return a hex encoded raw transaction but when attempting to broadcast I get:To me it is clearly the recent change where both
non_witness_utxo
andwitness_utxo
are added to the psbt which may be confusing LibWally.If you have some idea of how I may fix this issue please do let me know, for now I have to advise users so simply avoid updating Bitcoin Core as they will not be able to spend their btc.
The text was updated successfully, but these errors were encountered: