<p>Digital signatures really aren't much alike someone's John Hancock. Digital signatures cryptographically commit to exactly one message and resolve as invalid for any other messages. Unlike someone's three crosses they cannot be lifted from one document to another or easily imitated.</p>
<p>ECDSA's signature algorithm uses two inputs, the private key and the message that the signature commits to. In the case of Bitcoin, the &quot;message&quot; is the Bitcoin transaction you mean to commit to.</p>
<p>The signature is mathematically derived from the message, the private key, and a random component generated during the signing. While producing the signature requires knowledge of the private key, the signature can be validated by anyone who knows the message, the signature, and the corresponding public key. The signature will only ever fit that specific transaction. Any other transaction would require a signature to commit to a different &quot;message&quot;, and such a signature could not be produced without knowledge of the private key.</p>
<p>As a transactions spends at least one <a href="https://bitcoin.stackexchange.com/q/4301/5406">unspent transaction output (UTXO)</a>, and each UTXO is unique¹, the premise of &quot;signing the same message&quot; is in conflict with &quot;same for all my transactions&quot;. As each transaction must be unique, signatures do not transfer, even if the transaction spends inputs associated with the same private key. Therefore, yes, every signature is unique.</p>
<blockquote>
<p>Furthermore, if <code>&lt;sig&gt;</code> was always the same for all my transactions, would that mean that everyone who knows my <code>&lt;sig&gt;</code> can impersonate me?</p>
</blockquote>
<p>No, that's not how signatures work. If your signature was always the same for all transactions, they would not be useful. Such a &quot;signature&quot; would not prove that you committed to something specific and therefore could not be a means of authorizing a payment.</p>
<hr />
<p><sup>¹ A UTXO are uniquely identifiable by their <em>outpoint</em> which consists of the <code>txid</code> that created it and the output's position in that transaction's output list. <code>txid</code> are the SHA256D digest of the transaction data. This is defacto unique since <a href="https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki" rel="nofollow noreferrer">BIP34</a> requires Coinbase transactions to include the block height, which therefore by induction means that no transaction can ever consist of the same data.</sup></p>

CC BY-SA 4.0
2020-12-01T05:39:29.823Z
2020-12-06T01:01:29.173Z
2020-12-06T01:01:29.173Z
Murch
<p>In P2PKH the validation script is:</p>
<pre><code>&lt;sig&gt; &lt;pubKey&gt; OP_DUP OP_HASH160 &lt;pubKeyHash&gt; OP_EQUALVERIFY OP_CHECKSIG
</code></pre>
<p>If I always use exactly the same private key and always sign exactly the same message with it, is my <code>&lt;sig&gt;</code> unique among all my transactions?</p>
<p>Furthermore, if <code>&lt;sig&gt;</code> was always the same for all my transactions, would that mean that everyone who knows my <code>&lt;sig&gt;</code> can impersonate me?</p>

CC BY-SA 4.0
2020-12-01T05:39:54.653Z
Related: https://bitcoin.stackexchange.com/q/100253/5406
Murch
CC BY-SA 4.0
2020-12-02T16:47:33.383Z
well, the message you're signing for each transaction changes, because the message includes the transaction data. all someone could do with your signature of an old transaction is attempt to replay that exact same transaction, which is only really an issue during a fork.
ieatpizza
<transactions><ecdsa>
Is my ECDSA signature always unique?
yujaiyu
# Is my ECDSA signature always unique?

(Asked by: username_0 on 2020-12-01)

In P2PKH the validation script is:

```
<sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

```

If I always use exactly the same private key and always sign exactly the same message with it, is my `<sig>` unique among all my transactions?

Furthermore, if `<sig>` was always the same for all my transactions, would that mean that everyone who knows my `<sig>` can impersonate me?

**Tags:** transactions, ecdsa

> **Comments:**
> **username_1**: Related: https://bitcoin.stackexchange.com/q/100253/5406  
> **username_2**: well, the message you're signing for each transaction changes, because the message includes the transaction data. all someone could do with your signature of an old transaction is attempt to replay that exact same transaction, which is only really an issue during a fork.  

---

## 1 answers

### Answer by username_1 on 2020-12-01. Score: 2 | Accepted answer

Digital signatures really aren't much alike someone's John Hancock. Digital signatures cryptographically commit to exactly one message and resolve as invalid for any other messages. Unlike someone's three crosses they cannot be lifted from one document to another or easily imitated.

ECDSA's signature algorithm uses two inputs, the private key and the message that the signature commits to. In the case of Bitcoin, the "message" is the Bitcoin transaction you mean to commit to.

The signature is mathematically derived from the message, the private key, and a random component generated during the signing. While producing the signature requires knowledge of the private key, the signature can be validated by anyone who knows the message, the signature, and the corresponding public key. The signature will only ever fit that specific transaction. Any other transaction would require a signature to commit to a different "message", and such a signature could not be produced without knowledge of the private key.

As a transactions spends at least one [unspent transaction output (UTXO)](https://bitcoin.stackexchange.com/q/4301/5406), and each UTXO is unique¹, the premise of "signing the same message" is in conflict with "same for all my transactions". As each transaction must be unique, signatures do not transfer, even if the transaction spends inputs associated with the same private key. Therefore, yes, every signature is unique.

> Furthermore, if `<sig>` was always the same for all my transactions, would that mean that everyone who knows my `<sig>` can impersonate me?

No, that's not how signatures work. If your signature was always the same for all transactions, they would not be useful. Such a "signature" would not prove that you committed to something specific and therefore could not be a means of authorizing a payment.

---

¹ A UTXO are uniquely identifiable by their *outpoint* which consists of the `txid` that created it and the output's position in that transaction's output list. `txid` are the SHA256D digest of the transaction data. This is defacto unique since [BIP34](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki) requires Coinbase transactions to include the block height, which therefore by induction means that no transaction can ever consist of the same data.


---

