-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allowing both nonWitnessUtxo and witnessUtxos on inputs to allow creating PSBTs for Trezor signing #1595
Comments
remove the witnessUtxo first. Why are both required? nonWitnessUtxo contains all the information in witnessUtxo. |
Nowhere does it say on their blog it needs both. They say to supply nonWitnessUtxo in all cases. So instead of adding witnessUtxo only add nonWitnessUtxo. If some other app is adding it and sending it to your app, tell them to only have one. |
Hey Jon, thanks for your prompt response per usual. I went ahead and removed the witnessUtxo and the witnessScript and replaced them with the nonWitnessUtxo and redeemScript. I then sent the PSBT to the Trezor using the newest version of HWI but kept getting I went and commented out lines 98-100 in the BIP174 package, added the witnessUtxo, witnessScript back and removed the redeemScript, constructed the PSBT and sent it to the Trezor using HWI and it worked flawlessly. You are right from my understanding, I don't know why I would need both the nonWitnessUtxo in addition to the witnessUtxo and witnessScript since those should both be in the nonWitnessUtxo. From the conversations I have read about it I think there is some sort of detection of Segwit inputs that happens and if it detects that it also checks for nonWitnessUtxo? (basically the they decided to just throw the full tx on the nonWitnessUtxo field to make sure there isn't a massive fee). Again, I'm not super well versed in what is going on behind the scenes. It seems that because of this recent BIP174 bug, and the patch that Trezor has decided to employ, we need both in order for the Trezor to be able to sign (which sucks). |
You should not change witnessScript to redeemScript. That is your problem. |
I am trying to send a transaction and sign it with a Trezor One hardware wallet. With the latest firmware, they require including the previous transaction hex to prevent the recent fee attack that could happen on hardware wallets.
I read through this thread that had a similar issue, but this was before the bug was announced.
When I try to add the nonWitnessUtxo I get
Error: Can not add duplicate data to input
Some other links I found relating to it:
https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd
bitcoin-core/HWI#338
The text was updated successfully, but these errors were encountered: