Bitcoin Forum

Bitcoin => Electrum => Topic started by: Matthew N. Wright on August 26, 2012, 04:22:43 PM



Title: [BOUNTY] 2BTC for signing a message with Electrum
Post by: Matthew N. Wright on August 26, 2012, 04:22:43 PM
Here's a 2BTC bounty for anyone who can explain from start to finish how to sign a message from a bitcoin address in electrum. The following assumptions should be made before answering:

  • This is the first time I've used Electrum desktop client
  • The message needing to be signed is multi-lined
  • I must use Electrum, nothing else



Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: The King on August 26, 2012, 04:44:12 PM
Make sure electrum is running so do sanitycheck: ( this is done in shell terminal or windows command promp!)

Code:
electrum 

then see what this command tells you. If not works then go to directory where you downloaded electrum and try

Code:
./electrum help signmessage
and should come back as

Code:
Signs a message with a key
Syntax: signmessage <address> <message>

If it works and you can reach electrum through terminal and get some response back then you can next do this:

Code:
electrum signmessage <address> <message>

Where is <address> put your address which one you want to prove you have control over.
Where is <message> just copy paste the full message with how many lines you need but make sure to convert it from multiple lines to one LONG line with notepad or something so it is just one huge long line instead of multiple line with space inbetween.

Hope i helped!
Address is 1EvCVytASszoUq6S7ioPaLQScjg8ptt5s9 if you feel generous.
If no works then post here and I can help again



Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: JompinDox on August 26, 2012, 08:40:55 PM
If you really need to have a multi-line message, you could just first hash it with SHA-256 (for example, here (http://www.xorbin.com/tools/sha256-hash-calculator)) then sign the hash!


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: ThomasV on August 26, 2012, 08:53:18 PM
note: if the address you want to sign with is not in your Electrum wallet, you need to import it first:

Code:
electrum import address:privatekey


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: ThomasV on August 26, 2012, 09:05:13 PM
oh, I did not see that you wanted a multi line message.
you can use \n for new lines:

Example:

Code:
./electrum signmessage 19f4RvAZDnf1RuWmHJjXte5kAtL4UN6DVc "I am a pirate\nI am not here"
HNe/7GifPcUyekwpKp9hphWZ72ZLT3LFBvZVsx4k9nxKq2CUwf/MSxTLu1vm6/pN84mdNj30YdKDHZoIaOSIDug=

and to verify:

Code:
./electrum verifymessage 19f4RvAZDnf1RuWmHJjXte5kAtL4UN6DVc HNe/7GifPcUyekwpKp9hphWZ72ZLT3LFBvZVsx4k9nxKq2CUwf/MSxTLu1vm6/pN84mdNj30YdKDHZoIaOSIDug= "I am a pirate\nI am not here"
True


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: Jutarul on August 26, 2012, 09:34:27 PM
which OS are you using?

the electrum code doesn't handle it very well:

sign:
message = ' '.join(args[2:])
wallet.sign_message(address, message, password)

verify:
message = ' '.join(args[3:])
wallet.verify_message(address, signature, message)

If you feel fine changing the code yourself, you can replace the message= commands the following way:

for signmessage:

message = ' '.join(args[2:])


try:
    f=open(args[2],'r')
    message = f.read()
except IOError as e:
    message = ' '.join(args[2:])


for verifymessage:

message = ' '.join(args[3:])


try:
    f=open(args[3],'r')
    message = f.read()
except IOError as e:
    message = ' '.join(args[3:])


This will change the default behavior to reading the message from the file if it exists.

ADDENDUM: If you feel this is a critical feature you may want to suggest this code to the electrum developer...


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: ThomasV on August 26, 2012, 09:41:47 PM
btw, there seems to be a bug with verifymessage on Windows.
see https://bitcointalk.org/index.php?topic=50936.msg1135155#msg1135155


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: ThomasV on August 26, 2012, 10:00:45 PM
follow up: apparently, on Windows you need to add quotes around the signature, like this:

Code:
./electrum verifymessage 19f4RvAZDnf1RuWmHJjXte5kAtL4UN6DVc "HNe/7GifPcUyekwpKp9hphWZ72ZLT3LFBvZVsx4k9nxKq2CUwf/MSxTLu1vm6/pN84mdNj30YdKDHZoIaOSIDug=" "I am a pirate\nI am not here"


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: The King on August 27, 2012, 08:03:20 AM
did you solve problem? who receive bounty? :)


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: michaelmclees on August 27, 2012, 12:52:35 PM
Here's a 2BTC bounty for anyone who can explain from start to finish how to sign a message from a bitcoin address in electrum. The following assumptions should be made before answering:

  • This is the first time I've used Electrum desktop client
  • The message needing to be signed is multi-lined
  • I must use Electrum, nothing else



Were you planning on signing 10k anytime soon?


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: flatfly on August 27, 2012, 02:39:22 PM
Here's a 2BTC bounty for anyone who can explain from start to finish how to sign a message from a bitcoin address in electrum. The following assumptions should be made before answering:

  • This is the first time I've used Electrum desktop client
  • The message needing to be signed is multi-lined
  • I must use Electrum, nothing else




By the way, if you are using the Windows builds, note that you need to open the text console first, by holding the SHIFT key down on your keyboard while launching Electrum.

Apart from that, the above posts pretty much nailed it, but I will summarize the process from start to finish:


A. To sign a message using an imported address:

1. Hold SHIFT down while launching Electrum
2. Import your address by typing:
    e -o import 1YourBitcoinAddress:5YourPrivateKey
3. In the virtual console that has appeared, type:
    e signmessage 1YourBitcoinAddress "MessageLine1\nMessageLine2\nMessageLine3"
  
    This should output the base64-encoded cryptographic signature.    


B. To verify a signed message:

1. Hold SHIFT down while launching Electrum
2. In the virtual console that has appeared, type:
    e verifymessage 1YourBitcoinAddress "TheSignature" "MessageLine1\nMessageLine2\nMessageLine3"    
     (Be sure to include the quotes.)

   If successful, this must return True.  


Note that all of the above can be performed on a non-networked computer, if preferred.

PS: hopefully in a future release, these commands will be accessible from the graphical interface. For now, they are only available through the advanced console.


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: The King on August 28, 2012, 11:26:27 AM
so who got the bounty?
my address is 1EvCVytASszoUq6S7ioPaLQScjg8ptt5s9
i hoped to win 2BTC for helping but what happen :'(
i though bounty supposed to be given out-amirite?


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: Matthew N. Wright on August 28, 2012, 11:39:57 AM
so who got the bounty?
my address is 1EvCVytASszoUq6S7ioPaLQScjg8ptt5s9
i hoped to win 2BTC for helping but what happen :'(
i though bounty supposed to be given out-amirite?


Sent! (I'll be using Bitcoin-QT afterall but I pay my bounties regardless ^^. Cheers!)

Thanks everyone. Electrum is apparently no where near user friendly enough to use.


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: The King on August 28, 2012, 12:05:00 PM
so who got the bounty?
my address is 1EvCVytASszoUq6S7ioPaLQScjg8ptt5s9
i hoped to win 2BTC for helping but what happen :'(
i though bounty supposed to be given out-amirite?


Sent! (I'll be using Bitcoin-QT afterall but I pay my bounties regardless ^^. Cheers!)

Thanks everyone. Electrum is apparently no where near user friendly enough to use.
received. many thx!


Title: Re: [BOUNTY] 2BTC for signing a message with Electrum
Post by: Tachikoma on August 28, 2012, 02:46:42 PM
so who got the bounty?
my address is 1EvCVytASszoUq6S7ioPaLQScjg8ptt5s9
i hoped to win 2BTC for helping but what happen :'(
i though bounty supposed to be given out-amirite?


Sent! (I'll be using Bitcoin-QT afterall but I pay my bounties regardless ^^. Cheers!)

Thanks everyone. Electrum is apparently no where near user friendly enough to use.

Just trust that we are working every day to make it better. Building verification/signing into the GUI is pretty high on my list :)