Bitcoin Forum
May 06, 2024, 03:22:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Signing a message  (Read 1105 times)
FabioCarpi (OP)
Sr. Member
****
Offline Offline

Activity: 375
Merit: 254



View Profile
October 05, 2016, 03:24:34 AM
Merited by ABCbits (1)
 #1

If I sign the same message several times, the bitcoin-qt returns the same signature.
It does not use a random seed for signing, such as signing transactions?
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715008959
Hero Member
*
Offline Offline

Posts: 1715008959

View Profile Personal Message (Offline)

Ignore
1715008959
Reply with quote  #2

1715008959
Report to moderator
1715008959
Hero Member
*
Offline Offline

Posts: 1715008959

View Profile Personal Message (Offline)

Ignore
1715008959
Reply with quote  #2

1715008959
Report to moderator
AgentofCoin
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
October 05, 2016, 10:05:45 PM
 #2

If I sign the same message several times, the bitcoin-qt returns the same signature.
It does not use a random seed for signing, such as signing transactions?

No, message signing is different from transaction signing.
Message signing has three parts: (1) Address (with privatekey), (2) Message, and (3) Signature.
When signing a message, you are providing proof that the message comes from that bitcoin address
(and thus you have control over that privatekey).

If you change the address you are signing from, your signature will change.
There is no random seed in basic message signing, since that would defeat others ability to verify it.

I support a decentralized & unregulatable ledger first, with safe scaling over time.
Request a signed message if you are associating with anyone claiming to be me.
FabioCarpi (OP)
Sr. Member
****
Offline Offline

Activity: 375
Merit: 254



View Profile
October 05, 2016, 10:46:44 PM
 #3

If I sign two transactions with the same seed, I expose my private key.
The same thing happens with the message signature?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 05, 2016, 10:49:31 PM
Merited by ABCbits (2)
 #4

If I sign the same message several times, the bitcoin-qt returns the same signature.
It does not use a random seed for signing, such as signing transactions?

No, message signing is different from transaction signing.
Message signing has three parts: (1) Address (with privatekey), (2) Message, and (3) Signature.
When signing a message, you are providing proof that the message comes from that bitcoin address
(and thus you have control over that privatekey).

If you change the address you are signing from, your signature will change.
There is no random seed in basic message signing, since that would defeat others ability to verify it.

The same signing algorithm is used because really it is all just signing bytes of data.

If I sign two transactions with the same seed, I expose my private key.
The same thing happens with the message signature?
Yes, that can happen. But that will not happen here because the signatures are identical. You only expose the private key if the R values are the same but the S values are different. In this case, because the signatures are identical, then both R and S are identical so it doesn't matter.

FabioCarpi (OP)
Sr. Member
****
Offline Offline

Activity: 375
Merit: 254



View Profile
October 05, 2016, 11:20:41 PM
 #5

If I sign two transactions with the same seed, I expose my private key.
The same thing happens with the message signature?
FabioCarpi (OP)
Sr. Member
****
Offline Offline

Activity: 375
Merit: 254



View Profile
October 05, 2016, 11:21:21 PM
 #6

In my algorithm, I give different signatures for the same message, because I'm using the same function to sign transaction.
How it should be?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 06, 2016, 12:24:58 AM
 #7

In my algorithm, I give different signatures for the same message, because I'm using the same function to sign transaction.
How it should be?
That's ok. I'm not sure why Core returns the same signature. I think it may just be cached by the software, I need to look into a bit more.

It seems to be cached. This seems to be implied by this comment in the signing stuff:
Code:
Furthermore, it is guaranteed that identical signatures (including their
recoverability) will have identical representation, so they can be
memcmp'ed.

piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
October 06, 2016, 09:02:32 PM
 #8

It seems to be cached. This seems to be implied by this comment in the signing stuff:
Code:
Furthermore, it is guaranteed that identical signatures (including their
recoverability) will have identical representation, so they can be
memcmp'ed.
More likely they're using deterministic signatures.

https://bitcointalk.org/index.php?topic=727918.0

I think it wasn't like this before.
Perhaps it came with the sipa's secp256k1 lib.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
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!