--- Log opened Sat May 14 00:00:23 2022 04:54 < kanishk779[m]> I am confused regarding the resource limitations for bitcoin scripts.... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/6325b9d352307bfdf6072bdf2e5f01d82c760c17) 04:55 < kanishk779[m]> Also Why is "tr(X!,{pk(X1!),sortedmulti_a(3,X2,X3,X4)})" an invalid descriptor ? 05:16 <@sipa> Transactions have a scriptPubKey in outputs, a scriptSig in inputs, and segwit transactions also have a witness stack in inputs. 05:17 <@sipa> Ultimately, the scriptPubKey is what commits to the conditions under which an output can be spent. 05:19 <@sipa> But if a scriptPubKey follows the P2SH pattern (OP_HASH160 OP_EQUAL), then P2SH validations occurs, which takes the last pushed element off the scriptSig (whose hash must be ), and continues as if that were the scriptPubKey instead. 05:19 <@sipa> In descriptors this is denoted as wrapping the expression in sh(). 05:20 <@sipa> This last element of the scriptSig is also called the redeemScript. 05:21 <@sipa> Next, either the scriptPubKey directly, or the redeemScript can be of the form (OP_n ), with data between 2 and 40 bytes. In that case, it is interpreted as a witness program, and the logic specific to witness validation triggers. 05:22 <@sipa> There are 3 forms of that: P2WPKH, where n=0 and data is 20 bytes. 05:22 <@sipa> P2WSH, where n=0 and data is 32 bytes. 05:22 <@sipa> Or P2TR, where n=1 and data is 32 bytes. 05:23 <@sipa> Each have their own rules about how validation proceeds after that point. P2WSH and P2TR do continue validation of another script, taken from the witness. 05:23 <@sipa> To amswer your questions 05:24 <@sipa> 1. Some of these limits are specified in BIPs and part of the consensus rules, some are policies added to prevent DoS risks on top of those. They're arbitrary in that they are set by humans. 05:26 <@sipa> 2. They're talking about the "actually executed script". That may be the scriptPubKey (in case there is no P2SH or P2WSH that redirects execution elsewhere). It may be the redeemScript in case of P2SH without P2WSH. It may be the witnessScript in case of P2WSH (inside P2SH or not), and it could be a taproot leaf script in case of P2TR. 05:26 <@sipa> 3. Indeed, for P2WSH it is the witness script. 05:27 <@sipa> As for why that descriptor is invalid... what system/implementation is this talking about? What are the ! symbols in there? 05:30 <@sipa> locking/unlocking script aren't all that well defined, I think. 05:38 <@sipa> An example of a P2WSH script that exceeds the 3600 script limit would for example be "wsh(thresh(1,pk(K1),a:pk(K2),a:pk(K3),...,a:pk(K100)))". 12:29 < kanishk779[m]> sanket1729: Regarding testing the invalid test cases, two out of three cannot be tested because the errors are not propagated from the place they are generated first.... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/b973b450f2debd75f34aeb8138ecf4534dba010e) 12:43 < sanket1729[m]> You should change the corresponding unwraps that panic to results so that there is no panic. 12:45 < sanket1729[m]> Errors should be correctly propagated. 12:45 < sanket1729[m]> You might need to unwrap from where the descriptor struct is created 19:15 -!- roconnor [~roconnor@coq/roconnor] has quit [Quit: Konversation terminated!] --- Log closed Sun May 15 00:00:24 2022