<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Or require a 110k preimage to redeem, drop to the blockchain, then<br>
redeem it by sending direct to a miner.  A node trying to use that<br>
preimage would create a non-standard transaction, which may not<br>
propagate.  Similarly with an almost 4MB preimage which requires you<br>
to grind out a tiny signature to redeem in a tx small enough...<br></blockquote><div><br></div><div>Segwit&#39;s witness program validation logic ensures that each element of the passed witness stack is less-than-or-equal-to the maximum script element size (520 bytes). This check is enforced before execution itself. Therefore, even without the additional OP_SIZE check, Script will enforce a ceiling on the pre-image size. </div><div><br></div><div>We&#39;ve also recently made such an observation, resulting in a modification to our scripts similar to the one you&#39;ve detailed. Thanks for sounding the alarm with this mailing-list post! </div><div><br></div><div>Best, </div><div>Laolu</div></div></div>