Bitcoin Forum
May 07, 2024, 03:38:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: different signatures for the same pk and message  (Read 432 times)
talip_ozturk (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
November 02, 2016, 05:31:43 PM
 #1

Hi,

With the privateKey: 619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9
which gives me the publicKey: 025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357
I am signing the following message:
c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670

The signature I create is always (repeatable):
304502203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a022100a 8c56ab3bae7ccea9ebf906fcff170cb61b9c3bddb0c7f1133238e5ee9b75553

which is different from the one at https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#Native_P2WPKH:
304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573 a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee

I can verify that the message is valid with both signatures (mine and the one on the website).

Is it normal that two (or more) different signatures can be created from the same privateKey & message? If so why? If it is because of the randomness feature of the ECDSA then why do I create the exact same signature -everytime- I ran the signing code with the same private key & message above?







1715096310
Hero Member
*
Offline Offline

Posts: 1715096310

View Profile Personal Message (Offline)

Ignore
1715096310
Reply with quote  #2

1715096310
Report to moderator
1715096310
Hero Member
*
Offline Offline

Posts: 1715096310

View Profile Personal Message (Offline)

Ignore
1715096310
Reply with quote  #2

1715096310
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715096310
Hero Member
*
Offline Offline

Posts: 1715096310

View Profile Personal Message (Offline)

Ignore
1715096310
Reply with quote  #2

1715096310
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
November 02, 2016, 06:16:32 PM
 #2

Is it normal that two (or more) different signatures can be created from the same privateKey & message? If so why?
Yes. This is because of random numbers which are used during the signing process.

If it is because of the randomness feature of the ECDSA then why do I create the exact same signature -everytime- I ran the signing code with the same private key & message above?
Probably because the signing software is caching signatures.

pepethefrog
Member
**
Offline Offline

Activity: 120
Merit: 13


Pepe is NOT a hate symbol


View Profile
November 03, 2016, 08:03:24 AM
 #3

Probably because the signing software is caching signatures.

Don't think it is caching signatures, but rather reusing parameters of the RNG.

Bipcoin: bip1W2nq2vhM4f6kaHSsVD5J1LdRb1M3mCqftwq6erpEeKzsj8Kjrxy5xUs9VAtF233nNzcMQN2ZQfJ fvi2WensZ5tGJv2ysY8
Pepe is NOT a hate symbol.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
November 03, 2016, 08:40:53 AM
 #4

Is it normal that two (or more) different signatures can be created from the same privateKey & message?
yes

Quote
If so why?
because there is random parameter while creating signature

Quote
If it is because of the randomness feature of the ECDSA then why do I create the exact same
signature -everytime- I ran the signing code with the same private key & message above?
google for "deterministic ecdsa"
your software uses it
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!