Clarify exactly which scripts are witness outputs#1537
Clarify exactly which scripts are witness outputs#1537murchandamus merged 1 commit intobitcoin:masterfrom
Conversation
|
ACK ff9feab LGTM, clears up the confusion I had regarding |
ff9feab to
50e750a
Compare
|
Rebased after the merge of #487. I believe the text here contains further improvements. |
| === Witness program === | ||
|
|
||
| A <code>scriptPubKey</code> (or <code>redeemScript</code> as defined in BIP16/P2SH) that consists of a select subset of opcodes (<code>OP_0,OP_1,OP_2,...,OP_16</code>) followed by a data push between 2 and 40 bytes gets a new special meaning. The value of the first push is called the "version byte". The following byte vector pushed is called the "witness program". | ||
| A <code>scriptPubKey</code> (or <code>redeemScript</code> as defined in BIP16/P2SH) that consists of a 1-byte push opcode (one of <code>OP_0,OP_1,OP_2,...,OP_16</code>) followed by a direct data push between 2 and 40 bytes gets a new special meaning. The value of the first push is called the "version byte". The following byte vector pushed is called the "witness program". |
There was a problem hiding this comment.
I'm not sure about the added word "direct" here. Perhaps "canonical" or "minimal" would be clearer?
There was a problem hiding this comment.
These are the terms as I use them. Bitcoin script knows 3 types of pushes:
- The OP_n opcodes (0x4f through 0x60, inclusive)
- The direct pushes (0x01 through 0x4b)
- The OP_PUSHDATA opcodes (0x4c through 0x4e)
By "minimal push" I understand "whichever of those 3 types that is applicable and minimal in encoded size". It happens to be the case that in this context (for pushes of 2 to 40 bytes) the direct push is always the minimal one, but that seems like a very indirect way of describing it.
It's true that there isn't any well-established terminology for what I call direct pushes here, but given that it's clarified explicitly immediately after, is that an issue?
There was a problem hiding this comment.
Thank you for the clarification, the word "direct" makes complete sense now.
|
ACK 50e750a |
No description provided.