mirror of
https://github.com/seigler/dash-docs
synced 2025-07-28 02:06:13 +00:00
Use Terms "Pubkey Script" And "Signature Script"
This modifies commits provided by @petertodd to use the terms "pubkey script" and "signature script" instead of other terms. * Rename "scriptPubKey" and "output script" to "pubkey script" (suggested by @luke-jr). We leave a token "scriptPubKey" at the point where we define pubkey script so that searchers can find it. * Rename "scriptSig" to "signature script" (suggested by @luke-jr). We also leave a token "scriptSig" at this definition point. * Rename "redeemScript" to "redeem script" * Defined ECDSA on secp256k1 curve as the crypto used in the Transaction section and added references to secp256k1 private/public keys and signatures. * Removed "The Parts Of A Transaction" illustration by commenting it out in the HTML. Shoehorning the pubkey/signature script terms into this image was becoming difficult, and I'm not very fond of that illustration anyway. I'll see if I can think of a nicer replacement illustration for some point in the future. * Add a short paraphrased version @petertodd's description of scripts as generalized crypto. * Updated all the illustrations which referred to either pubkey scripts or signature scripts to use these terms.
This commit is contained in:
parent
89cb2fff08
commit
6afc6835bf
29 changed files with 408 additions and 407 deletions
|
@ -250,13 +250,13 @@ amount = 10000000 ## In satoshis
|
|||
|
||||
## P2PKH pubkey hash
|
||||
pubkey_hash = "2b14950b8d31620c6cc923c5408a701b1ec0a020"
|
||||
## P2PKH output script entered as hex and converted to binary
|
||||
## P2PKH pubkey script entered as hex and converted to binary
|
||||
# OP_DUP OP_HASH160 <push 20 bytes> <pubKey hash> OP_EQUALVERIFY OP_CHECKSIG
|
||||
# 76 a9 14 <pubKey hash> 88 ac
|
||||
hex_script = "76" + "a9" + "14" + pubkey_hash + "88" + "ac"
|
||||
serialized_script = hex_script.decode("hex")
|
||||
|
||||
## Load amount and script into PaymentDetails
|
||||
## Load amount and pubkey script into PaymentDetails
|
||||
details.outputs.add(amount = amount, script = serialized_script)
|
||||
|
||||
## Memo to display to the spender
|
||||
|
@ -286,24 +286,24 @@ hex_script = "76" + "a9" + "14" + pubkey_hash + "88" + "ac"
|
|||
serialized_script = hex_script.decode("hex")
|
||||
{% endhighlight %}
|
||||
|
||||
`script`: (required) You must specify the output script you want the spender to
|
||||
pay---any valid script is acceptable. In this example, we'll request
|
||||
payment to a P2PKH output script.
|
||||
`script`: (required) You must specify the pubkey script you want the spender to
|
||||
pay---any valid pubkey script is acceptable. In this example, we'll request
|
||||
payment to a P2PKH pubkey script.
|
||||
|
||||
First we get a pubkey hash. The hash above is the hash form of the
|
||||
address used in the URI examples throughout this section,
|
||||
mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN.
|
||||
|
||||
Next, we plug that hash into the standard P2PKH output script using hex,
|
||||
Next, we plug that hash into the standard P2PKH pubkey script using hex,
|
||||
as illustrated by the code comments.
|
||||
|
||||
Finally, we convert the output script from hex into its serialized form.
|
||||
Finally, we convert the pubkey script from hex into its serialized form.
|
||||
|
||||
{% highlight python %}
|
||||
details.outputs.add(amount = amount, script = serialized_script)
|
||||
{% endhighlight %}
|
||||
|
||||
`outputs`:<!--noref--> (required) add the output script and (optional) amount to the
|
||||
`outputs`:<!--noref--> (required) add the pubkey script and (optional) amount to the
|
||||
PaymentDetails outputs<!--noref--> array.
|
||||
|
||||
It's possible to specify multiple [`scripts`][pp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue