Skip to content

Conversation

@benma
Copy link
Contributor

@benma benma commented Sep 17, 2025

BitBox needs access to the input's previous
transactions (NonWitnessUTXO in PSBT-jargon) if not all inputs are Taproot. Since it can be costly to retrieve them, client's can check if they are needed using this function before providing them.

When signing using BTCSign() directly, one could do this with BTCSignNeedsPrevTxs(), but that is not compatible with PSBT signing workflow.

A small complication: BitBox has a bug (to be fixed in a future FW version) where the previous transactions are required, even if all inputs are Taproot - when an output is marked as belonging to the same account (change or otherwise) but the output is a non-Taproot output. The function as it is now aligns with this bug, and will be extended/corrected once the FW with the bugfix is available. When that happens, the TestSimulatorBTCPSBTTaprootSpendsToNonTaproot can be adjusted.

Copy link
Collaborator

@bznein bznein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

})
}

// All inputs are Taproot, but the change output is not Taproot. Some BitBox firmwares erroneouslyc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// All inputs are Taproot, but the change output is not Taproot. Some BitBox firmwares erroneouslyc
// All inputs are Taproot, but the change output is not Taproot. Some BitBox firmwares erroneously

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

BitBox needs access to the input's previous
transactions (NonWitnessUTXO in PSBT-jargon) if not all inputs are
Taproot. Since it can be costly to retrieve them, client's can check
if they are needed using this function before providing them.

When signing using `BTCSign()` directly, one could do this with
`BTCSignNeedsPrevTxs()`, but that is not compatible with PSBT signing
workflow.

A small complication: BitBox has a bug (to be fixed in a future FW
version) where the previous transactions are required, even if all
inputs are Taproot - when an output is marked as belonging to the same
account (change or otherwise) but the output is a non-Taproot
output. The function as it is now aligns with this bug, and will be
extended/corrected once the FW with the bugfix is available. When that
happens, the `TestSimulatorBTCPSBTTaprootSpendsToNonTaproot` can be
adjusted.
@benma benma merged commit aaf0e94 into BitBoxSwiss:master Sep 17, 2025
3 checks passed
@benma benma deleted the needs-prevtxs branch September 17, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants