Skip to content
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

feat: keepkey taproot support (ish) #701

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Dec 16, 2024

Description

"ish", as in we're building a correct payload that KeepKey is unable to understand because of firmware itself not supporting P2TR outputs.
This is more than likely related to https://github.com/keepkey/device-protocol being the source-of-truth for messaging on the device, and said library not being up-to-date with latest @trezor/protobuf (which @keepkey/device-protocol should be a superset of, and by extension, the device should understand the latest spec of).

Testing

Unfortunately, none. If you really want to test this, put a debugger breakpoint in newOutput after the setScriptType() call (see inline comments) and ensure that the scriptType is 6 i.e P2TR:

https://github.com/trezor/trezor-suite/blob/221fe9e7fcd29fc2ef5fa51ca2c22ba6a9369ef6/packages/protobuf/src/messages.ts#L127

Issue

Relates to shapeshift/web#8277

@gomesalexandre gomesalexandre requested a review from a team as a code owner December 16, 2024 11:05
Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hdwallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 11:05am

@@ -88,7 +94,9 @@ function prepareSignTx(
newOutput.setOpReturnData(output.opReturnData);
} else {
// BTCSignTxOutputSpend
newOutput.setScriptType(Types.OutputScriptType.PAYTOADDRESS);
newOutput.setScriptType(
output.address.startsWith("bc1p") ? PAYTOTAPROOT_PROTOBUF_SCRIPTTYPE : Types.OutputScriptType.PAYTOADDRESS
Copy link
Contributor Author

@gomesalexandre gomesalexandre Dec 16, 2024

Choose a reason for hiding this comment

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

Note this is not coming from Types.OutputScriptType but declared manually, see below in this diff.

I did try to install @trezor/protobuf (which @keepkey/device-protocol should be a superset of, but is outdated) and consume those types directly instead of the ones from @keepkey/devices however build was failing with a gazillion of @shapeshiftoss/bitcoinjs-lib build errors

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.

1 participant