<p>Bitcoin could function with just a simple mechanism for signing transactions, but it would not be as versatile.  By locking and unlocking outputs with a scripting language, a great deal more becomes possible.  For example, smart contracts, payment channels, multisig, etc...</p>

<p>By using scripts, bitcoin is better.</p>

CC BY-SA 3.0
2018-01-20T22:08:02.893Z
2018-01-20T22:08:02.893Z
Jestin
<p>Yes it does use a language called script. The transactions have both a locking and unlocking script and it is there to allow the specification of simple conditions for spending so that transaction validation is not based on a static pattern and allows the spending of money to be programmable. The locking script normally contains the public key hash while the unlocking script normally contains a digital signature. The scripting language also caters for more complex multisignature scripts. If you just limited the processing to a signature verification then it would not allow for richer functionality and multisignature functionality.</p>

CC BY-SA 3.0
2018-01-20T13:09:03.810Z
Thanks. I'm trying to create my own "bitcoin" JUST TO LEARN more about how it works. So If I want to do simple blockchain, that the only functionallity I want is to verify that the person who created the transaction is the owner, then I could ignore the Script language and simply add a signature. Right?
Vladislav Zhdanov
CC BY-SA 3.0
2018-01-20T13:44:25.250Z
Yes that is right.
John Singh
CC BY-SA 3.0
2018-01-20T13:03:29.070Z
2018-01-20T13:03:29.070Z
John Singh
<p>a signture proofs, that the (hash value of) transaction was signed by a specific person (therefor the privkey is required). Also you need to proof, that you are the rightful owner, and the tx is not moved by someone else (gets stolen). To spend a tx, a hash calculation needs to be done, to move the funds from A to B. This is why there is the pubkey script comes in. The std P2PKH transaction comes with a (ripemd160) hash, that you must be able to create from the pubkey. And with today's knowledge, you can only create this, if you don't have this pubkey. Then you just "see" a tx with a hash in the blockchain. Yu can't steel it...</p>

<p>I recommend the book from Andreas (Mastering Bitcoin), or a similiar resource, to gain the understanding, why it was implemented this way in Bitcoin - at least this helped me alot :-)</p>

CC BY-SA 3.0
2018-01-20T16:43:25.127Z
2018-01-20T16:43:25.127Z
pebwindkraft
<p>From what I heard is that Bitcoin use Script to verify transactions (I'm probably wrong).</p>

<p>Wouldn't be sufficient just signing the transaction with the private key and append the signature to the transaction? This way everyone could verify if the transaction was sent form that public key.</p>

<p>Is this insecure?</p>

<p>I imagine that Script is used for other things too. But If I only wanted to verify the transaction, I could do it with a simple signature right?</p>

<p>Thanks</p>

<bitcoind><script><signature>
Why does Bitcoin uses a Script language?
Vladislav Zhdanov
# Why does Bitcoin uses a Script language?

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

From what I heard is that Bitcoin use Script to verify transactions (I'm probably wrong).

Wouldn't be sufficient just signing the transaction with the private key and append the signature to the transaction? This way everyone could verify if the transaction was sent form that public key.

Is this insecure?

I imagine that Script is used for other things too. But If I only wanted to verify the transaction, I could do it with a simple signature right?

Thanks

**Tags:** bitcoind, script, signature


---

## 3 answers

### Answer by username_1 on 2018-01-20. Score: 1 | Accepted answer

Bitcoin could function with just a simple mechanism for signing transactions, but it would not be as versatile. By locking and unlocking outputs with a scripting language, a great deal more becomes possible. For example, smart contracts, payment channels, multisig, etc...

By using scripts, bitcoin is better.


---

### Answer by username_2 on 2018-01-20. Score: 3

Yes it does use a language called script. The transactions have both a locking and unlocking script and it is there to allow the specification of simple conditions for spending so that transaction validation is not based on a static pattern and allows the spending of money to be programmable. The locking script normally contains the public key hash while the unlocking script normally contains a digital signature. The scripting language also caters for more complex multisignature scripts. If you just limited the processing to a signature verification then it would not allow for richer functionality and multisignature functionality.

> **Comments:**
> **username_0**: Thanks. I'm trying to create my own "bitcoin" JUST TO LEARN more about how it works. So If I want to do simple blockchain, that the only functionallity I want is to verify that the person who created the transaction is the owner, then I could ignore the Script language and simply add a signature. Right?  
> **username_2**: Yes that is right.  

---

### Answer by username_3 on 2018-01-20. Score: 1

a signture proofs, that the (hash value of) transaction was signed by a specific person (therefor the privkey is required). Also you need to proof, that you are the rightful owner, and the tx is not moved by someone else (gets stolen). To spend a tx, a hash calculation needs to be done, to move the funds from A to B. This is why there is the pubkey script comes in. The std P2PKH transaction comes with a (ripemd160) hash, that you must be able to create from the pubkey. And with today's knowledge, you can only create this, if you don't have this pubkey. Then you just "see" a tx with a hash in the blockchain. Yu can't steel it...

I recommend the book from Andreas (Mastering Bitcoin), or a similiar resource, to gain the understanding, why it was implemented this way in Bitcoin - at least this helped me alot :-)


---

