diff --git a/protocol/blockchain/script.md b/protocol/blockchain/script.md index 4a7d74d..6791c97 100644 --- a/protocol/blockchain/script.md +++ b/protocol/blockchain/script.md @@ -36,29 +36,14 @@ The table below lists the currently allocated op codes. Op codes marked with ** | Op Code Range | Name | |--|--| -| 0x00 | OP_0 / OP_FALSE | -| 0x01 - 0x4B | [push data](/protocol/blockchain/script/op-codes/push-data) | +| 0x00 | [OP_0](/protocol/blockchain/script/op-codes/op-x), OP_FALSE | +| 0x01 - 0x4B | [OP_DATA_X](/protocol/blockchain/script/op-codes/op-data-x) | | 0x4C | OP_PUSHDATA1 | | 0x4D | OP_PUSHDATA2 | | 0x4E | OP_PUSHDATA4 | | 0x4F | OP_1NEGATE | | 0x50 | OP_RESERVED **(disabled)** | -| 0x51 | OP_1 / OP_TRUE | -| 0x52 | OP_2 | -| 0x53 | OP_3 | -| 0x54 | OP_4 | -| 0x55 | OP_5 | -| 0x56 | OP_6 | -| 0x57 | OP_7 | -| 0x58 | OP_8 | -| 0x59 | OP_9 | -| 0x5A | OP_10 | -| 0x5B | OP_11 | -| 0x5C | OP_12 | -| 0x5D | OP_13 | -| 0x5E | OP_14 | -| 0x5F | OP_15 | -| 0x60 | OP_16 | +| 0x51 - 0x60 | [OP_1](/protocol/blockchain/script/op-codes/op-x) - OP_16, OP_TRUE | | 0x61 | OP_NOP | | 0x62 | OP_VER **(disabled)** | | 0x63 | OP_IF | @@ -160,38 +145,38 @@ Some node implementations define custom op codes. | Op Code Range | Name | |--|--| -| 0xFA | OP_SMALLINTEGER | -| 0xFB | OP_PUBKEYS | -| 0xFD | OP_PUBKEYHASH | -| 0xFE | OP_PUBKEY | -| 0xFF | OP_INVALIDOPCODE | +| 0xFA | OP_SMALLINTEGER | +| 0xFB | OP_PUBKEYS | +| 0xFD | OP_PUBKEYHASH | +| 0xFE | OP_PUBKEY | +| 0xFF | OP_INVALIDOPCODE | #### Bitcoin ABC | Op Code Range | Name | |--|--| -| 0xF0 | OP_PREFIX_BEGIN | -| 0xF7 | OP_PREFIX_END | -| 0xFF | OP_INVALIDOPCODE | +| 0xF0 | OP_PREFIX_BEGIN | +| 0xF7 | OP_PREFIX_END | +| 0xFF | OP_INVALIDOPCODE | #### Bitcoin Unlimited | Op Code Range | Name | |--|--| -| 0xF0 | OP_BIGINTEGER | -| 0xF1 | OP_DATA | -| 0xFA | OP_SMALLINTEGER | -| 0xFB | OP_PUBKEYS | -| 0xFD | OP_PUBKEYHASH | -| 0xFE | OP_PUBKEY | -| 0xFF | OP_INVALIDOPCODE | +| 0xF0 | OP_BIGINTEGER | +| 0xF1 | OP_DATA | +| 0xFA | OP_SMALLINTEGER | +| 0xFB | OP_PUBKEYS | +| 0xFD | OP_PUBKEYHASH | +| 0xFE | OP_PUBKEY | +| 0xFF | OP_INVALIDOPCODE | #### Flowee the Hub | Op Code Range | Name | |--|--| -| 0xFA | OP_SMALLINTEGER | -| 0xFB | OP_PUBKEYS | -| 0xFD | OP_PUBKEYHASH | -| 0xFE | OP_PUBKEY | -| 0xFF | OP_INVALIDOPCODE | \ No newline at end of file +| 0xFA | OP_SMALLINTEGER | +| 0xFB | OP_PUBKEYS | +| 0xFD | OP_PUBKEYHASH | +| 0xFE | OP_PUBKEY | +| 0xFF | OP_INVALIDOPCODE | \ No newline at end of file diff --git a/protocol/blockchain/script/op-codes/op-data-x.md b/protocol/blockchain/script/op-codes/op-data-x.md new file mode 100644 index 0000000..15bdbb0 --- /dev/null +++ b/protocol/blockchain/script/op-codes/op-data-x.md @@ -0,0 +1,3 @@ +# OP_DATA_X + +The OP_DATA_X op codes push a value to the top of the stack. The value pushed to the stack follows this op code and is the length of the op code interpreted as a [two's_complement](https://en.wikipedia.org/wiki/Two%27s_complement) integer. For example, OP_DATA_24 (op code 0x18) pushes the next 24 bytes in the script as a single value on the stack. \ No newline at end of file diff --git a/protocol/blockchain/script/op-codes/op-x.md b/protocol/blockchain/script/op-codes/op-x.md new file mode 100644 index 0000000..16bea59 --- /dev/null +++ b/protocol/blockchain/script/op-codes/op-x.md @@ -0,0 +1,7 @@ +# OP_X + +The OP_X op codes add a numerical value to the top of the stack. OP_0 pushes an empty byte array which is interpreted as the numerical value 0. The rest push a single byte to the top of the stack as a [two's_complement](https://en.wikipedia.org/wiki/Two%27s_complement) integer. OP_1 pushes a 1, OP_2 pushes a 2, and so on through OP_16, which adds a 16 (0x10). + +# OP_TRUE and OP_FALSE + +OP_FALSE is an alias for OP_0 while OP_TRUE is an alias for OP_1. \ No newline at end of file