mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2025-01-22 21:51:10 +00:00
Made changes to ch05.asciidoc
This commit is contained in:
parent
7d848eda12
commit
f0654d7b6e
@ -389,19 +389,22 @@ 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:
|
||||
|
||||
A Pay-to-Public-Key locking script looks like this:
|
||||
----
|
||||
<Public Key A> OP_CHECKSIG
|
||||
----
|
||||
|
||||
The corresponding unlocking script that must be presented to unlock this type of output is a simple signature, like this:
|
||||
|
||||
----
|
||||
<Signature from Private Key A>
|
||||
----
|
||||
|
||||
The combined script, which is validated by the transaction validation software, is:
|
||||
|
||||
----
|
||||
<Signature from Private Key A> <Public Key A> OP_CHECKSIG
|
||||
----
|
||||
@ -411,7 +414,7 @@ This script is a simple invocation of the +CHECKSIG+ operator, which validates t
|
||||
[[multisig]]
|
||||
==== Multi-Signature
|
||||
|
||||
((("multi-signature scripts")))((("transactions","multi-signature scripts")))Multi-signature scripts set a condition where N public keys are recorded in the script and at least M of those must provide signatures to release the encumbrance. This is also known as an M-of-N scheme, where N is the total number of keys and M is the threshold of signatures required for validation. For example, a 2-of-3 multi-signature is one where three public keys are listed as potential signers and at least two of those must be used to create signatures for a valid transaction to spend the funds. ((("multi-signature scripts","limits on")))At this time, standard multi-signature scripts are limited to at most 15 listed public keys, meaning you can do anything from a 1-of-1 to a 15-of-15 multi-signature or any combination within that range. The limitation to 15 listed keys may be lifted by the time of publication of this book, so check the((("isStandard() function"))) +isStandard()+ function to see what is currently accepted by the network.
|
||||
((("multi-signature scripts")))((("transactions","multi-signature scripts")))Multi-signature scripts set a condition where N public keys are recorded in the script and at least M of those must provide signatures to release the encumbrance. This is also known as an M-of-N scheme, where N is the total number of keys and M is the threshold of signatures required for validation. For example, a 2-of-3 multi-signature is one where three public keys are listed as potential signers and at least two of those must be used to create signatures for a valid transaction to spend the funds. ((("multi-signature scripts","limits on")))At this time, standard multi-signature scripts are limited to at most 15 listed public keys, meaning you can do anything from a 1-of-1 to a 15-of-15 multi-signature or any combination within that range. The limitation to 15 listed keys might be lifted by the time this book is published, so check the((("isStandard() function"))) +isStandard()+ function to see what is currently accepted by the network.
|
||||
|
||||
The general form of a locking script setting an M-of-N multi-signature condition is:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user