<p>A Bitcoin address is actually an encoded public key hash. The public key is hashed with SHA-256 and RIPEMD160, a version byte is added and a checksum is created, and then the address is encoded with Base 58 which gives the normal bitcoin address you see day-to-day. The <code>pubKeyHash</code> is actually just the SHA256/RIPEMD160 hash of the public key, before the checksum is added or encoded with Base58. So it is not the address itself, but it can be obtained from an address. It is a hash of the <strong>public key</strong> not a hash of the address.</p>

CC BY-SA 3.0
2017-12-04T06:15:38.283Z
2017-12-04T06:15:38.283Z
meshcollider
<p>In Bitcoin protocol, to set the output of a transaction you need a <code>scriptPubKey</code> which is in the following format.</p>

<p><code>scriptPubKey = OP_DUP OP_HASH160 &lt;pubKeyHash&gt; OP_EQUALVERIFY OP_CHECKSIG</code></p>

<p>Is <code>&lt;pubKeyHash&gt;</code> the address of the receiver of bitcoin <strong>or</strong> is it the <strong>hash</strong> of a address of the receiver?</p>

<bitcoin-core><hash><script><public-key>
Bitcoin - Is the <pubKeyHash> in scriptPubKey already hashed?
Barney Chambers
# Bitcoin - Is the <pubKeyHash> in scriptPubKey already hashed?

(Asked by: username_0 on 2017-12-04)

In Bitcoin protocol, to set the output of a transaction you need a `scriptPubKey` which is in the following format.

`scriptPubKey = OP_DUP OP_HASH160  OP_EQUALVERIFY OP_CHECKSIG`

Is  the address of the receiver of bitcoin **or** is it the **hash** of a address of the receiver?

**Tags:** bitcoin-core, hash, script, public-key


---

## 1 answers

### Answer by username_1 on 2017-12-04. Score: 5 | Accepted answer

A Bitcoin address is actually an encoded public key hash. The public key is hashed with SHA-256 and RIPEMD160, a version byte is added and a checksum is created, and then the address is encoded with Base 58 which gives the normal bitcoin address you see day-to-day. The `pubKeyHash` is actually just the SHA256/RIPEMD160 hash of the public key, before the checksum is added or encoded with Base58. So it is not the address itself, but it can be obtained from an address. It is a hash of the **public key** not a hash of the address.


---

