-1
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?
thank you. I want to generate previous output address just to save a transaction history and no more. and the link you sent it, just explain how to generate destination address which is obtain from ScriptPubKey and not ScriptSig. I want previous address not next destination address. – Saeed – 2019-06-17T13:51:28.303
As I've commented before, what you're trying to do, accounting via packet captures, is utterly idiotic. Do not build systems like this if you want to retain control of your money. – Anonymous – 2019-06-17T14:00:10.103
@Anonymous I don't have any bitcoin and also i don't want to extract address from packet capture. if you read my question correctly, I just want to find an algorithm to extract previous address from ScriptSig in input, like the algorithm which is used to extract destination address from ScriptPubKey in ouput. if you don't understand my question or don't know my answer you are not compelled to answer me. thank you. – Saeed – 2019-06-17T14:12:39.767
You literally asked how to do that in the previous question. – Anonymous – 2019-06-18T11:09:05.717
It’s rather funny that you don’t think people would make the connection between the two questions, or are you claiming that it’s a total coincidence? – Anonymous – 2019-06-18T11:11:41.443
@Anonymous I'm just a programmer who intrested in Bitcoin and extract useful information from tx messages. so you should not judge me. – Saeed – 2019-06-22T06:13:03.183