pooler / electrum-ltc

Electrum-LTC Litecoin wallet
https://electrum-ltc.org
MIT License
194 stars 102 forks source link

Trezor based Sign Message produces bad signature #16

Closed MarvinOl closed 8 years ago

MarvinOl commented 10 years ago

First thanks for Trezor support!

Using master branch from yesterday. Going into Sign/verify Message everything works as it does with Bitcoin Electrum - asks approval on Trezor screen, asks for pin, signs on Trezor and displays the result in the Signature field. But this signature is not correct. Even clicking Verify in the same windows says that the signature is invalid! Tested the signature with the official litecoin client and it is not correct.

pooler commented 10 years ago

Thank you for reporting this. Looks like I'll have to buy me a Trezor, so that I can debug this :)

wozz commented 10 years ago

I have the same error. I can't see why anything should be different than Bitcoin except the CoinType, which looks correct.

@MarvinOl have you tried sending any LTC yet? I haven't put anything in my trezor wallet yet so cannot confirm if that works.

MarvinOl commented 10 years ago

@wozz nope - I have not read the full protocol documentation but as far as I understand signing messages is basically the same operation as sending coins (sending coins is just a specially formatted signed "text message" - correct me if I got this wrong). I have not yet used real LTC with my Trezor as message signing does not work.

wozz commented 10 years ago

I was able to confirm that bitcoin testnet message signing (and transaction sending) is working on trezor, which is also treated as a separate coin type. The interface to the trezor is two separate commands for message signing and transaction signing, so it's possible tx signing works without message signing working.

wozz commented 10 years ago

Ok, just confirmed sending transactions is working for me. So only message signing is broken to my knowledge.

MarvinOl commented 10 years ago

Thanks for the Trezor support again! I bit the bullet and tested with real LTC - no problems, works as expected. So there are clearly 2 different operations with signing messages and signing transactions - and signing transactions works with no problems.

wozz commented 10 years ago

I've opened an issue in the Trezor repository: https://github.com/trezor/trezor-mcu/issues/3

prusnak commented 9 years ago

I recommend changing the magic to "Bitcoin Signed Message" here: https://github.com/pooler/electrum-ltc/blob/v1.9.8.4/lib/bitcoin.py#L351 This is a very poor decision to break things appart for no obvious reason.

pooler commented 9 years ago

@prusnak: Litecoin Core has been using the magic string "Litecoin Signed Message" since 2011. What you are proposing would break compatibility with all other Litecoin clients, which is highly undesirable.

prusnak commented 9 years ago

That is indeed very unfortunate ... I'll reopen the trezor-mcu issue.

prusnak commented 8 years ago

Fixed in TREZOR firmware 1.3.6

pooler commented 8 years ago

@prusnak Thank you!

prusnak commented 8 years ago

See https://github.com/pooler/electrum-ltc/issues/34 though.