Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Fix scriptPubKey terminology #563
Conversation
petertodd
added some commits
Sep 19, 2014
petertodd
changed the title from
Fix script pub key terminology
to
Fix scriptPubKey terminology
Sep 19, 2014
gmaxwell
commented on _includes/ref_transactions.md in 28a584c
Sep 19, 2014
|
holy cow. 0_o |
|
There's a lot that needs to be fixed... I didn't realise how bad it all was until I told a client's developers to go read the dev docs to get up to speed and had them come back with tonnes of questions. :( |
luke-jr
replied
Sep 19, 2014
|
Why remove the true part (rendering the output unspendable)? |
|
Because it's not necessarily true - OP_RETURN only renders the output unspendable if it's executed. Saying "rendering the output unspendable" is redundent and leads people to believe the presence of the opcode always does that; note how all the OP_VERIFY etc. descriptions simply say "terminate the script in failure" |
|
The OP_RETURN and OP_1NEGATE commits fix outright errors, so I'm going to cherry pick and push them in a few minutes. The text changed in commit 1a8979b was based on a suggestion by @gmaxwell, so I'd appreciate feedback from him, if possible. As for replacing "input script" and "output script" with the terms used in Bitcoin Core, I don't have any objection, although I do wish we had a term that was less confusing than scriptPubKey. If anyone doesn't want this changed, please comment---otherwise, I'll more throughly review this with the aim of merging it in a few days. |
|
re: scriptPubKey, the way I've been explaining it is to say that Bitcoin implements a generalization of a standard pubkey crypto system where rather than directly using pubkeys and signatures it indirectly uses pubkeys and signatures through a small forth-like language. This keeps it clear that the scripting system is fundementally about authorization and verification - just like any other pubkey crypto system - rather than some kind of "computation" being performed. Secondly given that the Satoshi Bitcoin Core codebase is fairly simple I always strongly recommend that developers familiarize themselves with it directly. re: 1a8979b open to debate - my thinking there is we don't need newer developers to worry about the history of why scriptSig and scriptPubKey were separated. What's more important is that whatever you put in a scriptSig that isn't data isn't signed anyway, so there is no point. |
|
@petertodd that's a good explanation. I may see if I can put that somewhere in the docs. If your client's devs have time, we would really appreciate feedback on the docs. Bug reports are great, because there are mistakes, but I'd love to also get suggestions on how we can improve the guide so that they don't have so many questions after reading it. Devs can submit issues here, post to our mailing list, or email me directly at dave@dtrt.org. Thanks again for the pull. I'll try to look at it in more detail tomorrow. |
|
I concur, this kind of feedback would be highly useful. |
|
scriptPubKey and scriptSig come from the hungarian notation BCCore used to use. Probably it would be ideal to just refer to "pubkeys" and "signatures" with an understanding both of those are scripts in Bitcoin. Maybe being more verbose with "pubkey script" and "signature script" avoids more questions though. |
luke-jr
commented on 1a8979b
Sep 19, 2014
|
I had to read this a few times before I followed it (grammar, not logic). Maybe reword slightly?
|
|
I think that's better. How about this?
P2SH redemptions already don't allow non-data-pushing opcodes - might be worth a mention here. |
harding
replied
Sep 24, 2014
|
@petertodd & @luke-jr: how about this for the note on non-data-op-codes:
I rephrased it to try to make the advice more clear ("should only contain...") and also mention the P2SH spending rules. |
|
I like how @luke-jr's suggested terms "pubkey script" and "signature script" re-enforce @petertodd's description of Bitcoin containing a generalized public key cryptosystem. I think we could enhance that effect by explicitly specifying "secp256k1 public keys" and "secp256k1 signatures" whenever referring to parts of that specific cryptosystem. For example:
Using those suggested terms should allow novice Bitcoin developers to immediately figure out what scriptPubKey and scriptSig mean when they first encounter them. Although it's a very minor concern, this would create nice parallelism between the terms "pubkey script", "signature script", and "redeem script". (Instead of scriptPubKey, scriptSig, and redeemScript.) How do people feel about me doing the following:
|
harding
and 1 other
commented on an outdated diff
Sep 19, 2014
harding
referenced this pull request
Sep 20, 2014
Merged
Use Terms "Pubkey Script" And "Signature Script" #566
|
I opened pull #566 which makes the changes described in my comment above---specifically, using the terms "pubkey script" and "signature script" suggested by @luke-jr. That pull does not include any version of the rephrased paragraph about data-pushing opcodes in signature scripts. I figure we can work on that once we decide what terminology to use. All of @petertodd's other commits in this pull have already been committed or are included in pull #566. Thanks! |
|
IIRC, This pull request is still open due to pending discussions on commit 1a8979b. @harding If that sounds good to you, I suggest you merge your version for now (and at some point revisit the glossary idea to address inconsistent vocabulary as suggested by @petertodd) |
harding
closed this
in
1061571
Oct 23, 2014
|
As suggested by @saivann, the following version of the revised paragraph was added to the text in commit 1061571:
Problems or suggestions for improvements to that paragraph can be made by issue or pull request. Thanks! |
petertodd commentedSep 19, 2014
This is causing quite a bit of confusion, for example by people looking
in the Bitcoin Core sourcecode and seeing the term 'scriptPubKey'
instead.
Also fixed a few other errors from the transacitons reference section.