Recently I read some articles about BITCOIN protocol and it's transaction. I understand(maybe it is incorrect) these rules:
- An input is what we call an output when you're spending it in a transaction.
- A public key is the early form of an address.
- It seem's that an "input" has two jobs: Select an Output and Unlock it.
- Every transaction has a unique TXID, so by using that with a specific output number(VOUT), we can refer to any output in the blockchain.
- Each output is set with a locking script. So if we want to spend one, we need to supply an unlocking script(ScriptSig).
- ScriptSig in an input is a script that unlocks the input and ScriptPubKey is a A script that locks the output.
if all rules that I wrote is correct, why we can generate an address which is obtained from public key in ScriptPubKey but we can't generate previous output address from the public key inside the ScriptSig?