4

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

0

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.

4

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.

  • 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 Jan 20 '18 at 13:09
  • Yes that is right. – John Singh Jan 20 '18 at 13:44
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 :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.