<p>No. There are multiple kinds of addresses in common use:</p>
<p>A Pay to Public Key Hash (P2PKH) address, beginning with a <code>1...</code> uses a Hash160 (Sha256 followed by RipeMD160) of the public key. The public key is not revealed until this output is spent, as the spending transaction will include the public key in its scriptSig.</p>
<p>A Pay to Script Hash (P2SH) address, beginning with a <code>3...</code> uses the Hash160 of the <code>redeemScript</code>, which is not part of the scriptPubKey. The redeemScript is part of the scriptSig which spends the output.</p>
<p>The hashes of the above two are then encoded using Base58Check to generate the address.</p>
<p>There are also Pay to Witness Public Key Hash (P2WPKH) and Pay to Witness Script Hash (P2WSH) versions, which are for post-segwit transactions where the witness is a separate part of the spending transaction. These both begin with <code>bc1...</code>, with the difference between the two being the length of the hash. These are both encoded using the bech32 encoding to give the final address. The publicKey again, is part of the spending transaction, but is instead included in the extra witness field rather than the scriptSig.</p>
<p>There does exist a legacy P2PK (Pay to Public Key) output type, but this is seldom used. In this, the public key was included directly in the scriptPubKey.</p>
<p>In the others besides P2PK, the public key is not revealed until an output is spent. There is no way to know a public key from the hash alone, as the hash is a one-way function.</p>

CC BY-SA 4.0
2021-01-25T00:50:03.083Z
2021-01-25T00:50:03.083Z
Mark H
<blockquote>
<p>These public keys are easy enough for anyone to obtain from a Bitcoin address.</p>
</blockquote>
<p>Source: <a href="https://youtu.be/h7baD335hCw?t=598" rel="nofollow noreferrer">https://youtu.be/h7baD335hCw?t=598</a></p>
<p>... What? Aren't the receive addresses in fact the &quot;public keys&quot;?</p>

CC BY-SA 4.0
2021-01-25T00:41:00.623Z
Adress are the hash of public keys. Payment can be made to public keys too.
user2284570
<bitcoin-core><address><public-key>
Aren't the Bitcoin receive addresses the public keys?
Elijahh C.
# Aren't the Bitcoin receive addresses the public keys?

(Asked by: username_0 on 2021-01-25)

> These public keys are easy enough for anyone to obtain from a Bitcoin address.

Source: <https://youtu.be/h7baD335hCw?t=598>

... What? Aren't the receive addresses in fact the "public keys"?

**Tags:** bitcoin-core, address, public-key

> **Comments:**
> **username_1**: Adress are the hash of public keys. Payment can be made to public keys too.  

---

## 1 answers

### Answer by username_2 on 2021-01-25. Score: 6

No. There are multiple kinds of addresses in common use:

A Pay to Public Key Hash (P2PKH) address, beginning with a `1...` uses a Hash160 (Sha256 followed by RipeMD160) of the public key. The public key is not revealed until this output is spent, as the spending transaction will include the public key in its scriptSig.

A Pay to Script Hash (P2SH) address, beginning with a `3...` uses the Hash160 of the `redeemScript`, which is not part of the scriptPubKey. The redeemScript is part of the scriptSig which spends the output.

The hashes of the above two are then encoded using Base58Check to generate the address.

There are also Pay to Witness Public Key Hash (P2WPKH) and Pay to Witness Script Hash (P2WSH) versions, which are for post-segwit transactions where the witness is a separate part of the spending transaction. These both begin with `bc1...`, with the difference between the two being the length of the hash. These are both encoded using the bech32 encoding to give the final address. The publicKey again, is part of the spending transaction, but is instead included in the extra witness field rather than the scriptSig.

There does exist a legacy P2PK (Pay to Public Key) output type, but this is seldom used. In this, the public key was included directly in the scriptPubKey.

In the others besides P2PK, the public key is not revealed until an output is spent. There is no way to know a public key from the hash alone, as the hash is a one-way function.


---

