1 2016-12-04 22:44:47 <plorph> on the Witness program in BIP16 it says "A scriptPubKey (or redeemScript as defined in BIP16/P2SH) that consists of a 1-byte push opcode (for 0 to 16) followed by a data push between 2 and 40 bytes gets a new special meaning." what is 0 to 16 referring to?
2 2016-12-04 22:49:38 <sipa> nothing, it's just the definition
3 2016-12-04 22:50:15 <sipa> nominally, it's a version number
4 2016-12-04 22:50:38 <sipa> but it doesn't need to be - part of the version data could be inside the 2-to-40 byte push as well
5 2016-12-04 22:51:09 <sipa> the only currently defined witness program version (v0) uses OP_0 plus a 20 byte push for P2WPKH and OP_0 plus a 32 byte push for P2WSH
6 2016-12-04 22:56:08 <plorph> sipa: okay, so a v0 P2WPKH program would be 0x00 0x14 <20 bytes> where the first OP_0 is just an indicator for P2WPKH, and this is how nodes can tell it is a witness script?
7 2016-12-04 22:57:23 <sipa> right, but you need to distinguish between "witness program" (which is just any OP_0, OP_1, ..., OP_16 + push), verses a specific currently defined witness program version
8 2016-12-04 22:57:35 <plorph> ive just recently understood regular script, and now im trying to get segwit
9 2016-12-04 23:04:35 <plorph> hm ok, so what im getting so far is that there are 2 push operations in a full segwit script, one is a version byte push and the other is the witness program, in that an entire script will consist of the 2 pushes, and not just the witness program?