-
Notifications
You must be signed in to change notification settings - Fork 482
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
P2WSH docs are confusing #581
Comments
"witnessScript" is also used throughout BIP141. e.g. https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH "redeem script" as used in P2SH always refers to script that appears in a transaction scriptSig while the preimage to the hash in a witness program always appears in the transaction witness. In the nested p2sh form of segwit, both scripts may appear. They are different scripts that appear in different locations and are treated differently by the script interpreter, so it makes sense that they would have different names.
|
IMO it would be best to use a term like "witnessScript" for a couple of reasons
Personally I'm for |
Could also use "witness program" which is clearly separate from scriptWitness, a variable name which refers to the entire witness object in Bitcoin Core. Also, further confusing is that its easy to see the witness as a replacement for the scriptSig (though that's not entirely accurate due to it being a list of pushes, not an executed script), at which point scriptWitness/witnessScript would be easy to assume referred to the full witness. |
"witness program" is defined in BIP 141 to be only the output script. |
I wouldn't mind renaming witnessScript to P2WSH redeemscript if that's less confusing. |
@sipa I like the idea of calling it P2WSH redeemscript... Trivial for people learning to understand the relationship: P2SH: P2SH redeemscript However, perhaps it would require some disambiguation changes in the docs to specify "P2SH redeemscript" instead of just "redeemscript? |
|
Can someone spot check this commit I made? petertodd/python-bitcoinlib@e311d27 |
I've generally always seen the witness-redeem-script either referred to as simply "redeem script" or "witness redeemScript" or similar, but the SegWit Wallet Dev guide says "witnessScript" (which is easy to confuse with "scriptWitness" the variable name in Bitcoin Core for the full witness). Thus, I'd strongly suggest we use simply "redeem script" at https://bitcoincore.org/en/segwit_wallet_dev/#creation-of-p2sh-p2wsh-address
The text was updated successfully, but these errors were encountered: