<h1>P2PKH: "Pay To Public Key Hash"</h1>

<p>This is how transactions are made. You are requiring the sender to supply a valid signature (from the private key) and public key. The transaction output script will use the signature and public key and through some cryptographic functions will check if it matches with the public key hash, if it does, then the funds will be spendable. This method conceals your public key in the form of a hash for extra security.
<hr></p>

<h1>P2PK: "Pay To Public Key"</h1>

<p>This is similar to P2PKH; the difference is that it does not conceal your public key. Anyone using this method to send funds over the P2P network is showing people their public key in the transaction details.
<hr></p>

<h1>P2SH: "Pay To Script Hash"</h1>

<p>The outputs of a transaction are just scripts that, if are executed with specific parameters, will result in a boolean of <code>true</code> or <code>false</code>. If a miner runs the output script with the supplied parameters and results in <code>true</code>, the money will be sent to your desired output. <code>P2SH</code> is used for multi-signature wallets making the output scripts logic that checks for multiple signatures before accepting the transaction. <code>P2SH</code> can also be used to allow anyone, or no one, to spend the funds. If the output script of a P2SH transaction is just <code>1</code> for true, then attempting to spend the output without supplying parameters will just result in <code>1</code> making the money spendable by anyone who tries. This also applies to scripts that return <code>0</code>, making the output spendable by no one.</p>

<p>This can also be used for puzzles like <a href="https://www.reddit.com/r/Bitcoin/comments/6f877c/more_free_bitcoin_a_p2sh_puzzle/" rel="noreferrer">this one</a>.
<hr></p>

<h1>P2WPKH: "Pay To Witness Public Key Hash"</h1>

<p>This was a feature of <code>segwit</code> which stands for Segregated Witness. Instead of using <code>scriptSig</code> parameters to check the transaction validity, there is a new part of the transaction called <code>witness</code> where the validity occurs.</p>

<hr>

<blockquote>
  <p>Also what is the difference between BTC held in P2SH and Unspent P2SH Output here?</p>
</blockquote>

<p>This means that out of all the <code>P2SH</code> transactions (transactions that can be spent by anyone with a set of parameters [scriptSig] that results in the execution of scriptPubkey with <code>true</code>), the ones with unspent outputs have not been redeemed. </p>

<p>I recommend <a href="https://www.youtube.com/watch?v=yU3Sr07Qnxg" rel="noreferrer">this video</a> by Andreas Antonopoulos on Bitcoin scripting.</p>

CC BY-SA 3.0
2017-12-11T01:10:11.967Z
"This method conceals your public key in the form of a hash for extra security." - just a clarification that it is not concealed after you spend with that address of course :)
meshcollider
CC BY-SA 3.0
2017-12-11T16:48:20.963Z
any idea what is P2WSH address? these new addresses were included in BIP 173 after segwit implementation
user380208
CC BY-SA 3.0
2017-12-12T00:47:13.430Z
@anacondabitch P2WSH is just like P2SH but the redeemScript is moved to the witness instead of scriptSig.
meshcollider
CC BY-SA 3.0
2017-12-12T04:16:08.577Z
P2SH: "Pay To Script Hash" is the Old Legacy Address
user380208
CC BY-SA 3.0
2017-12-12T05:19:54.730Z
QUESTION: Is there any website or script out there that can tell by typing a tx id what transaction type it is P2PK or P2PKH or P2SH or P2WPKH ????
user380208
CC BY-SA 4.0
2019-12-24T06:46:41.723Z
@user380208  www.blockchain.com    type into any address
gudako
CC BY-SA 4.0
2020-08-06T14:26:02.807Z
Not sure if a 5 years old kid can understand this, but great answer!
Cartucho
CC BY-SA 3.0
2017-12-11T00:38:03.963Z
2017-12-11T00:43:53.820Z
2017-12-11T00:43:53.820Z
Monstrum
<p>Explain like I'm 5 years old and my other half of the brain is surgically removed :) I don't want to put a lot of stress on my brain </p>

