1 2019-11-06T00:14:23  *** notmandatory has quit IRC
  2 2019-11-06T00:15:36  *** michaelfolkson has quit IRC
  3 2019-11-06T00:29:26  *** soju has joined ##taproot-bip-review
  4 2019-11-06T00:34:15  *** soju has quit IRC
  5 2019-11-06T00:48:11  *** Chris_Stewart_5 has joined ##taproot-bip-review
  6 2019-11-06T00:54:57  *** jb55 has quit IRC
  7 2019-11-06T00:57:25  *** lightlike has quit IRC
  8 2019-11-06T01:10:47  *** pinheadmz has quit IRC
  9 2019-11-06T01:10:56  *** Chris_Stewart_5 has quit IRC
 10 2019-11-06T01:27:53  *** thestack has quit IRC
 11 2019-11-06T01:49:45  *** pglazman has quit IRC
 12 2019-11-06T02:01:34  *** raj_149 has joined ##taproot-bip-review
 13 2019-11-06T02:32:43  *** nick_freeman has joined ##taproot-bip-review
 14 2019-11-06T02:36:03  *** nick_fre_ has quit IRC
 15 2019-11-06T03:28:06  *** pinheadmz has joined ##taproot-bip-review
 16 2019-11-06T03:37:10  *** nick_freeman has quit IRC
 17 2019-11-06T03:42:17  *** nick_freeman has joined ##taproot-bip-review
 18 2019-11-06T04:10:47  *** nick_freeman has quit IRC
 19 2019-11-06T04:20:30  <instagibbs> r251d, i think those variables could stand to be named, I agree
 20 2019-11-06T04:31:28  *** pinheadmz has quit IRC
 21 2019-11-06T04:31:59  *** pglazman has joined ##taproot-bip-review
 22 2019-11-06T05:40:31  *** pglazman has quit IRC
 23 2019-11-06T06:01:48  *** CubicEarth has quit IRC
 24 2019-11-06T06:26:59  *** HighOnBtc has quit IRC
 25 2019-11-06T06:41:51  *** xoyi- has joined ##taproot-bip-review
 26 2019-11-06T07:15:15  *** andytoshi has quit IRC
 27 2019-11-06T08:00:26  *** eltneg has quit IRC
 28 2019-11-06T08:29:42  *** xoyi- has quit IRC
 29 2019-11-06T08:31:30  *** Tibo has quit IRC
 30 2019-11-06T08:36:37  <aj> sipa: what's with the swap/if/endif for 4-of-10k ? just use CSA directly for that?
 31 2019-11-06T08:45:30  <digi_james> Hmm. Wondering what the witness stack size limit is? Straight-up CSA would require 10k-4 wit stack elements for all the 0's?
 32 2019-11-06T08:48:22  <digi_james> If I understand correctly, in sipa's example the 0's are in the tapscript, which is one wit element.
 33 2019-11-06T08:49:15  <gmaxwell> aj: Probably because I needlessly primed him with mention of IF-gating.
 34 2019-11-06T08:52:05  <digi_james> gmaxwell: There are no witness stack length limits, right?
 35 2019-11-06T08:52:32  <digi_james> I mean, nr of elements in wit stack.
 36 2019-11-06T08:59:53  *** b10c has joined ##taproot-bip-review
 37 2019-11-06T09:00:55  <gmaxwell> Just that implied by the maximum transaction size.
 38 2019-11-06T09:02:01  <digi_james> Thank you
 39 2019-11-06T09:02:06  <gmaxwell> One of the ideas behind taproot is that it makes vastly more expensive scripts reasonable to use-- because mostly you use a cooperative resolution, and the complex script just exists as a threat.
 40 2019-11-06T09:02:45  <gmaxwell> So thats a good reason to be pretty permissive with limits.  Limits also greatly complicate automated script generation, composition, etc.
 41 2019-11-06T09:05:05  <aj> digi_james, gmaxwell: the witness stack has a 1000 element limit including during execution
 42 2019-11-06T09:05:37  <aj> (see script/script.h MAX_STACK_SIZE)
 43 2019-11-06T09:10:18  <digi_james> aj: Oh thx, whereas witness element can be <= 10k I recall. So it seems one would have push the null's required for csa to the tapscript.
 44 2019-11-06T09:10:32  <digi_james> Sorry, 10kB
 45 2019-11-06T09:23:44  <aj> digi_james: for segwit v0  the script can be 10k in length; the witness data then fulfils that. taproot drops that limit
 46 2019-11-06T09:24:59  <aj> digi_james: there's limits on how big each element on the stack can be, see MAX_SCRIPT_ELEMENT_SIZE eg
 47 2019-11-06T09:28:15  *** willcl_ark has quit IRC
 48 2019-11-06T09:39:03  <digi_james> aj: I am thinking through our (4-of-largeN) CSA example again: So our (CSA) tapscript occupies just one witness element, right? If its satisfaction requires 10k witness elements (mostly nulls), we hit MAX_STACK_SIZE upon execution, because these are pushed on the script stack at once before tapscript evaluation. If we use the (if gated) modified CSA tapscript, only 4 satisfying witness elements are
 49 2019-11-06T09:39:03  <digi_james> pushed to the stack before modified CSA is run, and no limits are hit, is this correct?
 50 2019-11-06T09:44:06  *** willcl_ark has joined ##taproot-bip-review
 51 2019-11-06T09:57:43  <aj> digi_james: see https://github.com/sipa/bips/blob/bip-schnorr/bip-tapscript.mediawiki "Stack + altstack element count limit" -- you'd be limited to 996 empty signatures and 4 valid signatures on the stack
 52 2019-11-06T10:01:28  <digi_james> aj: Thanks. So we have a workaround for that limit now :)
 53 2019-11-06T10:01:43  <aj> digi_james: i think something like   DEPTH {2k+1} EQUALVERIFY { IFDUP NOTIF <p> CHECKSIGVERIFY ENDIF 1SUB }*n DEPTH 0 EQUAL
 54 2019-11-06T10:02:39  <aj> digi_james: would let you have a witness stack of {number of keys to skip, valid signature}*k + {nuber of keys to get to the end}  to get to a k-of-{very large n} multisig
 55 2019-11-06T10:12:34  <digi_james> aj: Oh you mean without CSA? Nice!
 56 2019-11-06T10:16:54  <aj> oh, maybe there needs to be a OP_DROP before the DEPTH in the above? probably some other tweaks needed to make it actually work too
 57 2019-11-06T10:19:25  <digi_james> I had to look up op_depth :)
 58 2019-11-06T10:31:26  *** jonatack has joined ##taproot-bip-review
 59 2019-11-06T10:49:14  <gmaxwell> sounds like a good script for someone to flesh out and test.
 60 2019-11-06T10:49:29  <gmaxwell> (and potentially somewhat useful)
 61 2019-11-06T11:05:13  *** k7 has joined ##taproot-bip-review
 62 2019-11-06T11:07:07  *** k7 has left ##taproot-bip-review
 63 2019-11-06T11:07:09  *** k7 has joined ##taproot-bip-review
 64 2019-11-06T11:07:35  *** k7 has left ##taproot-bip-review
 65 2019-11-06T11:21:20  *** daniel_____ has joined ##taproot-bip-review
 66 2019-11-06T11:46:06  *** Chris_Stewart_5 has joined ##taproot-bip-review
 67 2019-11-06T11:53:15  *** real_or_random has quit IRC
 68 2019-11-06T11:55:32  *** real_or_random has joined ##taproot-bip-review
 69 2019-11-06T12:20:46  *** orfeas has joined ##taproot-bip-review
 70 2019-11-06T12:20:53  *** pyskell has quit IRC
 71 2019-11-06T12:45:00  *** stacie has joined ##taproot-bip-review
 72 2019-11-06T12:54:11  *** Chris_Stewart_5 has quit IRC
 73 2019-11-06T12:59:21  *** Chris_Stewart_5 has joined ##taproot-bip-review
 74 2019-11-06T13:07:37  *** jonatack has quit IRC
 75 2019-11-06T13:19:27  *** nick_freeman has joined ##taproot-bip-review
 76 2019-11-06T13:33:01  *** HighOnBtc has joined ##taproot-bip-review
 77 2019-11-06T13:51:49  *** lightlike has joined ##taproot-bip-review
 78 2019-11-06T13:56:47  *** HighOnBtc has quit IRC
 79 2019-11-06T14:05:53  *** Chris_Stewart_5 has quit IRC
 80 2019-11-06T14:09:00  *** Chris_Stewart_5 has joined ##taproot-bip-review
 81 2019-11-06T14:27:29  <instagibbs> warning, OP_DEPTH isn't in miniscript :P
 82 2019-11-06T14:27:32  <instagibbs> IIRC
 83 2019-11-06T14:29:37  *** jonatack has joined ##taproot-bip-review
 84 2019-11-06T14:36:02  *** pinheadmz has joined ##taproot-bip-review
 85 2019-11-06T14:49:11  *** pyskell has joined ##taproot-bip-review
 86 2019-11-06T15:15:52  <aj> OP_DEPTH doesn't compose so isn't miniscript friendly
 87 2019-11-06T15:38:14  *** HighOnBtc has joined ##taproot-bip-review
 88 2019-11-06T15:49:03  *** soju has joined ##taproot-bip-review
 89 2019-11-06T15:53:50  *** pglazman has joined ##taproot-bip-review
 90 2019-11-06T15:54:16  *** HighOnBtc has quit IRC
 91 2019-11-06T16:10:45  *** pinheadmz has quit IRC
 92 2019-11-06T16:39:59  *** michaelfolkson has joined ##taproot-bip-review
 93 2019-11-06T17:06:42  *** soju has quit IRC
 94 2019-11-06T17:20:51  *** CubicEarth has joined ##taproot-bip-review
 95 2019-11-06T17:30:28  *** stacie has quit IRC
 96 2019-11-06T17:37:41  *** stacie has joined ##taproot-bip-review
 97 2019-11-06T18:02:43  <gmaxwell> miniscript has a lot of limitations, so that isn't a surprise.
 98 2019-11-06T18:03:35  <gmaxwell> though I think this example has the largest spending weight difference I've seen yet for an optimized script vs what miniscript could make. (for thing which miniscript could model)
 99 2019-11-06T18:06:02  *** orfeas has quit IRC
