<oembed><type>rich</type><version>1.0</version><author_name>npub1fvuxqdqg7klqqgy3yy8gdxjv4phu92sll5y8zqm2qe5qdrhxymhqf3vq7f</author_name><author_url>https://nostr.ae/npub1fvuxqdqg7klqqgy3yy8gdxjv4phu92sll5y8zqm2qe5qdrhxymhqf3vq7f</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-09-22&#xA;📝 Original message:&gt;&#xA;&gt; There are other solutions to this problem that could have been taken&#xA;&gt; instead, such as committing to the number of items or maximum size of&#xA;&gt; the stack as part of the sighash data, but cleanstack was the approach&#xA;&gt; taken.&#xA;&#xA;&#xA;The lack of signed maximum segwit stack size was one of the objections to&#xA;segwit I presented last year. This together with the unlimited segwit stack&#xA;size.&#xA;&#xA;However, committing to the maximum stack size (in bytes) for an input is&#xA;tricky. The only place where this could be packed is in sequence_no, with a&#xA;soft-fork. E.g. when transaction version is 2 and and only when lock_time&#xA;is zero.&#xA;&#xA;For transactions with locktime &gt;0, we could soft-fork so transactions add a&#xA;last zero-satoshi output whose scriptPub contains OP_RETURN and followed by&#xA;N VarInts, containing the maximum stack size of each input.&#xA;Normally, for a 400 byte, 2-input transaction, this will add 11 bytes, or a&#xA;2.5% overhead.&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&gt; Arguably for a future script version upgrade one of these other&#xA;&gt; approaches should be taken to allow for shorter tail-call scripts.&#xA;&gt;&#xA;&gt; Mark&#xA;&gt;&#xA;&gt; * Well, almost any. You could end the script with DEPTH EQUAL and that&#xA;&gt;   is a compact way of ensuring the stack is clean (assuming the script&#xA;&gt;   finished with just &#34;true&#34; on the stack). Nobody does this however&#xA;&gt;   and burning two witness bytes of every redeem script going forward&#xA;&gt;   as a protective measure seems like an unnecessary ask.&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20170922/cc607dfd/attachment-0001.html&gt;</html></oembed>