<p>Bitcoin uses the Elliptic Curve Digital Signature Algorithm (ECDSA).  Your private key is used to create the signature and your public key is used to verify the signature.  This allows anybody to verify your signature as long as they have your public key.</p>

<p>For more detailed information: <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm" rel="noreferrer">Digital Signature Algorithm</a> and <a href="http://en.wikipedia.org/wiki/Elliptic_Curve_DSA" rel="noreferrer">Elliptic Curve DSA</a></p>

CC BY-SA 3.0
2017-04-09T14:26:52.567Z
According to bitcoin wiki,  "A signature is mathematically generated from a hash of something to be signed, plus a private key." In the context of bitcoin, what is the "something" to be hashed here? Is it always the transaction?
Aqqqq
CC BY-SA 3.0
2018-01-04T07:18:19.263Z
It's a modified version of the spending transaction. It's modified because the spending transaction contains the signature itself, so if not modified, that signature would need to sign itself.
Pieter Wuille
CC BY-SA 3.0
2013-12-05T22:15:28.083Z
2013-12-05T22:15:28.083Z
ScripterRon
<p>The short answer seems to be correct. But more detailed explanations say that your bitcoin digital signature consists of an encryption of a hash of the tx data together with a hash of your private key. </p>

<p>I don't see why the hash of your private key needs to be included in a digital signature.</p>

<p>See below step will help you and surely this would work:</p>

<ol>
<li><p>You create a hash of the tx data. You then <em>sign</em> the hash using your private key. This results in your digital signature.</p></li>
<li><p>You then propagate the tx data through the network, together with your digital signature and the corresponding public key needed to verify the signature.</p></li>
<li><p>Anyone on the network can then use the public key to verify your signature and recover the hash of the tx data.</p></li>
<li><p>They then themselves create a hash of the tx data using the same hash function that you used in step 1.</p></li>
<li><p>If their own hash of the tx data matches the hash they recovered by signing with your signature, then that proves that tx hash from your digital signature must have been created by you.</p></li>
</ol>

CC BY-SA 3.0
2018-01-04T07:19:52.423Z
There is no encryption involved, at all. Digital signature algorithms are distinct from encryption algorithms. One notable example is RSA, which can both be used for encryption and signing, but this is not true for every system. ECDSA is only for signatures.
Pieter Wuille
CC BY-SA 3.0
2018-01-03T15:57:34.150Z
2018-02-08T08:52:20.603Z
2018-02-08T08:52:20.603Z
OldStick
<p>Just curious, if I send a transaction from one address to another, how do they verify it without knowing my private key?</p>

CC BY-SA 3.0
2013-12-05T22:12:40.543Z
The ability to do this is the whole point of [digital signatures](http://en.wikipedia.org/wiki/Digital_signature).
Nate Eldredge
CC BY-SA 3.0
2013-12-05T22:18:43.023Z
Related: http://bitcoin.stackexchange.com/q/10759/5406
Murch
<transactions><hash><signature><verification><message-signing>
How do signatures work?
Connor
# How do signatures work?

(Asked by: username_0 on 2013-12-05)

Just curious, if I send a transaction from one address to another, how do they verify it without knowing my private key?

**Tags:** transactions, hash, signature, verification, message-signing

> **Comments:**
> **username_1**: The ability to do this is the whole point of [digital signatures](http://en.wikipedia.org/wiki/Digital_signature).  
> **username_2**: Related: http://bitcoin.stackexchange.com/q/10759/5406  

---

## 2 answers

### Answer by username_3 on 2013-12-05. Score: 8

Bitcoin uses the Elliptic Curve Digital Signature Algorithm (ECDSA). Your private key is used to create the signature and your public key is used to verify the signature. This allows anybody to verify your signature as long as they have your public key.

For more detailed information: [Digital Signature Algorithm](http://en.wikipedia.org/wiki/Digital_Signature_Algorithm) and [Elliptic Curve DSA](http://en.wikipedia.org/wiki/Elliptic_Curve_DSA)

> **Comments:**
> **username_4**: According to bitcoin wiki,  "A signature is mathematically generated from a hash of something to be signed, plus a private key." In the context of bitcoin, what is the "something" to be hashed here? Is it always the transaction?  
> **username_5**: It's a modified version of the spending transaction. It's modified because the spending transaction contains the signature itself, so if not modified, that signature would need to sign itself.  

---

### Answer by username_6 on 2018-01-03. Score: -1

The short answer seems to be correct. But more detailed explanations say that your bitcoin digital signature consists of an encryption of a hash of the tx data together with a hash of your private key.

I don't see why the hash of your private key needs to be included in a digital signature.

See below step will help you and surely this would work:

1. You create a hash of the tx data. You then *sign* the hash using your private key. This results in your digital signature.
2. You then propagate the tx data through the network, together with your digital signature and the corresponding public key needed to verify the signature.
3. Anyone on the network can then use the public key to verify your signature and recover the hash of the tx data.
4. They then themselves create a hash of the tx data using the same hash function that you used in step 1.
5. If their own hash of the tx data matches the hash they recovered by signing with your signature, then that proves that tx hash from your digital signature must have been created by you.

> **Comments:**
> **username_5**: There is no encryption involved, at all. Digital signature algorithms are distinct from encryption algorithms. One notable example is RSA, which can both be used for encryption and signing, but this is not true for every system. ECDSA is only for signatures.  

---

