9
3
I read about Input and output scripts on the wiki here:
https://en.bitcoin.it/wiki/Transactions
Let's say, I use my Bitcoin - QT Program, I go to "Send Coins" tab, enter a Bitcoin Address, BTC amount and then click Send.
Is the output script generated by my program?
For an output script, we need the Value, The destination Address and the scriptPubKey. My client program has all this data.
scriptPubKey refers to Public Key of? My public key or the person I intend to send the Bitcoins to?
So, now, once the output script is formed, is it broadcast over the Bitcoin Network?
Where does the Input Script come from?
the scriptSig in Input Script refers to the Public Key and Signature of whom?
When I am sending Bitcoins to a Bitcoin Address, the input Script is automatically generated by what?
Even though the wiki gives details about Input Script and output Script, I was unable to correlate it to a real time scenario where one person sends BTC to another.
Thanks. So, the Public Key in scriptPubKey differs from the Public Key in scriptSig? Also, we only have the Bitcoin Address of the person we intend to send the Bitcoins to. How do we get the Public Key of the recipient? I know that Bitcoin Address is itself the 160-bit hash of the public portion of the recipient's Public/Private Key pair. But I am unable to correlate the two. – Neon Flash – 2013-03-09T06:06:50.483
@NeonFlash I have edited my answer. – Nick ODell – 2013-03-09T07:41:49.457
Thanks. I think I have understood now. So, the scriptPubKey which we are referring to in the Transaction Verification phase, is "NOT" the recipient's Bitcoin Address. It is the scriptPubKey stored in the "output script" of the previous transaction of the sender. The sender's scriptSig (sig + pubkey) will be verified against the scriptPubKey stored in the output script of previous transaction. Then, it can be claimed by the sender. The new output script generated by the sender, will assign the Bitcoins to recipient's address and provide a way for the recipient to claim them in future. Correct? – Neon Flash – 2013-03-09T10:07:22.353