3
1
These are my understanding or assumptions.
Sign a document requires secret key and message only as below
SignDocument(secret key, message) => signature
And verification of signature requires public key, signature and message as below
VerifySignature(signature, message , public key)
Purpose of scriptPubKey is a script for validating signature for P2PKH transactions.
It is clear that we need public key in order to validate transaction but existing transaction data doesn't have public key data but hash of public key only.
I can easily understand Pay to Public Key transaction because public key is part of transaction data.
If public key is not stored in blockchain so how it is possible to validate P2PKH transaction without public key?
Thank you for very detailed answer. I will read this and the articles again and again. A question, Can you please tell me how do you decode scriptSig which is this one 4830........ in your example – Freshblood – 2017-11-08T12:05:04.087
effectively I have a set of (OpenBSD/MacOS/Linux) shell scripts, which do this for me. I created them based on this site here: https://en.bitcoin.it/wiki/Script.
– pebwindkraft – 2017-11-08T12:09:39.477