From 65aa6b2546c2ab9087cf904f8fdaf4b3ab00276f Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Wed, 31 May 2017 11:33:55 -0700 Subject: [PATCH] Update 7_3_Scripting_a_P2PKH.md --- 7_3_Scripting_a_P2PKH.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/7_3_Scripting_a_P2PKH.md b/7_3_Scripting_a_P2PKH.md index 991e099..d2ef3d6 100644 --- a/7_3_Scripting_a_P2PKH.md +++ b/7_3_Scripting_a_P2PKH.md @@ -6,7 +6,7 @@ With a basic understanding of Bitcoin Scripting in hand, you can now easily anal ## Understand the Unlocking Script -We've long said that when funds are sent to a Bitcoin address, they're locked to the private key associated with that address. This is managed through the `scriptPubKey` of a P2PKH transaction, which is designed such that it requires the redeemer to have the private key associated with the the P2PKH Bitcoin address. To be precise, the redeemer must supply both the actual public key and a signature generated by the private key. +We've long said that when funds are sent to a Bitcoin address, they're locked to the private key associated with that address. This is managed through the `scriptPubKey` of a P2PKH transaction, which is designed such that it requires the recipient to have the private key associated with the the P2PKH Bitcoin address. To be precise, the recipient must supply both the actual public key and a signature generated by the private key. That's what the `scriptSig` unlocking script seen in the previous section showed, a ` `: `3045022100c4ef5b531061a184404e84ab46beee94e51e8ae15ce98d2f3e10ae7774772ffd02203c546c399c4dc1d6eea692f73bb3fff490ea2e98fe300ac6a11840c7d52b6166[ALL] 0319cd3f2485e3d47552617b03c693b7f92916ac374644e22b07420c8812501cfb`. @@ -23,7 +23,7 @@ Script: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CH ``` Now, you can evaluate how the P2PKH UTXO is unlocked. -First, you put the initial constants on the stack and make a duplicate of the pubKey: +First, you put the initial constants on the stack, then make a duplicate of the pubKey with `OP_DUP`: ``` Script: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG Stack: [ ] @@ -39,7 +39,7 @@ Stack: [ ] ``` Why the duplicate? Because that's what's required by the script! -Next, your `OP_HASH160` pops the `` off the stack, hashes it, and puts the result back on the stack. +Next, `OP_HASH160` pops the `` off the stack, hashes it, and puts the result back on the stack. ``` Script: OP_EQUALVERIFY OP_CHECKSIG Stack: [ ]