<p>Addresses are really just shorthands for particular scripts. The standard address type (starting with a '1' on mainnet) does in fact correspond to the exact type of script you gave above.</p>

<p>If you base58 decode such an address, you end up with a byte string of the form 0x00 + [20-byte hash] + [4-byte checksum]. The corresponding script is OP_DUP OP_HASH160 [20-byte hash] OP_EQUALVERIFY OP_CHECKSIG.</p>

<p>So, in a way, your address <em>does</em> contain the public key's hash.</p>

CC BY-SA 3.0
2017-08-23T11:28:39.857Z
I used this for a test http://lenschulwitz.com/base58 , in case it helps someone
Peter PitLock
CC BY-SA 3.0
2014-03-11T14:16:15.990Z
2014-03-11T14:16:15.990Z
Pieter Wuille
<p>The sender does not need to know your public key, only the bitcoin address you provide which can be different each time. You use the public key later to redeem the funds and send to another address.</p>

CC BY-SA 3.0
2014-03-13T20:11:44.647Z
the bitcoin address is the public key.
hafnero
CC BY-SA 3.0
2014-03-14T01:17:24.320Z
No, you are confusing the bitcoin address with the public key. You can create many diferrent bitcoin addresses using your public key and private key. You will need the public key to redeem the funds of the transaction.
99Percent
CC BY-SA 3.0
2014-03-13T04:43:41.577Z
2014-03-13T04:43:41.577Z
99Percent
<p>I am currently having a blonde moment. </p>

<p>The ScriptPubKey provides a hashed version of the receivers public key. </p>

<blockquote>
  <p>scriptPubKey  OP_DUP OP_HASH160  OP_EQUALVERIFY
  OP_CHECKSIG</p>
</blockquote>

<p>However, if I give someone my bitcoin address to send me money - how does the sender retrieve my public key and then hash it? As the pubKeyHash != my bitcoin address</p>

<p>I am probably forgetting something very obvious - but it has had my head bambuzzled this morning. </p>

CC BY-SA 3.0
2014-03-13T20:04:24.957Z
"pubKeyHash != my bitcoin address" You're wrong here. The address contains the public key hash, along with a version number and checksum.
Tim S.
<transactions><address><script><public-key>
How does ScriptPubKey know the public key of an Bitcoin address?
Paddy
# How does ScriptPubKey know the public key of an Bitcoin address?

(Asked by: username_0 on 2014-03-11)

I am currently having a blonde moment.

The ScriptPubKey provides a hashed version of the receivers public key.

> scriptPubKey OP\_DUP OP\_HASH160 OP\_EQUALVERIFY
> OP\_CHECKSIG

However, if I give someone my bitcoin address to send me money - how does the sender retrieve my public key and then hash it? As the pubKeyHash != my bitcoin address

I am probably forgetting something very obvious - but it has had my head bambuzzled this morning.

**Tags:** transactions, address, script, public-key

> **Comments:**
> **username_1**: "pubKeyHash != my bitcoin address" You're wrong here. The address contains the public key hash, along with a version number and checksum.  

---

## 2 answers

### Answer by username_2 on 2014-03-11. Score: 9

Addresses are really just shorthands for particular scripts. The standard address type (starting with a '1' on mainnet) does in fact correspond to the exact type of script you gave above.

If you base58 decode such an address, you end up with a byte string of the form 0x00 + [20-byte hash] + [4-byte checksum]. The corresponding script is OP\_DUP OP\_HASH160 [20-byte hash] OP\_EQUALVERIFY OP\_CHECKSIG.

So, in a way, your address *does* contain the public key's hash.

> **Comments:**
> **username_3**: I used this for a test http://lenschulwitz.com/base58 , in case it helps someone  

---

### Answer by username_4 on 2014-03-13. Score: -1

The sender does not need to know your public key, only the bitcoin address you provide which can be different each time. You use the public key later to redeem the funds and send to another address.

> **Comments:**
> **username_5**: the bitcoin address is the public key.  
> **username_4**: No, you are confusing the bitcoin address with the public key. You can create many diferrent bitcoin addresses using your public key and private key. You will need the public key to redeem the funds of the transaction.  

---

