signrawtransaction hex

2

When calling RPC signrawtransaction it returns a hex-encoded string that contains the raw tx request with its signatures.

Is this string:

  • malleable?
  • unique?

Doug Peters

Posted 2014-06-02T12:07:13.090

Reputation: 1 326

Answers

1

signrawtransaction signs all inputs your wallet can sign. As multiple inputs in a transaction can exist, it might be possible that not all inputs are signed.

The signrawtransaction command returns whether the transaction is fully signed or not: https://github.com/bitcoin/bitcoin/blob/0.13/src/rpc/rawtransaction.cpp#L616
If it is fully signed, the output is not malleable.

The output is not unique as is discussed in the comments below.

hrobeers

Posted 2014-06-02T12:07:13.090

Reputation: 73

ECDSA signatures are never unique. The owner of a transaction can just sign again with a different nonce, and an equally valid signature would appear. Worse, he can always create a completely different transaction, which doublespends the money.Pieter Wuille 2016-09-21T21:19:18.477

Interesting, did not know about the nonce in ECDSA signatures. So still the output can only be recreated using the same keys, without access to the keys, it is impossible to recreate the same output so in that sense it is unique. But like you said you can have multiple versions of the fully signed transaction.hrobeers 2016-09-22T07:40:24.913

That's a very strange definition for unique. In digital signature systems, a unique signature usually refers to the property that even with access to the private key, you cannot construct more than one valid signature for a given message. As said, ECDSA is not unique (not even with RFC6979, and the assumption that it would be has led to breaks in some cryptosystems).Pieter Wuille 2016-09-22T11:24:21.307

I agree, but his question was whether the raw transaction string is unique.hrobeers 2016-09-22T12:03:03.523

Well, it is not, and assuming that it is may cause problems.Pieter Wuille 2016-09-22T12:39:53.143

Edited the answer for clarity.hrobeers 2016-09-23T11:20:16.680