diff --git a/appdx-bitcore.asciidoc b/appdx-bitcore.asciidoc index b187c388..43848303 100644 --- a/appdx-bitcore.asciidoc +++ b/appdx-bitcore.asciidoc @@ -58,7 +58,7 @@ Creating and signing a transaction from an UTXO: ---- > utxo = { txId: transaction id containing an unspent output, - outputIndex: output indexi e.g. 0, + outputIndex: output index e.g. 0, address: addressOfUtxo, script: bitcore.Script.buildPublicKeyHashOut(addressOfUtxo).toString(), satoshis: amount sent to the address diff --git a/appdx-scriptops.asciidoc b/appdx-scriptops.asciidoc index b39e8e45..915d8c29 100644 --- a/appdx-scriptops.asciidoc +++ b/appdx-scriptops.asciidoc @@ -15,12 +15,12 @@ Tables and descriptions sourced from https://en.bitcoin.it/wiki/Script[]. |======= | Symbol | Value (hex) | Description | OP_0 or OP_FALSE | 0x00 | An empty array is pushed onto the stack -| 1-75 | 0x01-0x4b | Push the next N bytes onto the stack, where N is 1 to 75 bytes +| 1 to 75 | 0x01 to 0x4b | Push the next N bytes onto the stack, where N is 1 to 75 bytes | OP_PUSHDATA1 | 0x4c | The next script byte contains N, push the following N bytes onto the stack | OP_PUSHDATA2 | 0x4d | The next two script bytes contain N, push the following N bytes onto the stack | OP_PUSHDATA4 | 0x4e | The next four script bytes contain N, push the following N bytes onto the stack | OP_1NEGATE | 0x4f | Push the value "–1" onto the stack -| OP_RESERVED | 0x50 | Halt - Invalid transaction unless found in an unexecuted OP_IF clause +| OP_RESERVED | 0x50 | Halt—Invalid transaction unless found in an unexecuted OP_IF clause | OP_1 or OP_TRUE| 0x51 | Push the value "1" onto the stack | OP_2 to OP_16 | 0x52 to 0x60 | For OP_N, push the value "N" onto the stack, e.g., OP_2 pushes "2" |======= @@ -81,7 +81,7 @@ Tables and descriptions sourced from https://en.bitcoin.it/wiki/Script[]. | OP_ROLL | 0x7a | Pop value N from top, then move the Nth item to the top of the stack | OP_ROT | 0x7b | Rotate the top three items in the stack | OP_SWAP | 0x7c | Swap the top two items on the stack -| OP_TUCK | 0x7d | Copy the top item and insert it between the top and second item. +| OP_TUCK | 0x7d | Copy the top item and insert it between the top and second item |======= <> shows string operators. @@ -111,8 +111,8 @@ Tables and descriptions sourced from https://en.bitcoin.it/wiki/Script[]. | _OP_XOR_ | 0x86 | Disabled (Boolean XOR of two top items) | OP_EQUAL | 0x87 | Push TRUE (1) if top two items are exactly equal, push FALSE (0) otherwise | OP_EQUALVERIFY | 0x88 | Same as OP_EQUAL, but run OP_VERIFY after to halt if not TRUE -| OP_RESERVED1 | 0x89 | Halt - Invalid transaction unless found in an unexecuted OP_IF clause -| OP_RESERVED2 | 0x8a | Halt - Invalid transaction unless found in an unexecuted OP_IF clause +| OP_RESERVED1 | 0x89 | Halt—Invalid transaction unless found in an unexecuted OP_IF clause +| OP_RESERVED2 | 0x8a | Halt—Invalid transaction unless found in an unexecuted OP_IF clause |======= [role="pagebreak-before"] @@ -133,11 +133,11 @@ Tables and descriptions sourced from https://en.bitcoin.it/wiki/Script[]. | OP_0NOTEQUAL | 0x92 | If top item is 0 return 0, otherwise return 1 | OP_ADD | 0x93 | Pop top two items, add them and push result | OP_SUB | 0x94 | Pop top two items, subtract first from second, push result -| OP_MUL | 0x95 | Disabled (multiply top two items) -| OP_DIV | 0x96 | Disabled (divide second item by first item) -| OP_MOD | 0x97 | Disabled (remainder divide second item by first item) -| OP_LSHIFT | 0x98 | Disabled (shift second item left by first item number of bits) -| OP_RSHIFT | 0x99 | Disabled (shift second item right by first item number of bits) +| _OP_MUL_ | 0x95 | Disabled (multiply top two items) +| _OP_DIV_ | 0x96 | Disabled (divide second item by first item) +| _OP_MOD_ | 0x97 | Disabled (remainder divide second item by first item) +| _OP_LSHIFT_ | 0x98 | Disabled (shift second item left by first item number of bits) +| _OP_RSHIFT_ | 0x99 | Disabled (shift second item right by first item number of bits) | OP_BOOLAND | 0x9a | Boolean AND of top two items | OP_BOOLOR | 0x9b | Boolean OR of top two items | OP_NUMEQUAL | 0x9c | Return TRUE if top two items are equal numbers @@ -179,7 +179,7 @@ Tables and descriptions sourced from https://en.bitcoin.it/wiki/Script[]. [options="header"] |======= | Symbol | Value (hex) | Description -| OP_NOP1-OP_NOP10 | 0xb0-0xb9 | Does nothing, ignored +| OP_NOP1 to OP_NOP10 | 0xb0 to 0xb9 | Does nothing, ignored |======= diff --git a/ch07.asciidoc b/ch07.asciidoc index f207b749..4989c9b5 100644 --- a/ch07.asciidoc +++ b/ch07.asciidoc @@ -710,7 +710,7 @@ With Segregated Witness, Alice would create a Pay-to-Witness-Public-Key-Hash (P2 0 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 ---- -As you can see, a Segregated Witness output’s locking script is much simpler than a traditional output. It consists of two values that are pushed on to the script evaluation stack. To an old (nonsegwit-aware) bitcoin client, the two pushes would look like an output that anyone can spend and does not require a signature (or rather, can be spent with an empty signature). To a newer, segwit-aware client, the first number (0) is interpreted as a version number (the _witness version_) and the second part (20 bytes) is the equivalent of a locking script known as a _witness program_. The 20-byte witness program is simply the hash of the public key, as in a P2PKH script +As you can see, a Segregated Witness output’s locking script is much simpler than a traditional output. It consists of two values that are pushed on to the script evaluation stack. To an old (nonsegwit-aware) bitcoin client, the two pushes would look like an output that anyone can spend and does not require a signature (or rather, can be spent with an empty signature). To a newer, segwit-aware client, the first number (0) is interpreted as a version number (the _witness version_) and the second part (20 bytes) is the equivalent of a locking script known as a _witness program_. The 20-byte witness program is simply the hash of the public key, as in a P2PKH script. Now, let’s look at the corresponding transaction that Bob uses to spend this output. For the original script (nonsegwit), Bob’s transaction would have to include a signature within the transaction input: