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

Invalid Status 6a80 when signing #25

Closed
molecular opened this issue Oct 1, 2017 · 14 comments
Closed

Invalid Status 6a80 when signing #25

molecular opened this issue Oct 1, 2017 · 14 comments

Comments

@molecular
Copy link

molecular commented Oct 1, 2017

Hi,
an electron-cash user has problems signing using his Ledger Blue (same with his ledger nano s).

Traceback (most recent call last):
File "/home/steffen/Desktop/Electron Cash-2.9.3/plugins/ledger/ledger.py", line 411, in sign_transaction
inputSignature = self.get_client().untrustedHashSign(inputsPaths[inputIndex], pin, lockTime=tx.locktime)
File "/usr/lib/python2.7/dist-packages/btchip/btchip.py", line 387, in untrustedHashSign
result = self.dongle.exchange(bytearray(apdu))
File "/usr/lib/python2.7/dist-packages/btchip/btchipComm.py", line 119, in exchange
raise BTChipException("Invalid status %04x" % sw, sw)
BTChipException: Exception : Invalid status 6a80
Exception : Invalid status 6a80
Traceback (most recent call last):
File "/home/steffen/Desktop/Electron Cash-2.9.3/gui/qt/util.py", line 582, in run
result = task.task()
File "/home/steffen/Desktop/Electron Cash-2.9.3/lib/wallet.py", line 1104, in sign_transaction
k.sign_transaction(tx, password)
File "/home/steffen/Desktop/Electron Cash-2.9.3/plugins/ledger/ledger.py", line 422, in sign_transaction
self.give_error(e, True)
File "/home/steffen/Desktop/Electron Cash-2.9.3/plugins/ledger/ledger.py", line 201, in give_error
raise Exception(message)
Exception: Exception : Invalid status 6a80

in reference to electron-cash issue Electron-Cash/Electron-Cash#153, especially this comment by the user: Electron-Cash/Electron-Cash#153 (comment)

This might not be a btchip issue, but I'm not familiar enough with this signing process to be able to figure out what's going on here.

Any help appreciated.

@SteffenIvanhoe
Copy link

It is not only related to Ledger Blue. I have the exact same problem with the Ledger Nano S.

@molecular
Copy link
Author

molecular commented Oct 1, 2017

accidentally closed the issue, sorry

corrected OP to include ledger nano s

@molecular molecular reopened this Oct 1, 2017
@btchip
Copy link
Contributor

btchip commented Oct 1, 2017

You need to sign according to the Segwit flow (see Electrum support)

@SteffenIvanhoe
Copy link

Bitcoin Cash and Segwit???

@btchip
Copy link
Contributor

btchip commented Oct 1, 2017

Bitcoin Cash uses BIP 143 which is Segwit signature algorithm

@SteffenIvanhoe
Copy link

I'm a little bit surprised that the same software version in Electrum 2.9.3 works with Bitcoin on Ledger hardware but not in ElectronCash 2.9.3 with Bitcoin Cash? Does Bitcoin not use BIP 143 signature algorithm?

@btchip
Copy link
Contributor

btchip commented Oct 1, 2017

Bitcoin uses BIP 143 for Segwit transactions which are opt in. It is mandatory for Bitcoin Cash

@SteffenIvanhoe
Copy link

Interesting, thank you for the information!

Unfortunately it does not really help me because I'm not the developer of the ElectronCash software but only a user who is desperately looking for a method to get BCC transferred from the Ledger wallet address wise without linking addresses together. Unfortunately standard Ledger software is a privacy killer and allows zero control here.

What algorithm does the Ledger software use to come up with the next address(es) used for a send operation? Maybe knowing that makes it possible to manually set amounts such that addresses can be send on their own?

@SteffenIvanhoe
Copy link

An off-topic but related comment:

I just found out that even if a transaction including the fees does match the amount contained in one address to the last satoshi the Ledger software rather selects a different address for the send and prefers to create change. Makes no sense to me! You should at least have this little bit of optimization to find a perfectly matching address for a send if one exists, e.g. when send amount plus fees do match the content of an address in the wallet exactly. Isn't that an easy change for the Ledger software? Would help people who know about it to create precise transfers for one address.

Of course an optional address selection box or a "Send all from a given address" mechanism would also do but are "slightly" more complicated to add to the user interface.

@molecular
Copy link
Author

Signing using ledger devices (at least the btchip usb device I have) works in electron-cash. What makes this case special? I don't get it.

@btchip
Copy link
Contributor

btchip commented Oct 1, 2017

if the signature has already been patched then I have no idea

@molecular
Copy link
Author

Thanks for your info. I re-tested signing with my hw.1 and apparently it doesn't work. I thought I had tested this successfully a while ago, but apparently not ;-(. I don't think bip 143 signing has been implemented in electron-cash.

Sorry for the waves and thanks for your input, @btchip

@btchip
Copy link
Contributor

btchip commented Oct 2, 2017

ok, I'll close this as the library itself works fine with Electrum and should also work fine with Electrum Cash once called with the right flow

@btchip btchip closed this as completed Oct 2, 2017
@molecular
Copy link
Author

ok, thanks for you help

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

No branches or pull requests

3 participants