<p>The earliest client by satoshi had both.</p>

<p>P2PK was default for mining and payments received using the interactive IP-to-IP payment protocol; P2PKH was intended for use in non-interactive payments.</p>

<p>Compressed keys were discovered later and no change in software was required to support them.</p>

CC BY-SA 3.0
2018-04-06T21:48:55.803Z
2018-04-06T21:48:55.803Z
skang404
<p>Pay to Public Key Hash has existed for the entirety of Bitcoin's life. P2PKH addresses have existed since the earliest release of Bitcoin. Creating P2PKH addresses and sending to P2PKH addresses was possible to do with Bitcoin 0.1.0. </p>

<p>However these early versions of Bitcoin also supported a Pay to IP address feature where your wallet would contact the wallet at a given IP address and request a scriptPubKey to send to. The response would be a P2PK scriptPubKey and thus you would create P2PK outputs.</p>

<p>Blocks too were mined to P2PK outputs, and in fact, Bitcoin Core still does this. Bitcoin Core's internal miner (which is only used for regtest and testnet now), still creates P2PK outputs instead of P2PKH outputs.</p>

<p>Pay to IP eventually began being phased out in Bitcoin 0.3.13 when its usage was hidden behind a command line switch <code>-allowreceivebyip</code> in commit <a href="https://github.com/bitcoin/bitcoin/commit/172f006020965ae8763a0610845c051ed1e3b522" rel="noreferrer"><code>172f0060</code></a> (note the author is Satoshi, however he appears to have also incorporated code from someone else). The ability to send to IP was removed in Bitcoin 0.5.0 with the last remnants of the networking code related to Pay to IP removed in Bitcoin 0.8.0.</p>

<p>It was known before Pay to IP's removal that it was insecure. Since the only other way to transact was via addresses, P2PKH was already widely in use with P2PK never seeming to get much use as it was only use for Pay to IP and for blocks created by the Bitcoin client.</p>

<p>Once external mining software came about, blocks began using P2PKH instead of P2PK because it was easier to enter an address from your wallet into an external miner than it was to get a pubkey and enter it. People were also accustomed to using addresses at that point, and addresses only work for P2PKH outputs.</p>

CC BY-SA 3.0
2018-04-06T22:21:14.960Z
2018-04-06T22:21:14.960Z
Ava Chow
<p>We know that early blocks all used pay-to-pubkey (p2pk) and at some point, we mostly switched to pay-to-pubkey-hash (p2pkh). What is the history behind this? Who made the changes and when did p2pkh become standard?</p>

<p>Also, does this have anything to do with the move toward compressed keys?</p>

CC BY-SA 3.0
2018-04-06T20:43:35.463Z
This post provides a partial answer / timeline for your Q: https://bitcoin.stackexchange.com/questions/63699/does-p2pkh-substitute-p2pk-in-any-circumstances-why?rq=1. Compressed pubkeys help reduce the size of the blockchain, afaik the deprecation of p2pk does not relate directly to this (afaik a p2pk tx created using a compressed key is actually smaller than a p2pkh tx created using the same key). Someone with a better grasp of the development history could probably provide a better answer than I can though.
chytrik
CC BY-SA 3.0
2018-04-06T20:56:30.283Z
This question is relevant as well: https://bitcoin.stackexchange.com/questions/32639/why-does-the-default-miner-implementation-use-pay-to-pubkey/32642#32642
chytrik
<history><p2pkh><p2pk>
How did pay-to-pubkey hash come about? What is its history?
Jimmy Song
# How did pay-to-pubkey hash come about? What is its history?

(Asked by: username_0 on 2018-04-06)

We know that early blocks all used pay-to-pubkey (p2pk) and at some point, we mostly switched to pay-to-pubkey-hash (p2pkh). What is the history behind this? Who made the changes and when did p2pkh become standard?

Also, does this have anything to do with the move toward compressed keys?

**Tags:** history, p2pkh, p2pk

> **Comments:**
> **username_1**: This post provides a partial answer / timeline for your Q: https://bitcoin.stackexchange.com/questions/63699/does-p2pkh-substitute-p2pk-in-any-circumstances-why?rq=1. Compressed pubkeys help reduce the size of the blockchain, afaik the deprecation of p2pk does not relate directly to this (afaik a p2pk tx created using a compressed key is actually smaller than a p2pkh tx created using the same key). Someone with a better grasp of the development history could probably provide a better answer than I can though.  
> **username_1**: This question is relevant as well: https://bitcoin.stackexchange.com/questions/32639/why-does-the-default-miner-implementation-use-pay-to-pubkey/32642#32642  

---

## 2 answers

### Answer by username_3 on 2018-04-06. Score: 11 | Accepted answer

Pay to Public Key Hash has existed for the entirety of Bitcoin's life. P2PKH addresses have existed since the earliest release of Bitcoin. Creating P2PKH addresses and sending to P2PKH addresses was possible to do with Bitcoin 0.1.0.

However these early versions of Bitcoin also supported a Pay to IP address feature where your wallet would contact the wallet at a given IP address and request a scriptPubKey to send to. The response would be a P2PK scriptPubKey and thus you would create P2PK outputs.

Blocks too were mined to P2PK outputs, and in fact, Bitcoin Core still does this. Bitcoin Core's internal miner (which is only used for regtest and testnet now), still creates P2PK outputs instead of P2PKH outputs.

Pay to IP eventually began being phased out in Bitcoin 0.3.13 when its usage was hidden behind a command line switch `-allowreceivebyip` in commit [`172f0060`](https://github.com/bitcoin/bitcoin/commit/172f006020965ae8763a0610845c051ed1e3b522) (note the author is Satoshi, however he appears to have also incorporated code from someone else). The ability to send to IP was removed in Bitcoin 0.5.0 with the last remnants of the networking code related to Pay to IP removed in Bitcoin 0.8.0.

It was known before Pay to IP's removal that it was insecure. Since the only other way to transact was via addresses, P2PKH was already widely in use with P2PK never seeming to get much use as it was only use for Pay to IP and for blocks created by the Bitcoin client.

Once external mining software came about, blocks began using P2PKH instead of P2PK because it was easier to enter an address from your wallet into an external miner than it was to get a pubkey and enter it. People were also accustomed to using addresses at that point, and addresses only work for P2PKH outputs.


---

### Answer by username_2 on 2018-04-06. Score: 4

The earliest client by satoshi had both.

P2PK was default for mining and payments received using the interactive IP-to-IP payment protocol; P2PKH was intended for use in non-interactive payments.

Compressed keys were discovered later and no change in software was required to support them.


---