100 2019-11-06T18:11:01  *** michaelfolkson has quit IRC
101 2019-11-06T18:15:57  *** jb55 has joined ##taproot-bip-review
102 2019-11-06T18:30:08  *** michaelfolkson has joined ##taproot-bip-review
103 2019-11-06T18:34:43  *** stacie has quit IRC
104 2019-11-06T18:39:14  *** pinheadmz has joined ##taproot-bip-review
105 2019-11-06T18:48:27  *** pyskell has quit IRC
106 2019-11-06T19:20:26  *** stacie has joined ##taproot-bip-review
107 2019-11-06T19:21:57  *** b10c has quit IRC
108 2019-11-06T19:28:55  <sipa> aj: a more composable/depthless version would be:
109 2019-11-06T19:30:00  <sipa> 0 (SWAP IFDUP 0NOTEQUAL IF SUB1 SWAP ELSE <key> CHECKSIGADD ENDIF)* 4 EQUAL
110 2019-11-06T19:31:33  <sipa> aj: i think you need 0NOTEQUAL somewhere as well due to minimalif rule
111 2019-11-06T19:35:56  <sipa> the (SWAP IFDUP 0NOTEQUAL IF SUB1 SWAP ELSE <key> CHECKSIGADD ENDIF) sequence turns a stack ending with [sig,c>0,n] into [sig,c,n], and a stack ending in [sig,0,n] into [n+(sig valid)]
112 2019-11-06T19:39:41  <sipa> actually, this does not work, as it doesn't guarantee exactly 8 elements were popped off the stack
113 2019-11-06T19:41:49  <sipa> you'd need something (SWAP IFDUP 0NOTEQUAL IF SUB1 SWAP ELSE SWAP <key> CHECKSIGVERIFY ADD1 ENDIF)* 4 EQUALVERIFY
114 2019-11-06T19:42:06  <sipa> there must be a way to avoid 3 SWAPs
115 2019-11-06T19:48:41  *** stacie has quit IRC
116 2019-11-06T19:53:34  <gmaxwell> stuff like that makes me wish every opcode had two bits for 'swap' and 'dup' embedded in them, and great sympathy for CISC cpu designers.
117 2019-11-06T19:54:17  <sipa> and a conditional execution bit, and control register? :)
118 2019-11-06T19:55:12  <sipa> having a separate explicit input stack and temporary variables stack would also do wonders
119 2019-11-06T20:58:05  *** michaelfolkson has quit IRC
120 2019-11-06T21:18:42  <Chris_Stewart_5> Has anyone committed to updating the hard coded test vectors found here? https://github.com/sipa/bitcoin/tree/taproot/src/test/data
121 2019-11-06T21:19:10  <Chris_Stewart_5> It's useful for library developers
122 2019-11-06T21:19:22  <Chris_Stewart_5> sighash.json 6 years :$
123 2019-11-06T21:20:22  <pinheadmz> sipa: https://github.com/sipa/bips/blob/bip-schnorr/bip-tapscript.mediawiki#transaction-digest says key_value is 0x00 but in the code I see 0x02
124 2019-11-06T21:20:24  <pinheadmz> https://github.com/sipa/bitcoin/blob/527ed7d4b230a694ee223a000cd5fd7495a00fcb/src/script/interpreter.cpp#L1447
125 2019-11-06T21:20:44  <pinheadmz> s/key_value/key_version
126 2019-11-06T21:20:50  <sipa> pinheadmz: fix it!
127 2019-11-06T21:21:26  <pinheadmz> :+1:
128 2019-11-06T21:22:25  <pinheadmz> any rationale for 2 instead of 0?
129 2019-11-06T21:23:49  <sipa> yes, because it used to be equal to the first byte of the pubkey (ignoring the sign bit)
130 2019-11-06T21:23:56  <pinheadmz> ah
131 2019-11-06T21:23:56  <sipa> 0 makes most sense now
132 2019-11-06T21:24:24  <pinheadmz> oh wait haha, "fix it!" -- the BIP or the code?
133 2019-11-06T21:24:45  <pinheadmz> sounds like change the code to 0 in both those places i linked?
134 2019-11-06T21:26:20  <sipa> yes, the bip was updated from 2 to 0 when xonly was introduced
135 2019-11-06T21:26:24  <sipa> but the code wasn't
136 2019-11-06T21:26:30  <pinheadmz> ok
137 2019-11-06T21:26:31  <sipa> i'll do it in my next rebase
138 2019-11-06T21:26:37  <pinheadmz> ok! cheers
139 2019-11-06T22:14:30  *** HighOnBtc has joined ##taproot-bip-review
140 2019-11-06T22:24:31  *** pinheadmz has quit IRC
141 2019-11-06T22:44:35  *** Chris_Stewart_5 has quit IRC
142 2019-11-06T22:50:02  <maaku> gmaxwell: have you seen the J1 forth CPU? it has those sorts of bits embedded in its opcode decoding
143 2019-11-06T22:56:13  *** Chris_Stewart_5 has joined ##taproot-bip-review
144 2019-11-06T23:15:08  *** Chris_Stewart_5 has quit IRC
145 2019-11-06T23:19:00  *** soju has joined ##taproot-bip-review
146 2019-11-06T23:53:45  *** michaelfolkson has joined ##taproot-bip-review
147 2019-11-06T23:56:48  *** michaelfolkson has quit IRC