Feathercoin-Foundation / electrum-ftc

Electrum-FTC; Feathercoin thin client. Follows upstream by rebasing FTC patches. Tags remain stable.
MIT License
10 stars 8 forks source link

magic message is incosistent with feathercoind #106

Closed quietnan closed 6 years ago

quietnan commented 6 years ago

Expected Behavior

When signing a message with feathercoind, e.g.

$ ./feathercoin-cli signmessage 6pAFAKYuykSTQEYziPH9NfH31sunfDUtCx 'asdf'
INMrbFjO9COZtQyKzUXz8FVQO5CXHo8plJZiy7HlKpjDIZYpnSlgR/HVqsD7n4565qSTgbHUoKK5Jas3+YykEYc=

then that message should be verifiable with electrum-ftc.

Current Behavior

It says 'Wrong signature'

Possible Solution

The problem is a mismatch of the magic message in https://github.com/Feathercoin-Foundation/electrum-ftc/blob/3.2.X/electrum/ecc.py#L303 . Should be \x1c instead of \x19, as this is the length of the prefix 'Feathercoin Signed Message:\n'. Apparently this was copied from Litecoin, where \x19 is correct.

Steps to Reproduce

  1. Sign some message on feathercoind
  2. Verify with electrum-ftc
  3. Fail
  4. Patch electrum-ftc with the above-mentioned change
  5. Verify again
  6. Success
quietnan commented 6 years ago

This means that there are currently two different conventions for message signing out there. The one from electrum-ftc and the one from feathercoind. Changing this in electrum-ftc will introduce a inconsistency between versions prior and after this change, but yields the bigger chance of converging to one convention only eventually, which I would argue is preferable.