<p>I am trying to understand the unlocking portion of the transactions inputs of this pay-to-public-key-hash transaction: <a href="https://www.blockchain.com/btc/tx/0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2" rel="nofollow noreferrer">https://www.blockchain.com/btc/tx/0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2</a></p>
<p>Pasting the following unlocking+locking portion into bitcoin IDE:</p>
<pre><code>3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301
0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf
OP_DUP
OP_HASH160
7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8
OP_EQUALVERIFY
OP_CHECKSIG
</code></pre>
<p>Shows me the OP_HASH160 results in a public key hash of</p>
<pre><code>0x6DF13DE1F1D824380834E0D42E49E5E451A647CF
</code></pre>
<p>But for this script to pass the OP_EQUALVERIFY it should be</p>
<pre><code>7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8
</code></pre>
<p>This transaction is valid. What am I  misunderstanding?</p>

CC BY-SA 4.0
2021-05-28T16:49:06.337Z
Whatever Bitcoin IDE you are using is simply hashing it incorrectly. Using other hashing tools results in the correct hash160.
Ava Chow
CC BY-SA 4.0
2021-05-28T17:07:45.187Z
You're correct. The following command will produce the correct public key hash.

> echo $PUB_KEY | xxd -r -p | openssl dgst -sha256 | openssl dgst -rmd160
poke
<p2pkh>
Trying to verify this P2PKH transaction
poke
# Trying to verify this P2PKH transaction

(Asked by: username_0 on 2021-05-28)

I am trying to understand the unlocking portion of the transactions inputs of this pay-to-public-key-hash transaction: https://www.blockchain.com/btc/tx/0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2
Pasting the following unlocking+locking portion into bitcoin IDE:
3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301
0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf
OP_DUP
OP_HASH160
7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8
OP_EQUALVERIFY
OP_CHECKSIG

Shows me the OP_HASH160 results in a public key hash of
0x6DF13DE1F1D824380834E0D42E49E5E451A647CF

But for this script to pass the OP_EQUALVERIFY it should be
7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8

This transaction is valid. What am I  misunderstanding?

**Tags:** p2pkh

> **Comments:**
> **username_1**: Whatever Bitcoin IDE you are using is simply hashing it incorrectly. Using other hashing tools results in the correct hash160.  
> **username_0**: You're correct. The following command will produce the correct public key hash.  > echo $PUB_KEY | xxd -r -p | openssl dgst -sha256 | openssl dgst -rmd160  

---

## 0 answers

