<p>Both P2SH and P2PKH addresses rely on HASH160. The difference is in the script.</p>

<p>In a P2SH address (<code>3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4</code> in your example), the script is <code>a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 87</code> (spaces mine). This amounts to <code>OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUAL</code>. In short, the Bitcoin network will take a provided redeemscript and signature data, and compare the hash160 of that redeem script against what is given in the address outputs.</p>

<p>For <code>1H825FgspbkznbiGAnAjFjan7dmYFjpsFe</code>, the script is <code>76a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 88ac</code> (spaces mine). This amounts to OP_DUP OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUALVERIFY OP_CHECKSIG. This essentially tells the network to take the provided public key when spending an input, duplicate it, hash the duplicate, compare it and verify that it equals B0D5D1FB94B76B39EE82771027BEFD17131042FA, then check the signature against the original public key (the one you duplicated).</p>

<p>Wallets and explorers will decide which address format to display based on the opcodes in the script. A P2SH address will always start with <code>a914</code> and end with <code>87</code>. A P2PKH will always start with <code>76a914</code> and end with <code>88ac</code>.</p>

<p>Since Hashing by definition is not a one-to-one function, there is some private key out there for which the pubkey hash would be B0D5D1FB94B76B39EE82771027BEFD17131042FA. However, I'm not aware of any known private key/redeem script pairs that correspond to the same HASH160</p>

CC BY-SA 3.0
2018-03-31T22:09:29.207Z
2018-03-31T22:09:29.207Z
Raghav Sood
<p>Why the same Hash 160 has different balance in Bitcoin network?</p>

<p>Hash 160 is <code>B0D5D1FB94B76B39EE82771027BEFD17131042FA</code>.</p>

<p>In the one way it is the address <code>1H825FgspbkznbiGAnAjFjan7dmYFjpsFe</code> that has zero balance.</p>

<p>By the second way, it is the another address <code>3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4</code> that has non-zero balance.</p>

<p>I try to track it on <code>blockchain.info</code> site.</p>

<p>Why there are that differences?</p>

<bitcoin-core><blockchain><address>
Differences between addresses with the same 20B hash (Hash 160)
Denis Leonov
# Differences between addresses with the same 20B hash (Hash 160)

(Asked by: username_0 on 2018-03-31)

Why the same Hash 160 has different balance in Bitcoin network?

Hash 160 is `B0D5D1FB94B76B39EE82771027BEFD17131042FA`.

In the one way it is the address `1H825FgspbkznbiGAnAjFjan7dmYFjpsFe` that has zero balance.

By the second way, it is the another address `3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4` that has non-zero balance.

I try to track it on `blockchain.info` site.

Why there are that differences?

**Tags:** bitcoin-core, blockchain, address


---

## 1 answers

### Answer by username_1 on 2018-03-31. Score: 2 | Accepted answer

Both P2SH and P2PKH addresses rely on HASH160. The difference is in the script.

In a P2SH address (`3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4` in your example), the script is `a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 87` (spaces mine). This amounts to `OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUAL`. In short, the Bitcoin network will take a provided redeemscript and signature data, and compare the hash160 of that redeem script against what is given in the address outputs.

For `1H825FgspbkznbiGAnAjFjan7dmYFjpsFe`, the script is `76a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 88ac` (spaces mine). This amounts to OP\_DUP OP\_HASH160 OP\_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP\_EQUALVERIFY OP\_CHECKSIG. This essentially tells the network to take the provided public key when spending an input, duplicate it, hash the duplicate, compare it and verify that it equals B0D5D1FB94B76B39EE82771027BEFD17131042FA, then check the signature against the original public key (the one you duplicated).

Wallets and explorers will decide which address format to display based on the opcodes in the script. A P2SH address will always start with `a914` and end with `87`. A P2PKH will always start with `76a914` and end with `88ac`.

Since Hashing by definition is not a one-to-one function, there is some private key out there for which the pubkey hash would be B0D5D1FB94B76B39EE82771027BEFD17131042FA. However, I'm not aware of any known private key/redeem script pairs that correspond to the same HASH160


---

