Bitcoin Forum
May 04, 2024, 10:30:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can signmessage be used to spend coins?  (Read 663 times)
domob (OP)
Legendary
*
Offline Offline

Activity: 1135
Merit: 1161


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
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714861846
Hero Member
*
Offline Offline

Posts: 1714861846

View Profile Personal Message (Offline)

Ignore
1714861846
Reply with quote  #2

1714861846
Report to moderator
1714861846
Hero Member
*
Offline Offline

Posts: 1714861846

View Profile Personal Message (Offline)

Ignore
1714861846
Reply with quote  #2

1714861846
Report to moderator
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1129


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: 1135
Merit: 1161


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!