New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify exactly which scripts are witness outputs #1537
Clarify exactly which scripts are witness outputs #1537
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. |
@@ -83,19 +83,23 @@ If all transactions in a block do not have witness data, the commitment is optio | |||
|
|||
=== 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the added word "direct" here. Perhaps "canonical" or "minimal" would be clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the clarification, the word "direct" makes complete sense now.
ACK 50e750a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 50e750a
No description provided.