diff --git a/7_3_Scripting_a_P2PKH.md b/7_3_Scripting_a_P2PKH.md index 6e8e560..7b14967 100644 --- a/7_3_Scripting_a_P2PKH.md +++ b/7_3_Scripting_a_P2PKH.md @@ -35,6 +35,7 @@ Script: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG Stack: [ ] Script: OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG +Running: OP_DUP Stack: [ ] ``` Why the duplicate? Because that's what's required by the script! @@ -42,6 +43,7 @@ Why the duplicate? Because that's what's required by the script! Next, `OP_HASH160` pops the `` off the stack, hashes it, and puts the result back on the stack. ``` Script: OP_EQUALVERIFY OP_CHECKSIG +Running: OP_HASH160 Stack: [ ] ``` Then, you place the `` that was in the locking script on the stack: @@ -54,11 +56,13 @@ Stack: [ ] Assuming the two `es` are equal, you will have the following result: ``` Script: OP_CHECKSIG +Running: OP_EQUALVERIFY Stack: [ ] ``` At this point you've proven that the `` supplied in the `scriptSig` hashes to the Bitcoin address in question, so you know that the redeemer knew the public key. They just need to prove knowledge of the private key, which is done with `OP_CHECKSIG`, which confirms that the unlocking script's signature matches that public key. ``` Script: +Running: OP_CHECKSIG Stack: [ True ] ``` The Script now ends and the transaction is allowed to respend the UTXO in question.