Comments (19)
its probably riddled with bugs 👌
from coins.
the schema was passing an incorrect length to the KeyDerivation deserialization. Fixed in 5668e6a
from coins.
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
from coins.
What version of the ledger firmware and ledger Bitcoin app are you on? There have been some recent changes to the necessary apdus
from coins.
I was on 1.5.5 and upgraded to 1.6.0 yesterday, however that didn't change anything. Same error in both cases.
from coins.
are you signing witness or legacy inputs? My legacy support is spotty at the moment
from coins.
I skimmed the APDU code and tried to cross reference with the spec but I didn't get very far.
Some things I noticed:
- P2 for UNTRUSTED_HASH_TX_INPUT_START is always set to
0x02
(https://github.com/summa-tx/bitcoins-rs/blob/master/ledger-btc/src/utils.rs#L65) although the spec says it should be set to0x80
in some cases: https://blog.ledger.com/btchip-doc/bitcoin-technical-beta.html#_untrusted_hash_transaction_input_start - Your code is making use of
response_length
. I ran this other example and that one worked although that one is using a hardcoded transaction and that is not using response length.
from coins.
are you signing witness or legacy inputs? My legacy support is spotty at the moment
All native segwit unless I messed it up somewhere :D
But the inputs are all funded to bech32 addresses and I am spending to bech32 as well.
from coins.
0x80 is usually a continuation flag. I'll try to take some time tomorrow to dive into this
from coins.
I tried to set the PoC up in a "nice" way :)
You should be able to run it (see the included shell script) end to end with the ledger plugged in if that helps with anything!
from coins.
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)
from coins.
Ah I missed that one, I was using the psbt stuff from rust-bitcoin
😅
Will give that a go and see if it works!
from coins.
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 😬
It fails with: Error: failed to fill whole buffer
That is the psbt I used:
cHNidP8BAHECAAAAAeBANSdI+VT5VJvVfchN4UEUniZ5cfeucBkBuoA475wjAAAAAAD+////AgDh9QUAAAAAFgAU7gEhvO/VGbeMDvk2DeqaTVkRQh8AERAkAQAAABYAFCQ8xyUkB4v4DqmV7T6aVADqs8M5AAAAAAABAR8A8gUqAQAAABYAFO4BIbzv1Rm3jA75Ng3qmk1ZEUIfIgYDbXrhM7lpiaTJhxwJSplsX1r33gCcoD9xL4wEteLypE8YRwNsJ1QAAIABAACAAAAAgAAAAAAAAAAAACICA2164TO5aYmkyYccCUqZbF9a994AnKA/cS+MBLXi8qRPGEcDbCdUAACAAQAAgAAAAIAAAAAAAAAAAAAiAgONam8JJOdoEr/jubocGRelQAnn2NfLVM7jLliPK0n8KBhHA2wnVAAAgAEAAIAAAACAAQAAAAAAAAAA`
I also needed to fix another compile error 😅 #65
from coins.
failed to fill whole buffer
this would be a (de)serialization issue. I have narrowed it down to an issue with the input bip32 derivation deserialization
from coins.
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.
from coins.
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 :)
from coins.
okay, I started a new job so progress on this issue has been slow. I pushed a branch that fixes osx compilation errors afaict
from coins.
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 🙃
from coins.
dropping this here for more digging
from coins.
Related Issues (20)
- small ergonomic tweaks
- ineffective `W::get_index()`, `W::get_all()` HOT 3
- possible to update `nix` version? HOT 1
- fix wasm CI HOT 1
- support wordlist in other languages HOT 2
- coins-ledger HID transport
- can Ledger be Send ? HOT 2
- ledger: panic + poisoned mutex after new updated HOT 5
- Standardize on traits from RustCrypto HOT 6
- Think about macros around core/src/hashes HOT 4
- Refactor PSBT updater and signer to be async
- Ledger BTC protocol selection HOT 1
- Use k256 instead of parity ECDSA HOT 3
- Review all documentation
- Improve ByteFormat interface HOT 2
- rethink bitcoins-wasm HOT 3
- Release a new patch version HOT 1
- Feature request: make `coins-ledger` work on Android Termux HOT 9
- Upgrade Rust Crytpo asymmetric dependencies HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coins.