Skip to content

Changes to the standard scripts#211

Open
raulcano wants to merge 3 commits intodiscreetlogcontracts:masterfrom
raulcano:valid-scripts
Open

Changes to the standard scripts#211
raulcano wants to merge 3 commits intodiscreetlogcontracts:masterfrom
raulcano:valid-scripts

Conversation

@raulcano
Copy link
Copy Markdown

The description in the specs about the acceptable standard scripts is confusing (or wrong, depending on how it's read).
For example, the typical P2PKH script has this form:
OP_DUP OP_HASH160 <20-bytes> OP_EQUALVERIFY OP_CHECKSIG

not this one (as written in the current specs - notice the number '20' in the script)
OP_DUP OP_HASH160 20 <20-bytes> OP_EQUALVERIFY OP_CHECKSIG

I might be wrong, but I couldn't find a reference where such '20' or '32' is pushed before the actual hashes. Maybe it was intended for clarity?
In any case, I believe my proposal here is slightly more clear.
Reference: https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address_(pay-to-pubkey-hash)

Copy link
Copy Markdown
Contributor

@Christewart Christewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me as this appears to be the convention throughout the rest of the Script ecosystem

@raulcano
Copy link
Copy Markdown
Author

Some further clarification to my original post:

According to https://en.bitcoin.it/wiki/Script:
"When notating scripts, data to be pushed to the stack is generally enclosed in angle brackets and data push commands are omitted. Non-bracketed words are opcodes. These examples include the “OP_” prefix, but it is permissible to omit it. Thus “ OP_2 OP_CHECKMULTISIG" may be abbreviated to " 2 CHECKMULTISIG".

So it is true that the data push opcode is part of the actual script, but not displayed in common notation. I suppose my PR still makes sense if we are to keep the scripts aligned with this notation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants