Bitcoin Forum
May 04, 2024, 06:19: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 transaction.  (Read 571 times)
halftimepad (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 1


View Profile
July 05, 2015, 04:23:04 PM
 #1

I'm signing raw transaction with signrawtransaction using bitcoin-cli (Bitcoin Core).

Even if you repeat the same transaction, each signature should be created with a different random value k which gives the first part of the signature (r).

 I'm sure this is what happens once a transaction is sent (otherwise there would be massive theft), but in the command line, when I call signrawtransaction more than once for the same transaction I always get the same signature.  I would like to generate different valid signatures for the same transaction. 

So, when/how does the client decide it is time for a new value of k? Should I create some code to sign my transactions from scratch or is there a way to force a new k using signrawtransaction?
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
tacotime
Legendary
*
Offline Offline

Activity: 1484
Merit: 1005



View Profile
July 05, 2015, 04:32:42 PM
 #2

I believe core version 0.10.0+ uses deterministic k-value generation following the guidelines in RFC6979. The code for this is in the newly used libsecp256k1.

It you want to make random k-values, rollback to a version using openssl, or write your own code.

Note that if you generate R-values or S-values that are too high, the network will or may reject them (as detailed in BIP0062).

Code:
XMR: 44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns
halftimepad (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 1


View Profile
July 05, 2015, 05:02:05 PM
 #3

I believe core version 0.10.0+ uses deterministic k-value generation following the guidelines in RFC6979. The code for this is in the newly used libsecp256k1.

It you want to make random k-values, rollback to a version using openssl, or write your own code.

Note that if you generate R-values or S-values that are too high, the network will or may reject them (as detailed in BIP0062).

Thank you! That was interesting!

After reading the RFC I have seen the value of k changes with the message. With that, I could pull a low-effort solution to get different signatures with getrawtransaction by changing the fee by a small amount.
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!