mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2025-02-22 04:22:15 +00:00
Made changes to ch05.asciidoc
This commit is contained in:
parent
a399132212
commit
7d848eda12
@ -346,12 +346,12 @@ In the first few years of bitcoin's development, the developers introduced some
|
||||
|
||||
Check the source code of the Bitcoin Core client (the reference implementation) to see what is currently allowed as a valid transaction script.
|
||||
|
||||
The five standard types of transaction scripts are pay-to-public-key hash (P2PKH), public-key, multi-signature (limited to 15 keys), pay-to-script hash (P2SH), and data output (OP_RETURN), which are described in more detail in the following sections.
|
||||
The five standard types of transaction scripts are pay-to-public-key-hash (P2PKH), public-key, multi-signature (limited to 15 keys), pay-to-script-hash (P2SH), and data output (OP_RETURN), which are described in more detail in the following sections.
|
||||
|
||||
[[p2pkh]]
|
||||
==== Pay-to-Public-Key Hash (P2PKH)
|
||||
==== Pay-to-Public-Key-Hash (P2PKH)
|
||||
|
||||
((("pay-to-public-key hash (P2PKH)", id="ix_ch05-asciidoc15", range="startofrange")))((("transactions","pay-to-public-key hash", id="ix_ch05-asciidoc16", range="startofrange")))The vast majority of transactions processed on the bitcoin network are P2PKH transactions. These contain a locking script that encumbers the output with a public key hash, more commonly known as a bitcoin address. Transactions that pay a bitcoin address contain P2PKH scripts. An output locked by a P2PKH script can be unlocked (spent) by presenting a public key and a digital signature created by the corresponding private key.
|
||||
((("pay-to-public-key-hash (P2PKH)", id="ix_ch05-asciidoc15", range="startofrange")))((("transactions","pay-to-public-key-hash", id="ix_ch05-asciidoc16", range="startofrange")))The vast majority of transactions processed on the bitcoin network are P2PKH transactions. These contain a locking script that encumbers the output with a public key hash, more commonly known as a bitcoin address. Transactions that pay a bitcoin address contain P2PKH scripts. An output locked by a P2PKH script can be unlocked (spent) by presenting a public key and a digital signature created by the corresponding private key.
|
||||
|
||||
For example, let's look at Alice's payment to Bob's Cafe again. Alice made a payment of 0.015 bitcoin to the cafe's bitcoin address. That transaction output would have a locking script of the form:
|
||||
|
||||
@ -389,7 +389,7 @@ image::images/msbt_0504.png["Tx_Script_P2PubKeyHash_2"]
|
||||
[[p2pk]]
|
||||
==== Pay-to-Public-Key
|
||||
|
||||
((("Pay-to-Public-Key")))Pay-to-Public-Key is a simpler form of a bitcoin payment than Pay-to-Public-Key-Hash. With this script form, the public key itself is stored in the locking script, rather than a public-key-hash as with P2PKH earlier, which is much shorter. Pay-to-Public-Key-Hash was invented by Satoshi to make bitcoin addresses shorter, for ease of use. Pay-to-Public-Key is now most often seen in coinbase transactions, generated by older mining software that has not been updated to use P2PKH.
|
||||
((("pay-to-public-key")))Pay-to-public-key is a simpler form of a bitcoin payment than pay-to-public-key-hash. With this script form, the public key itself is stored in the locking script, rather than a public-key-hash as with P2PKH earlier, which is much shorter. Pay-to-Public-Key-Hash was invented by Satoshi to make bitcoin addresses shorter, for ease of use. Pay-to-Public-Key is now most often seen in coinbase transactions, generated by older mining software that has not been updated to use P2PKH.
|
||||
|
||||
A Pay-to-Public-Key locking script looks like this:
|
||||
----
|
||||
|
Loading…
Reference in New Issue
Block a user