<p>Also what is the difference between BTC held in P2SH and Unspent P2SH Output here?</p>

<p><a href="https://p2sh.info/dashboard/db/home-dashboard?orgId=1" rel="noreferrer">https://p2sh.info/dashboard/db/home-dashboard?orgId=1</a></p>

<p2sh><output><p2pkh><p2wpkh><p2pk>
What is P2PK, P2PKH, P2SH, P2WPKH - ELI5
user380208
# What is P2PK, P2PKH, P2SH, P2WPKH - ELI5

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

Explain like I'm 5 years old and my other half of the brain is surgically removed :) I don't want to put a lot of stress on my brain

Also what is the difference between BTC held in P2SH and Unspent P2SH Output here?

<https://p2sh.info/dashboard/db/home-dashboard?orgId=1>

**Tags:** p2sh, output, p2pkh, p2wpkh, p2pk


---

## 1 answers

### Answer by username_1 on 2017-12-11. Score: 43

# P2PKH: "Pay To Public Key Hash"

This is how transactions are made. You are requiring the sender to supply a valid signature (from the private key) and public key. The transaction output script will use the signature and public key and through some cryptographic functions will check if it matches with the public key hash, if it does, then the funds will be spendable. This method conceals your public key in the form of a hash for extra security.

---

# P2PK: "Pay To Public Key"

This is similar to P2PKH; the difference is that it does not conceal your public key. Anyone using this method to send funds over the P2P network is showing people their public key in the transaction details.

---

# P2SH: "Pay To Script Hash"

The outputs of a transaction are just scripts that, if are executed with specific parameters, will result in a boolean of `true` or `false`. If a miner runs the output script with the supplied parameters and results in `true`, the money will be sent to your desired output. `P2SH` is used for multi-signature wallets making the output scripts logic that checks for multiple signatures before accepting the transaction. `P2SH` can also be used to allow anyone, or no one, to spend the funds. If the output script of a P2SH transaction is just `1` for true, then attempting to spend the output without supplying parameters will just result in `1` making the money spendable by anyone who tries. This also applies to scripts that return `0`, making the output spendable by no one.

This can also be used for puzzles like [this one](https://www.reddit.com/r/Bitcoin/comments/6f877c/more_free_bitcoin_a_p2sh_puzzle/).

---

# P2WPKH: "Pay To Witness Public Key Hash"

This was a feature of `segwit` which stands for Segregated Witness. Instead of using `scriptSig` parameters to check the transaction validity, there is a new part of the transaction called `witness` where the validity occurs.

---

> Also what is the difference between BTC held in P2SH and Unspent P2SH Output here?

This means that out of all the `P2SH` transactions (transactions that can be spent by anyone with a set of parameters [scriptSig] that results in the execution of scriptPubkey with `true`), the ones with unspent outputs have not been redeemed.

I recommend [this video](https://www.youtube.com/watch?v=yU3Sr07Qnxg) by Andreas Antonopoulos on Bitcoin scripting.

> **Comments:**
> **username_2**: "This method conceals your public key in the form of a hash for extra security." - just a clarification that it is not concealed after you spend with that address of course :)  
> **username_0**: any idea what is P2WSH address? these new addresses were included in BIP 173 after segwit implementation  
> **username_2**: @anacondabitch P2WSH is just like P2SH but the redeemScript is moved to the witness instead of scriptSig.  
> **username_0**: P2SH: "Pay To Script Hash" is the Old Legacy Address  
> **username_0**: QUESTION: Is there any website or script out there that can tell by typing a tx id what transaction type it is P2PK or P2PKH or P2SH or P2WPKH ????  
> **username_3**: @username_0  www.blockchain.com    type into any address  
> **username_4**: Not sure if a 5 years old kid can understand this, but great answer!  

---

