From b5b6d232c97d41cd9328f3923ab15615526131df Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Thu, 1 Jun 2017 11:52:27 -0700 Subject: [PATCH] Update 7_3_Scripting_a_P2PKH.md --- 7_3_Scripting_a_P2PKH.md | 4 ++++ 1 file changed, 4 insertions(+) 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.