Bitcoin Forum

Other => Beginners & Help => Topic started by: AlexR12 on December 14, 2017, 04:38:27 AM



Title: Bitcoin script
Post by: AlexR12 on December 14, 2017, 04:38:27 AM
Hello!
I'm trying to understand Bitcoin scripts, but it seems like all sources that I find on the Internet assume that the reader has computer science background. For example, "Each transaction output doesn't just specify a public key. It actually specifies a script". Why? What's the problem with specifying just a public key? What breaks down in the design of Bitcoin if we don't use any scripts?


Title: Re: Bitcoin script
Post by: AlexR12 on December 14, 2017, 04:25:37 PM
Dear forum members, I would like to ask you again! Could someone answer my question from the previous message? I would really appreciate it!


Title: Re: Bitcoin script
Post by: crairezx20 on December 14, 2017, 04:41:08 PM
Honestly for me i don't really understand what actually you wanted to know but if you wanted more about bitcoin better to check the wiki for bitcoin
https://en.wikipedia.org/wiki/Bitcoin
Or this main wiki page of bitcoin https://en.bitcoin.it/wiki/Main_Page

If you are talking about for transaction the public key that i know is bitcoin address? am i right and then the script you are talking about is how to send the bitcoin to other bitcoin address specify with public key?


Title: Re: Bitcoin script
Post by: odolvlobo on December 14, 2017, 05:12:01 PM
Hello!
I'm trying to understand Bitcoin scripts, but it seems like all sources that I find on the Internet assume that the reader has computer science background. For example, "Each transaction output doesn't just specify a public key. It actually specifies a script". Why? What's the problem with specifying just a public key? What breaks down in the design of Bitcoin if we don't use any scripts?


The output script specifies the requirements for spending the bitcoins in the output. It allows for many different kinds of transactions. If the output only includes the address (actually pubkeyhash), then there could only be one kind of transaction.


Title: Re: Bitcoin script
Post by: mayo2u on December 14, 2017, 05:19:04 PM
Hello!
I'm trying to understand Bitcoin scripts, but it seems like all sources that I find on the Internet assume that the reader has computer science background. For example, "Each transaction output doesn't just specify a public key. It actually specifies a script". Why? What's the problem with specifying just a public key? What breaks down in the design of Bitcoin if we don't use any scripts?


So, you're trying to understand how Bitcoin works and you wonder why you need to understand the basics of programming? That's like trying to understand RSA or elliptic curve cryptography and wondering why you need to have basic math skills.


Quote
Bitcoin uses a scripting system for transactions. Forth-like, Script is simple, stack-based, and processed from left to right. It is purposefully not Turing-complete, with no loops.

A script is essentially a list of instructions recorded with each transaction that describe how the next person wanting to spend the Bitcoins being transferred can gain access to them. The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two things: the spender must provide

a public key that, when hashed, yields destination address D embedded in the script, and
a signature to show evidence of the private key corresponding to the public key just provided.
Scripting provides the flexibility to change the parameters of what's needed to spend transferred Bitcoins. For example, the scripting system could be used to require two private keys, or a combination of several, or even no keys at all.
https://en.bitcoin.it/wiki/Script


This is a pretty straight forward answer. If you want to delve deeper then you need to start grasping some programming basics. To answer your question - how would the transactions to the block be added without some mechanism to do so?


Title: Re: Bitcoin script
Post by: AlexR12 on December 14, 2017, 07:05:37 PM
Big thanks to all who responded! I want to know the role that bitcoin scripts play in bitcoin transaction output. In other words, assume there are no scripts in bitcoin's transaction output and only a public key is there, what exactly will be impossible under this assumption? My question came from the following line in a textbook on Bitcoins: "...we study the Bitcoin scripting language and come to understand why a script is used [...in transaction's output...] instead of simply assigning a public key". But the book does a poor job in explaining it. That's why I'm asking it here. Thanks is advance for your patience with newbies :-)


Title: Re: Bitcoin script
Post by: yizhaks on December 14, 2017, 07:07:18 PM
bitcoin is not all about transferring coins from one address to the other. there are other possibilities, and through the script you tell the network exactly what you want to do