<p>Every bitcoin is locked by output script. Only when the result of output script returns true, bitcoin is allowed to spend.</p>

<p>In your case first bitcoins are locked with Alice's private key. Which means output script will return true only if Alice had signed the transaction with her private key. Alice signs the transaction with her private key to Bob's public key, and this will unlock the bitcoin as Alice has provided her private key and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key.</p>

<p>Now, when Bob wants to spend bitcoin which is locked by his private key, he can sign the transaction with his private key to Charlie's public key.</p>

CC BY-SA 3.0
2018-01-14T20:47:16.003Z
"...and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key." - So basically you don't need a privet key in order to lock (sign) a message?
Arik Malachi
CC BY-SA 3.0
2018-01-14T20:55:13.270Z
Yeah. To lock bitcoin you only need public key. To unlock you have to pass your signature which is signed by your private key.
Preet
CC BY-SA 3.0
2018-01-14T20:35:56.540Z
2018-01-14T20:35:56.540Z
Preet
<p>I understand that if Bob gets a transaction (BTC) from Alice and want to send it to Charlie he must provide a key which proof that he is the owner of the transaction. But in what stage Bob actually signed the transaction? Can it be that Alice was the one who signed the transaction for Bob without knowing his private key? </p>

<signature>
When the transaction been signed?
Arik Malachi
# When the transaction been signed?

(Asked by: username_0 on 2018-01-14)

I understand that if Bob gets a transaction (BTC) from Alice and want to send it to Charlie he must provide a key which proof that he is the owner of the transaction. But in what stage Bob actually signed the transaction? Can it be that Alice was the one who signed the transaction for Bob without knowing his private key?

**Tags:** signature


---

## 1 answers

### Answer by username_1 on 2018-01-14. Score: 1

Every bitcoin is locked by output script. Only when the result of output script returns true, bitcoin is allowed to spend.

In your case first bitcoins are locked with Alice's private key. Which means output script will return true only if Alice had signed the transaction with her private key. Alice signs the transaction with her private key to Bob's public key, and this will unlock the bitcoin as Alice has provided her private key and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key.

Now, when Bob wants to spend bitcoin which is locked by his private key, he can sign the transaction with his private key to Charlie's public key.

> **Comments:**
> **username_0**: "...and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key." - So basically you don't need a privet key in order to lock (sign) a message?  
> **username_1**: Yeah. To lock bitcoin you only need public key. To unlock you have to pass your signature which is signed by your private key.  

---

