Title: !!!OP_EQUALVERIFY!!!! Post by: Zanetti on March 27, 2013, 03:31:22 PM Hello!!
My name is Ander I'm working searching information about Bitcoins, and after staying lot of time reading articles and all the information on the Wiki, now I'm trying to understand how Bitcoins works internally. I'm learning more about the encryptation of Bitcoins but there's one thing that I can't understand. <sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG In standard transaction, we need the scriptSig and the scriptPubKey. First of all the signature and the sender's public key is combined. Then the public key of the sender is duplicated and then this key is hashed. After thar we put the receiver's public key hash, and taking this two hashes then we checked both. But my problem is if the function of OP_EQUALVERIFY check if this two hashes are equal or not, because is imposible that they are equal, or I'm wrong about this process and this function is not that I think it is. I read this topic on this forum but I'm not sure if I understand what two hashes compares the OP_EQUALVERIFY. https://bitcointalk.org/index.php?topic=40100.0 I hope and answer for my question. Thank you in advance for the help, and sorry for my english. I'm not used to write in English. Ander Title: Re: !!!OP_EQUALVERIFY!!!! Post by: Zanetti on March 29, 2013, 12:49:53 PM Code: { If we have this transaction what is the function of OP_EQUALVERIFY? I'm not quite sure if this function compares the public key of the receiver with the hash inside the ScriptSig or compare the receiver's public key with the signature of the next transaction that this receiver's will do in the future. I'm a little confused. I need help please. Thanks Title: Re: !!!OP_EQUALVERIFY!!!! Post by: theymos on March 29, 2013, 01:10:18 PM Quote is imposible that they are equal No. The hashes are equal if the public keys are equal. The processing table here may help you understand how the script is processed: https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address Title: Re: !!!OP_EQUALVERIFY!!!! Post by: Zanetti on March 29, 2013, 01:49:14 PM Then the OP_EQUALVERIFY compares the whole public key of this scriptsig of this transaction
Code: 0484c7d0c1e0134144cc965c6cf98976927307944e0f5f664ca1e1815bf65434420de0fe1eee3e1ac9cf47ff5e5bedc1e6569be63d900244222e0ba226f66da594 I think that finally catch that. In this way is normal that two hashes will be the same. https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address (https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address) Here I see the sentence that I needed to understand. Note: scriptSig is in the input of the spending transaction and scriptPubKey is in the output of the previously unspent i.e. "available" transaction. Thank you for your help, theymos. |