Bitcoin Forum
December 14, 2024, 08:41:37 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can signmessage be used to spend coins?  (Read 688 times)
domob (OP)
Legendary
*
Offline Offline

Activity: 1136
Merit: 1170


View Profile WWW
June 21, 2013, 07:25:10 PM
 #1

I'm working on a project which will require users to sign server-provided challenge messages with the private key of one of their addresses.  Since a signature with that key is basically also what allows to spend coins from that address, I want to be sure about the security implications for my users.

Assuming a user can be tricked to "signmessage" arbitrary strings provided by an attacker, can this be used to spend the user's coins?  I presume there is some safeguard in the protocol such that the data signed with signmessage is of a different "format" than signing of transaction outputs ... is this the case, or can a message be crafted such that the signature on it can be recast in a form to validate spending a transaction output?

Of course my server is not going to issue rogue challenges to sign, but before I tell people to sign randomly provided strings and make them used to it, I want to make sure this can't be used to attack their coins.

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
June 21, 2013, 08:39:24 PM
 #2

All messages signed with the signmessage command have "Bitcoin Signed Message:\n" prepended to them for exactly this reason.
domob (OP)
Legendary
*
Offline Offline

Activity: 1136
Merit: 1170


View Profile WWW
June 22, 2013, 05:46:30 AM
 #3

All messages signed with the signmessage command have "Bitcoin Signed Message:\n" prepended to them for exactly this reason.

That is what I supposed, thanks for confirming it! Smiley

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!