3 weeks ago I began learning about Bitcoins, and now I'm analyzing how it works internally. My problem is that I can't understand what two public key hashes are compare to use de OP_EQUALVERIFY, because I understand that sender's public key is compare with receiver's public key, but they aren't the same hash.
Here is an example: A script is: the scriptSig of your tx + the scriptPubkey of the tx you spent
In the same example: The scriptSig of your tx is: Sig + your pubkey The scriptPubkey of the tx you spent is (according to blockexplorer):
OP_DUP OP_HASH160 fc88853163ab2a9646908a82e8a87b6f185c2047 OP_EQUALVERIFY OP_CHECKSIG
ripemd160(sha256('0x0457d7d7af586aaad529b5770bb43295051e7090e2bc884181d608dae2517c7812b25e326753cbe0b767f579bbcb5cffe492d22b93f2ff5501074eb9e8f8547c4a')) = fc88853163ab2a9646908a82e8a87b6f185c2047...
I read that but I can't understand that the stack and scripts function. The stack is empty. On the first step the Sender’s Signature and Public Key are combined. Then these two constants are added in the stack. Then the Public Key is duplicated. After that this duplicated item is hashed. Now the Receiver´s Public Key Hash is added to the stack. The script compares the equality between the two slack items and finally the signature is checked for two slack items.
Is that correct? I think that i'm wrong with something. If it is posible to someone answer or reply me