Can someone explain how to read blockchain.info?

2

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

user380208

Posted 2017-12-12T10:10:14.180

Reputation: 423

Answers

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

Nate Eldredge

Posted 2017-12-12T10:10:14.180

Reputation: 21 420

Nit: P2WPKH and P2WSH can also be used natively, without P2SH.Pieter Wuille 2017-12-12T18:15:10.083

@PieterWuille, in that case, it shall not be the segwit address (starting with 1) anymoreuser380208 2017-12-12T19:03:22.657

@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 2017-12-12T19:09:09.193

https://bitcoinvalued.com/tools.php ..... my hash160 generator returns an invalid address from public key's 03144cf9e97d15e70820556aeb4d0f99ca8b9a5876e0fe26a67c0272c21a53009d - and - 03144cf9e97d15e70820556aeb4d0f99ca8b9a5876e0fe26a67c0272c21a53009duser380208 2017-12-12T19:12:05.167

@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 ideasuser380208 2017-12-15T07:21:34.013