4

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?

  • This post provides a partial answer / timeline for your Q: bitcoin.stackexchange.com/questions/63699/…. 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 Apr 6 '18 at 20:43
  • This question is relevant as well: bitcoin.stackexchange.com/questions/32639/… – chytrik Apr 6 '18 at 20:56
8

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 (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.

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.