dashpay / electrum-dash-old

Electrum-DASH - a Dash thin client
https://electrum-dash.org
MIT License
37 stars 114 forks source link

Masternode broadcast signature verification failed #31

Closed splawik21 closed 8 years ago

splawik21 commented 8 years ago

electrum6

Kefkius commented 8 years ago

Did you get this error immediately after #30? I mean, did the masternode broadcast work when you said:

Connecting to electrum.dash.siampm.com and activating the node does now cause the issue anymore.

Or did this error occur instead of #30?

splawik21 commented 8 years ago

Yes, the masternode broadcast works and the error #30 does not appear anymore.

Kefkius commented 8 years ago

Alright, so you have successfully broadcasted a MasternodeAnnounce? Then this error only appears when broadcasting a MasternodeAnnounce sometimes?

splawik21 commented 8 years ago

Exactly. Confirmed it on the trezor and boom Announce rejection appears.

Kefkius commented 8 years ago

A known issue is that trezor doesn't sign messages in a way that is compatible for coins other than Bitcoin. They recently made a fix for this, but I don't think it's in any official firmware releases yet. Are you using an official trezor firmware version?

splawik21 commented 8 years ago

Yes, the newest one, from the other source, I know for a fact the updated firmware was merged but not released yet as a friend of mine was in touch with Trezor team about it a couple of days ago. edit: yeah if I`m not wrong that would be that "a fix for this" no?

schinzelh commented 8 years ago
04-Jun-2016 18:09:09    Firmware fingerprint:
04-Jun-2016 18:09:09    61d44cb0c78fbe733dcc6832cda884b4a6a9cd230831c01d46deaa8dbdc5e431  output/trezor-master.bin
04-Jun-2016 18:09:09    Firmware size: 305244 bytes (out of 491520 maximum)

This is firmware https://github.com/trezor/trezor-mcu/commit/e6a8204b1eead7bb98425194bb8c07a6fde65a25 which includes the necessary Dash patches for signing.

https://dashpay.atlassian.net/builds/browse/TRZR-DEV-1/artifact/JOB1/trezor.bin/trezor-master.bin

Though the build process is pretty straightforward and there were no issues please note:

USE AT YOUR OWN RISK! I CAN'T GUARANTEE THAT THIS FIRMWARE DOES NOT BRICK YOUR DEVICE!

Kefkius commented 8 years ago

@splawik21 are you on testnet? There's been a recent change in dashd that alters the testnet address version, which I've just discovered and am fixing.

splawik21 commented 8 years ago

@Kefkius nope i am using the mainnet. I am not so advanced to go through this so will wait till satoshilabs will update their firmware. @Flare will brick his trezor as soon as it arrives him.

Kefkius commented 8 years ago

Alright @splawik21. I guess this will have to wait a bit.

schinzelh commented 8 years ago

I think we found the root cause for the verification failure: mnbroadcast format has changed with https://github.com/dashpay/dash/pull/836

We intercepted a message sent from electrum-dash and the message format is the old

==> /home/electrum/electrum/electrum-dash.log <==
[05/06/2016-01:36:09] block 481093 (3 0.12s) bcaa4c2a5eaa45b25ee5eb02d686345261057d87a719786d52c6810bbf72f296 (18.92tx/s, 0.16s/block)
[05/06/2016-01:36:19] DEBUG:  168 masternode.announce.broadcast [u'01876886f330bfa4eaa8901e39a31d1e386bf569b2a954e3bff1e54b781f5edf410200000000ffffffff00000000000000000000ffff6deb4138270f210279e7a089f60895d25387e064a9fbbd7a2f31d09a5ffc9d1c357594a477a0964c4104b2662e796c9e12ee1c5dea0a373a206bbda03c25fa771947e1033c18fbd6f1486f17a06ede140428c0168a8c4a7d1028335b2ce57d93c0d34e56a93d2edd2aa0411fc2b6eb49f651865b207621da278c0aaa7b9dd17de4fe0d6078f5c561e9069cc603f8441730ad3b99d11b1975747b74c77e45944ab5295c37e53c19b843df2177931f535700000000d7110100876886f330bfa4eaa8901e39a31d1e386bf569b2a954e3bff1e54b781f5edf410200000000fffffffffe9710153fd1cb107a2382e81270345e00b646d7d992f970fc4f020000000000921f535700000000411bd503322cef5dadd22c5dc365707841a7343569ce69a574d00569dc6f6e55e037334851c73acaf7f8cc48af0b9d0e00068847b8b7634ca0c5a33d24b8867cb6970000000000000000']

==> /home/electrum/.dash/debug.log <==
2016-06-04 18:36:19 CMasternodeBroadcast::VerifySignature - Got bad Masternode address signature, sanitized error: keys dont match - input: 4b6ab98f05378e71c286c6a432fb5c7129f9c4e4, recovered: 9c0ed633107d85edc8be75b7ba654cd17b0167f8, message: 109.235.65.56:99991465065363ySdz/1_5uwLf.yl7: kwGHon(J(3,NV.70103, sig: H8K260n2UYZbIHYh2ieMCqp7ndF95P4NYHj1xWHpBpzGA/hEFzCtO5nRGxl1dHt0x35FlEq1KVw35TwZuEPfIXc

@Kefkius can you change the message format to the new format?

Kefkius commented 8 years ago

@schinzelh Thanks for the info. The bad thing about there not being stable dashd version that supports these masternode operations is that we have to play whack-a-mole with bugs :D

Can I use the protocol version of the masternode to determine which message format to use?

schinzelh commented 8 years ago

@Kefkius I hear you :-)

Yes protocolversion < 70201 is old message format.

Kefkius commented 8 years ago

33 implements this change

schinzelh commented 8 years ago

This is build 7eb9150 which should fix the signature verification issue:

https://dashpay.atlassian.net/builds/browse/ELMW-DEV-34/artifact/JOB1/electrum-dash.exe/electrum-dash.exe

schinzelh commented 8 years ago

This should fix it bfcb319caa7b8066ce7d2262f97c7b6fba2cb8fb

https://dashpay.atlassian.net/builds/browse/ELMW-DEV-115/artifact/JOB1/electrum-dash.exe/electrum-dash.exe

splawik21 commented 8 years ago

All working. Closing the issue.