0
During execution of the script i.e. ScriptSig + ScriptPub , the last step is the verification of the Signature against the public key provided by the recipient. How does this work and what is the significance of verifying two entities which belong to the same user?
Okay but according to my understanding, both the signature and the public key are provided by the same address. So how can it be fool proof? – Varad Bhatnagar – 2018-02-11T18:44:26.090
The scriptPubKey of the output that is being spent specifies that the public key must hash to a hash specified by the scriptPubKey. – Andrew Chow – 2018-02-11T18:49:29.090
Can you please elaborate? I am a beginner in Blockchain and Bitcoin. – Varad Bhatnagar – 2018-02-11T18:57:35.017
Each input must reference the output from a previous transaction that it spends from. That output contains an output script which is called the scriptPubKey. That scriptPubKey is combined with the input script, the scriptSig, and run as a program. The scriptPubKey typically specifies the hash of the public key that is allowed to spend the transaction output. The person spending that output has no control over the scriptPubKey; it is provided by the person creating the output. – Andrew Chow – 2018-02-11T19:00:01.843
A similar message, and a link to Andreas’ book, cause explaining here all the stuff would waste the space... https://bitcoin.stackexchange.com/questions/69062/why-does-bitcoin-uses-a-script-language/69077#69077
– pebwindkraft – 2018-02-11T19:04:52.937