• Hash256
  • Hash160
  • Reverse Bytes
  • Hexadecimal
  • Satoshis

P2PK

Pay To Pubkey

P2PK (Pay To Pubkey) is a script pattern that locks an output to a public key.

It is a simpler version of the more-commonly used P2PKH locking script.

How does P2PK work?

A P2PK lock just contains a public key and a CHECKSIG opcode:

scriptPubKey 4104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac
04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_CHECKSIG
P2PK
hex | opcodes inline | stack

To unlock it you just need to provide a valid signature:

scriptSig 4730440220576497b7e6f9b553c0aba0d8929432550e092db9c130aae37b84b545e7f4a36c022066cb982ed80608372c139d7bb9af335423d5280350fe3e06bd510e695480914f01
30440220576497b7e6f9b553c0aba0d8929432550e092db9c130aae37b84b545e7f4a36c022066cb982ed80608372c139d7bb9af335423d5280350fe3e06bd510e695480914f01
hex | opcodes inline | stack

When the script runs, the CHECKSIG opcode compares the signature against the public key, and pushes a 1 on to the stack if it is valid.

Where can you find P2PK scripts?

Despite being the simplest script for locking bitcoins to someone’s public key, P2PK is not used as much as the similar (yet more complex) P2PKH script.

You’ll most commonly find P2PK in coinbase transactions in the earlier blocks in the blockchain. This is because the original Bitcoin Core miner would use P2PK for the block reward when constructing a candidate block:1

Newer mining software tends to use P2PKH, so you don’t see P2PK scripts in coinbase transactions as much these days.

Here are some examples of transactions using P2PK:

Why did Satoshi use P2PK in the Bitcoin Core miner?

Not sure. You’ll have to ask her/him.

I think P2PKH was used as a convenient way for people to make transactions, as it allowed you to use addresses instead of passing around your public key (which is longer). However, the miner does not need the convenience of addresses, so P2PK made for a simpler choice.

Why don’t we use P2PK more often?

Because Satoshi designed P2PKH so that we can send each other shorter addresses instead of full public keys.

See: Why do we have P2PKH as well as P2PK?


  1. https://bitcoin.stackexchange.com/questions/73563/how-did-pay-to-pubkey-hash-come-about-what-is-its-history↩︎

By Greg Walker,

Last Updated: 21 Jul 2020
  • 21 Jul 2020: renamed /guide/ to /technical/
Back to Top

Hey there, it's Greg.

I'll let you know about cool website updates, or if something seriously interesting happens in bitcoin.


Don't worry, it doesn't happen very often.