<p>Bitcoin transactions are not encrypted, they are cryptographically signed.</p>

<p>You can use a public/private keypair 2 ways:
(massive simplification warning)</p>

<ul>
<li>Encrypt a message using a public key and then decrypt it with a private key</li>
<li>Sign a message using a private key and validate the signature with the public key</li>
</ul>

<p>The second method is the one that is used by Bitcoin. A message is placed in the distributed ledger that bitcoins have been sent from X to Y (and typically Z), and signed by the private key of X. X is the source bitcoin address, Y is the destination, and Z is the change address.</p>

CC BY-SA 3.0
2015-02-20T19:50:36.133Z
Maybe even note that the algorithm being used for signatures by Bitcoin (ECDSA) cannot even be used for encryption. Many people think signing is "just encrypting with the private key instead of the public key", but that only works for RSA.
Pieter Wuille
CC BY-SA 3.0
2015-02-20T19:35:59.773Z
2015-02-20T19:35:59.773Z
Scrybe
<p>Bitcoin scriptSig's carry everything they need in order to satisfy the scriptPubKey that encumbers an output. As such they are regarded as stateless, ie, self contained. </p>

<p>Whenever a signature needs to be verified, the public key is exposed in the script, giving other nodes what they need to validate the transaction.</p>

CC BY-SA 3.0
2015-05-18T16:22:30.487Z
2015-05-18T16:22:30.487Z
karimkorun
<p>Trying to get my head around her royal Bitcoin here...</p>

<p>I understand that blocks of transactions are broadcast to the network, and that miners verify that the BC is 'spendable' by trawling the blockchain and following the wallet address's transaction history (or at least I assume that's how it works).</p>

<p>But how does one actually verify that the BC transaction has been signed by it's owner when the miners don't have access to the private key? To put it simpler, how can verification take place without processing <strong><em>both</em></strong> the public and private keys?</p>

<p>I'm probably misunderstanding PKI encryption, but (say) with SSH, the private key would be on a trusted server and verification would take place on that server. How can that possibly work in a distributed network?</p>

CC BY-SA 3.0
2015-02-20T18:07:35.810Z
SSH uses public key cryptography in two contexts - clients proving to the server that they're who they say they are, and servers proving to clients that they're who they say they are. Which one are you trying to make an analogy with?
Nick ODell
CC BY-SA 3.0
2015-02-20T22:25:14.840Z
@NickODell I was being a little dense with this analogy. I was forgetting that the private key is never actually sent to the server; it's simply used to encrypt a bipartisan message between the machines.
shennan
<private-key><public-key><verification><transaction-verification>
How can transactions be verified without the private key?
shennan
# How can transactions be verified without the private key?

(Asked by: username_0 on 2015-02-20)

Trying to get my head around her royal Bitcoin here...

I understand that blocks of transactions are broadcast to the network, and that miners verify that the BC is 'spendable' by trawling the blockchain and following the wallet address's transaction history (or at least I assume that's how it works).

But how does one actually verify that the BC transaction has been signed by it's owner when the miners don't have access to the private key? To put it simpler, how can verification take place without processing ***both*** the public and private keys?

I'm probably misunderstanding PKI encryption, but (say) with SSH, the private key would be on a trusted server and verification would take place on that server. How can that possibly work in a distributed network?

**Tags:** private-key, public-key, verification, transaction-verification

> **Comments:**
> **username_1**: SSH uses public key cryptography in two contexts - clients proving to the server that they're who they say they are, and servers proving to clients that they're who they say they are. Which one are you trying to make an analogy with?  
> **username_0**: @username_1 I was being a little dense with this analogy. I was forgetting that the private key is never actually sent to the server; it's simply used to encrypt a bipartisan message between the machines.  

---

## 2 answers

### Answer by username_2 on 2015-02-20. Score: 3 | Accepted answer

Bitcoin transactions are not encrypted, they are cryptographically signed.

You can use a public/private keypair 2 ways:
(massive simplification warning)

* Encrypt a message using a public key and then decrypt it with a private key
* Sign a message using a private key and validate the signature with the public key

The second method is the one that is used by Bitcoin. A message is placed in the distributed ledger that bitcoins have been sent from X to Y (and typically Z), and signed by the private key of X. X is the source bitcoin address, Y is the destination, and Z is the change address.

> **Comments:**
> **username_3**: Maybe even note that the algorithm being used for signatures by Bitcoin (ECDSA) cannot even be used for encryption. Many people think signing is "just encrypting with the private key instead of the public key", but that only works for RSA.  

---

### Answer by username_4 on 2015-05-18. Score: 0

Bitcoin scriptSig's carry everything they need in order to satisfy the scriptPubKey that encumbers an output. As such they are regarded as stateless, ie, self contained.

Whenever a signature needs to be verified, the public key is exposed in the script, giving other nodes what they need to validate the transaction.


---

