Bitcoin Forum

Bitcoin => Hardware wallets => Topic started by: TheBeardedBaby on February 08, 2019, 11:02:01 AM



Title: Cannot verify signed message from Trezor with Electrum.
Post by: TheBeardedBaby on February 08, 2019, 11:02:01 AM
Hello,

I ran into this issue yesterday when I try to verified a singed message from Trezor (P2SH) address.

I signed a new message from a new address with Trezor and tried again.
I have a standard Electrum wallet, do I need to create a P2SH SegWit (https://bitcoinelectrum.com/creating-a-p2sh-segwit-wallet-with-electrum/) wallet to be able to verify signatures from P2SH addresses?


Code:
---BEGIN MESSAGE---
Test message
---BEGIN ADDRESS---
3Nxe7AjWBZFoctcQLrnfYeRL9XQChpv3kB
---BEGIN SIGNATURE---
JEuiD5vTQs7Br7wzyEPQ+POH5/3tCyFCmKkP2vGB5QVBIP4v/Gd3gvmohL+m6ZinnQzVbNssZtRFiZQ6UTdd2vE=
---END MESSAGE---



https://i.imgur.com/Lwe4yli.png


Title: Re: Cannot verify signed message from Trezor with Electrum.
Post by: pooya87 on February 09, 2019, 05:17:39 AM
the problem is that signature verification in elliptic curve cryptography is not done with the "address"! it is done with the public key. so what happens under the hood is that when you give Electrum your signature to verify, it recovers your public key but then it doesn't know what to do with that public key since your address starts with a "3".
i think you need to open up a new issue on Electrum repository, since your first byte here is an unusual "36" that has to be an indication that this address starting with a 3 is a SegWit address so that it lets your wallet know what to do with that public key it just recovered.


Title: Re: Cannot verify signed message from Trezor with Electrum.
Post by: DireWolfM14 on February 10, 2019, 07:26:54 PM
Code:
---BEGIN MESSAGE---
Test message
---BEGIN ADDRESS---
3Nxe7AjWBZFoctcQLrnfYeRL9XQChpv3kB
---BEGIN SIGNATURE---
JEuiD5vTQs7Br7wzyEPQ+POH5/3tCyFCmKkP2vGB5QVBIP4v/Gd3gvmohL+m6ZinnQzVbNssZtRFiZQ6UTdd2vE=
---END MESSAGE---

This is very interesting.  I have my Trezor wallet's master public key in a watch-only Electrum wallet, and I just tried to very the message with that, but it also failed. 

I imagine the bitcoin development team has bigger fish to fry, but it would be nice to have signatures and verification standardized.


Title: Re: Cannot verify signed message from Trezor with Electrum.
Post by: TheBeardedBaby on February 10, 2019, 07:47:40 PM
Code:
---BEGIN MESSAGE---
Test message
---BEGIN ADDRESS---
3Nxe7AjWBZFoctcQLrnfYeRL9XQChpv3kB
---BEGIN SIGNATURE---
JEuiD5vTQs7Br7wzyEPQ+POH5/3tCyFCmKkP2vGB5QVBIP4v/Gd3gvmohL+m6ZinnQzVbNssZtRFiZQ6UTdd2vE=
---END MESSAGE---

This is very interesting.  I have my Trezor wallet's master public key in a watch-only Electrum wallet, and I just tried to very the message with that, but it also failed.  

I imagine the bitcoin development team has bigger fish to fry, but it would be nice to have signatures and verification standardized.

As I wrote in the OP, I think you need to manually tweak Electrum (see the link I provided), and creating a p2sh segwit wallet to be able to verify messages from p2sh addresses.

Basically, the only way to verify p2sh addy messages is Trezor.


Title: Re: Cannot verify signed message from Trezor with Electrum.
Post by: TheBeardedBaby on February 26, 2019, 07:46:58 PM
~

Basically, the only way to verify p2sh addy messages is Trezor.

An update. Thanks to MaoChao (https://bitcointalk.org/index.php?action=profile;u=410541), I found a variation of brainwallet which can verify p2sh messages :

https://jhoenicke.github.io/brainwallet.github.io/#verify