-
Notifications
You must be signed in to change notification settings - Fork 34
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
Failed to sign PSBT using ledger #64
Comments
What version of the ledger firmware and ledger Bitcoin app are you on? There have been some recent changes to the necessary apdus |
I was on 1.5.5 and upgraded to 1.6.0 yesterday, however that didn't change anything. Same error in both cases. |
are you signing witness or legacy inputs? My legacy support is spotty at the moment |
I skimmed the APDU code and tried to cross reference with the spec but I didn't get very far. Some things I noticed:
|
All native segwit unless I messed it up somewhere :D |
0x80 is usually a continuation flag. I'll try to take some time tomorrow to dive into this |
I tried to set the PoC up in a "nice" way :) |
The psbt crate has a basic ledger signer that I have run a few times. It's overdue for a refactor to deprecate the txin witness (see #44) |
Ah I missed that one, I was using the psbt stuff from Will give that a go and see if it works! |
its probably riddled with bugs 👌 |
I've pushed a branch here: https://github.com/thomaseizinger/rust-ledger-poc/tree/use-bitcoins-psbt Unfortunately, I can't even parse the psbt from base64 😬 That is the psbt I used:
I also needed to fix another compile error 😅 #65 |
this would be a (de)serialization issue. I have narrowed it down to an issue with the input bip32 derivation deserialization |
the schema was passing an incorrect length to the KeyDerivation deserialization. Fixed in 5668e6a |
I'll check your example routines when I get a second. Typically the 6985 error is triggered here: Code. It often means there was some missing information and a signature was requested before the device was ready to produce it. |
Thanks! I also stumbled over that code path in the source code but I couldn't really conclude on what to do differently as a result 😅 I will try again with the fix when I get around to it :) |
okay, I started a new job so progress on this issue has been slow. I pushed a branch that fixes osx compilation errors afaict |
Congratulations! :) That is okay, we ended up going back to using JavaScript and the ledgerjs package for what we are currently trying to achieve. I am still curious on what the issue is though! Note that I also opened LedgerHQ/app-bitcoin#164 although looking at the other issues, the Ledger team doesn't seem to give too much attention to the OSS community 🙃 |
if you're in JS, the WASM target uses the ledger JS transports and the PSBT should be able to sign with it. I still need to check your example and see where the bug is |
dropping this here for more digging |
I've been building a PoC for using this lib to sign PSBTs and I've run into an issue that I can't resolve.
My PoC is here: https://github.com/thomaseizinger/rust-ledger-poc
You can run the shell script with a ledger plugged in and it should error with:
Any ideas of what could be the issue?
The text was updated successfully, but these errors were encountered: