<p>It appears the tool you're using to generate the hashes interprets the input as ASCII or UTF-8 characters, even though it should be interpreted as a hexadecimal number.</p>
<p>SHA256(0312437e326ef7bef6ea13209720f308548d2d205a4bf94e73bf8233ea7e6bb769) is actually e39ddbed20e2baba5b24f0ee4532249853d22b5d76c48a7a70ec2c373f895c01.</p>

CC BY-SA 4.0
2022-11-20T22:28:32.400Z
Thanks, that's it. Now everything checks out.
user138015
CC BY-SA 4.0
2022-11-20T22:14:34.433Z
2022-11-20T22:14:34.433Z
Vojtěch Strnad
<p>I'm trying to understand Pay-to-Pubkey-Hash transactions. I picked a random P2PKH  transaction in a blockchain explorer: <a href="https://www.blockchain.com/btc/tx/ab3f542ad5add941f8ba4282cebab0cca81266a83cab6b98ebb8ae730477a570" rel="nofollow noreferrer">ab3f542ad5add941f8ba4282cebab0cca81266a83cab6b98ebb8ae730477a570</a></p>
<p>As far as I understand <code>0312437e326ef7bef6ea13209720f308548d2d205a4bf94e73bf8233ea7e6bb769</code> in the <code>scriptSig</code> is the public key and <code>3b10b087f293aecbb3af71e26d17f4e0ff4ea5f7</code> in the <code>scriptPubKey</code> is the <code>OP_HASH160</code> of the public key of the receiver. So I did the following:</p>
<ol>
<li>SHA256(0312437e326ef7bef6ea13209720f308548d2d205a4bf94e73bf8233ea7e6bb769) = 7205ec1e595ce779b4d8b68fd909e00ef97eb0fdb8274951c7f923e2c82a898f</li>
<li>RIPEMD160(7205ec1e595ce779b4d8b68fd909e00ef97eb0fdb8274951c7f923e2c82a898f) = 73e440177e6b5e27eabef63905bb2e2c1616dc9d</li>
</ol>
<p>I was expecting the second step to result in <code>3b10b087f293aecbb3af71e26d17f4e0ff4ea5f7</code>.</p>
<p>What am I doing wrong?</p>

<p2pkh>
Please help me understand this P2PKH transaction
user138015
# Please help me understand this P2PKH transaction

(Asked by: username_0 on 2022-11-20)

I'm trying to understand Pay-to-Pubkey-Hash transactions. I picked a random P2PKH transaction in a blockchain explorer: [ab3f542ad5add941f8ba4282cebab0cca81266a83cab6b98ebb8ae730477a570](https://www.blockchain.com/btc/tx/ab3f542ad5add941f8ba4282cebab0cca81266a83cab6b98ebb8ae730477a570)

As far as I understand `0312437e326ef7bef6ea13209720f308548d2d205a4bf94e73bf8233ea7e6bb769` in the `scriptSig` is the public key and `3b10b087f293aecbb3af71e26d17f4e0ff4ea5f7` in the `scriptPubKey` is the `OP_HASH160` of the public key of the receiver. So I did the following:

1. SHA256(0312437e326ef7bef6ea13209720f308548d2d205a4bf94e73bf8233ea7e6bb769) = 7205ec1e595ce779b4d8b68fd909e00ef97eb0fdb8274951c7f923e2c82a898f
2. RIPEMD160(7205ec1e595ce779b4d8b68fd909e00ef97eb0fdb8274951c7f923e2c82a898f) = 73e440177e6b5e27eabef63905bb2e2c1616dc9d

I was expecting the second step to result in `3b10b087f293aecbb3af71e26d17f4e0ff4ea5f7`.

What am I doing wrong?

**Tags:** p2pkh


---

## 1 answers

### Answer by username_1 on 2022-11-20. Score: 1 | Accepted answer

It appears the tool you're using to generate the hashes interprets the input as ASCII or UTF-8 characters, even though it should be interpreted as a hexadecimal number.

SHA256(0312437e326ef7bef6ea13209720f308548d2d205a4bf94e73bf8233ea7e6bb769) is actually e39ddbed20e2baba5b24f0ee4532249853d22b5d76c48a7a70ec2c373f895c01.

> **Comments:**
> **username_0**: Thanks, that's it. Now everything checks out.  

---

