<p>A Bitcoin address starting with 3 is always P2SH (pay to script hash).</p>
<p>It's not P2PK (in that case you would see a public key instead of an address) nor P2PKH (you would see an address starting with 1).  It could be P2WPKH or P2WSH since these are simply implemented as special types of scripts via P2SH.  The address is only the hash of the script, not the script itself, and hash functions are one-way.  So we won't know what the script actually is, nor whether it happens to be a WPKH or WSH script, until after that transaction output is spent.</p>
<p>See <a href="https://bitcoincore.org/en/segwit_wallet_dev/" rel="nofollow noreferrer">https://bitcoincore.org/en/segwit_wallet_dev/</a> for more info about segwit.  In particular note the following:</p>
<blockquote>
<p>Until a P2SH-P2WPKH UTXO is spent and the redeemScript is exposed, a P2SH-P2WPKH address is indistinguishable from a non-segwit P2SH address (such as a non-segwit multi-signature address)</p>
<p>Like any other P2SH and P2SH-P2WPKH address, P2SH-P2WSH address has prefix 3. They are indistinguishable until the UTXO is spent</p>
</blockquote>

CC BY-SA 3.0
2017-12-15T07:21:34.013Z
@Nate Eldredge There is an output assigned to this transaction.. so there must be public keys and witness data since this is a segwit transaction or P2SH P2WPKH script ... i see some random string .. how to construct this back to scriptsig????? any ideas
user380208
CC BY-SA 3.0
2017-12-12T18:15:10.083Z
Nit: P2WPKH and P2WSH can also be used natively, without P2SH.
Pieter Wuille
CC BY-SA 3.0
2017-12-12T19:03:22.657Z
@PieterWuille, in that case, it shall not be the segwit address (starting with 1) anymore
user380208
CC BY-SA 3.0
2017-12-12T19:09:09.193Z
@PieterWuille I think this block explorer is useful.. it returns a P2SH P2WPKH script ..however, suppose i'm a 3rd party and i want to verify that public key belongs to that (3P9...) address  .... how to do that?VISIT-
 https://btc.com/9d710be07bed7699055ed4c27868ee50fcb91f8d738bebfdbf4145cdbaeb15a2
user380208
CC BY-SA 3.0
2017-12-12T19:12:05.167Z
https://bitcoinvalued.com/tools.php ..... my hash160 generator returns an invalid address from public key's 03144cf9e97d15e70820556aeb4d0f99ca8b9a5876e0fe26a67c0272c21a53009d - and - 03144cf9e97d15e70820556aeb4d0f99ca8b9a5876e0fe26a67c0272c21a53009d
user380208
CC BY-SA 3.0
2017-12-12T17:27:02.970Z
2017-12-12T17:27:02.970Z
2020-06-16T11:10:03.350Z
Nate Eldredge
<p>1.What is the public key of address 3P9dyU9ga3aJorHAUqKBFCX2NdyuHEVgx1 
(usually placed under input.. not in this case)</p>

<p>2.What type of Script (P2PK, P2PKH, P2SH, P2WPKH, P2WSH) is used to make this Tx, also how you discovered?</p>

<p><a href="https://blockchain.info/tx/9d710be07bed7699055ed4c27868ee50fcb91f8d738bebfdbf4145cdbaeb15a2" rel="nofollow noreferrer">https://blockchain.info/tx/9d710be07bed7699055ed4c27868ee50fcb91f8d738bebfdbf4145cdbaeb15a2</a></p>

<bitcoin-core><client>
Can someone explain how to read blockchain.info?
user380208
# Can someone explain how to read blockchain.info?

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

1.What is the public key of address 3P9dyU9ga3aJorHAUqKBFCX2NdyuHEVgx1
(usually placed under input.. not in this case)

2.What type of Script (P2PK, P2PKH, P2SH, P2WPKH, P2WSH) is used to make this Tx, also how you discovered?

<https://blockchain.info/tx/9d710be07bed7699055ed4c27868ee50fcb91f8d738bebfdbf4145cdbaeb15a2>

**Tags:** bitcoin-core, client


---

## 1 answers

### Answer by username_1 on 2017-12-12. Score: 1

A Bitcoin address starting with 3 is always P2SH (pay to script hash).

It's not P2PK (in that case you would see a public key instead of an address) nor P2PKH (you would see an address starting with 1). It could be P2WPKH or P2WSH since these are simply implemented as special types of scripts via P2SH. The address is only the hash of the script, not the script itself, and hash functions are one-way. So we won't know what the script actually is, nor whether it happens to be a WPKH or WSH script, until after that transaction output is spent.

See <https://bitcoincore.org/en/segwit_wallet_dev/> for more info about segwit. In particular note the following:

> Until a P2SH-P2WPKH UTXO is spent and the redeemScript is exposed, a P2SH-P2WPKH address is indistinguishable from a non-segwit P2SH address (such as a non-segwit multi-signature address)
>
> Like any other P2SH and P2SH-P2WPKH address, P2SH-P2WSH address has prefix 3. They are indistinguishable until the UTXO is spent

> **Comments:**
> **username_2**: Nit: P2WPKH and P2WSH can also be used natively, without P2SH.  
> **username_0**: @username_2, in that case, it shall not be the segwit address (starting with 1) anymore  
> **username_0**: @username_2 I think this block explorer is useful.. it returns a P2SH P2WPKH script ..however, suppose i'm a 3rd party and i want to verify that public key belongs to that (3P9...) address  .... how to do that?VISIT-  https://btc.com/9d710be07bed7699055ed4c27868ee50fcb91f8d738bebfdbf4145cdbaeb15a2  
> **username_0**: https://bitcoinvalued.com/tools.php ..... my hash160 generator returns an invalid address from public key's 03144cf9e97d15e70820556aeb4d0f99ca8b9a5876e0fe26a67c0272c21a53009d - and - 03144cf9e97d15e70820556aeb4d0f99ca8b9a5876e0fe26a67c0272c21a53009d  
> **username_0**: @username_1 There is an output assigned to this transaction.. so there must be public keys and witness data since this is a segwit transaction or P2SH P2WPKH script ... i see some random string .. how to construct this back to scriptsig????? any ideas  

---

