Post
Topic
Board Beginners & Help
Re: scriptSig
by
AlexR12
on 19/12/2017, 22:53:46 UTC
Thank you very much for answering! As I see it:

1. scriptSig is an input of the "redeeming" transaction (the one where I want to spend previously earned bitcoins) and scriptPubKey is an output specified in the "referenced" transaction (the one where I earned those bitcoins that I'm trying to spend now).

2. To see if I'm allowed to spend those bitcoins, a miner will concatenate scriptSig and scriptPubKey and run the resulting script.

3. From scriptSig signature and public key come out. This public key is then hashed and compared with the hash of the public key specified in scriptPubKey. This is the first check for validity of the transaction. The second check if for the signature.

Question: in step 3, how to get the public key from scriptSig? In simple terms, I give you scriptSig, will you be able to tell the public key?